How salvador-arreola/frugalia-mcp works
Frugalia is a GKE FinOps MCP service: scheduled CronJobs and Prometheus alerts initiate an agent workflow, which invokes MCP tools to analyze cluster costs and, with approval, apply resource changes. The runtime dynamically loads tools; sampled source supports Kubernetes and Prometheus access, while the README documents the agent, gateway, billing, Slack, and deployment integrations. Those unsampled capabilities are represented at their documented configuration paths; their internal wiring is not inferred beyond documented flows.
Main entry points: server.py Dynamic MCP Server · frugalia-agent.yaml Frugalia Agent · gateway.yaml MCP Gateway · utils.py Prometheus Query Utility
Components 24
Initiation and Agent
- Scheduled CronJobs
kubernetes/cronjobs - Prometheus Alert Rules
kubernetes/prometheus-alerts - Alert Webhook
event-driven-webhook/main.py - Frugalia Agent
kubernetes/frugalia-agent.yaml
MCP Access
- Remote MCP Server
kubernetes/remotemcp.yaml - MCP Gateway
kubernetes/gateway.yaml - Dynamic MCP Server
src/core/server.py - Server Entry Point
src/main.py
Cost Analysis
- Rightsizing Analysis
src/tools/analyze_rightsizing.py - Node Utilization
src/tools/check_node_utilization.py - Spot Candidate Safety
src/tools/identify_spot_candidates.py - Zombie Detection
src/tools/detect_zombie_resources.py - Resource Discovery
src/tools/get_kubernetes_resources.py - Prometheus Metrics Tool
src/tools/get_prometheus_metrics.py - Nodepool Check
src/tools/check_nodepool_types.py
Resource Changes
- Resource Patch Tool
src/tools/apply_resource_patch.py
Cluster and Integrations
- Prometheus / AlertManager
- Kubernetes API
- Prometheus Query Utility
src/core/utils.py - Billing MCP
kubernetes/genai-toolbox-mcp.yaml - Slack MCP
kubernetes/slack-mcp.yaml
Other components
- AI Agent / Scheduler
- BigQuery
- Slack API
Connections 34
- AI Agent / Scheduler → Scheduled CronJobs: schedules
- Scheduled CronJobs → Frugalia Agent: invokes
- Prometheus Alert Rules → Prometheus / AlertManager: configures alerts
- Prometheus / AlertManager → Alert Webhook: posts alerts
- Alert Webhook → Frugalia Agent: invokes
- AI Agent / Scheduler → Frugalia Agent: requests analysis
- Frugalia Agent → Remote MCP Server: requests tools
- Remote MCP Server → MCP Gateway: routes traffic
- MCP Gateway → Dynamic MCP Server: routes requests
- Server Entry Point → Dynamic MCP Server: starts
- Dynamic MCP Server → Rightsizing Analysis: loads tools
- Dynamic MCP Server → Node Utilization: loads tools
- Dynamic MCP Server → Spot Candidate Safety: loads tools
- Dynamic MCP Server → Zombie Detection: loads tools
- Dynamic MCP Server → Resource Discovery: loads tools
- Dynamic MCP Server → Prometheus Metrics Tool: loads tools
- Dynamic MCP Server → Resource Patch Tool: loads tools
- Dynamic MCP Server → Nodepool Check: loads tools
- Rightsizing Analysis → Kubernetes API: reads workloads
- Rightsizing Analysis → Prometheus Query Utility: queries usage
- Node Utilization → Kubernetes API: reads nodes
- Node Utilization → Prometheus Query Utility: queries usage
- Spot Candidate Safety → Kubernetes API: checks workloads
- Zombie Detection → Kubernetes API: scans resources
- Resource Discovery → Kubernetes API: lists resources
- Resource Patch Tool → Kubernetes API: patches or deletes
- Prometheus Metrics Tool → Prometheus Query Utility: queries metrics
- Prometheus Query Utility → Prometheus / AlertManager: queries
- Nodepool Check → Kubernetes API: checks nodepools
- MCP Gateway → Billing MCP: routes tool calls
- MCP Gateway → Slack MCP: routes tool calls
- Billing MCP → BigQuery: queries billing
- Slack MCP → Slack API: sends reports
- Frugalia Agent → Slack MCP: requests reports