@costglass/mcp
v1.0.0
Published
CostGlass Model Context Protocol (MCP) Server for FinOps and Cloud Cost Intelligence
Maintainers
Readme
CostGlass Model Context Protocol (MCP) Server
Connects AI coding assistants and LLM clients (such as Claude Desktop, Cursor, Claude Code, and Windsurf) directly to your CostGlass multi-cloud FinOps intelligence platform.
With the CostGlass MCP server, your AI agent can query cloud spend, investigate cost anomalies, inspect Kubernetes cluster efficiency, and uncover waste directly from your editor or chat terminal.
🚀 Features
- Multi-Cloud Spend Queries: Ask natural language questions like "What were our top 5 cloud spenders last month?" or "How much did AWS DynamoDB cost in eu-west-1 over the last 30 days?".
- Anomaly Detection & Diagnosis: Retrieve detected cost spikes with plain-English root causes and affected accounts.
- Actionable Savings: Fetch rightsizing, idle resource recommendations, and potential monthly savings (£/$).
- Kubernetes FinOps: Query cluster allocation, namespace costs, and pod efficiency.
- Cloud Budgets: Inspect budget status and threshold alerts.
- Prompts & Resources: Pre-built FinOps audit workflows and live spend resources.
🛠️ Quick Setup
1. Generate an API Key in CostGlass
Generate a CostGlass API Key with read scope:
- In the CostGlass web app under Settings → API Keys
- Or via the API:
(Returnscurl -X POST https://api.costglass.com/v1/api-keys \ -H "Authorization: Bearer <your-session-token>" \ -H "Content-Type: application/json" \ -d '{"name": "Cursor MCP Key"}'cg_live_...)
2. Configure Your AI Client
A. Claude Desktop
Edit your claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"costglass": {
"command": "node",
"args": ["/absolute/path/to/OpsBeam/mcp-server/bin/costglass-mcp.js"],
"env": {
"COSTGLASS_API_URL": "https://api.costglass.com",
"COSTGLASS_API_KEY": "cg_live_your_api_key_here"
}
}
}
}(Or via npx once published: "command": "npx", "args": ["-y", "@costglass/mcp"])
B. Cursor IDE
In your project root, add or update .cursor/mcp.json:
{
"mcpServers": {
"costglass": {
"command": "node",
"args": ["/absolute/path/to/OpsBeam/mcp-server/bin/costglass-mcp.js"],
"env": {
"COSTGLASS_API_URL": "https://api.costglass.com",
"COSTGLASS_API_KEY": "cg_live_your_api_key_here"
}
}
}
}C. Claude Code CLI
Run:
claude mcp add costglass node /absolute/path/to/OpsBeam/mcp-server/bin/costglass-mcp.js -e COSTGLASS_API_URL=https://api.costglass.com -e COSTGLASS_API_KEY=cg_live_your_api_key_here🧰 Available Tools
| Tool | Description | Key Parameters |
|---|---|---|
| costglass_query_costs | Query spend across AWS, Azure, GCP | dimension (SERVICE, REGION, LINKED_ACCOUNT), time_range (current_month, last_30_days, last_month, etc.), granularity (DAILY, MONTHLY), service, region, account, provider |
| costglass_get_anomalies | Fetch cost spikes and AI root-cause explanations | status (open, resolved), severity (critical, high, medium), provider |
| costglass_get_savings_recommendations | Retrieve idle resources & rightsizing opportunities | min_savings (optional float) |
| costglass_get_kubernetes_costs | Inspect K8s cluster allocation and efficiency | view (summary, allocation, efficiency, rightsizing) |
| costglass_get_budgets | Check budget status and threshold alerts | (None) |
| costglass_get_connected_accounts | List connected AWS orgs, Azure, and GCP accounts | (None) |
| costglass_get_cost_filters | Discover valid services, regions, and accounts | (None) |
📑 Resources & Prompts
Resources
costglass://summary/current-month: Live monthly spend summary.costglass://anomalies/active: Real-time active cost anomalies.
Prompts
/finops_audit: Triggers a comprehensive multi-cloud review of spend drivers, anomalies, and quick-win savings./investigate_cost_spike: Step-by-step investigation to isolate sudden cloud spend spikes.
🧪 Testing
Run the test suite:
cd mcp-server
npm test