Provides tools for managing Kubecost resources within Kubernetes environments, including budget management, cost allocation analysis, and asset monitoring for Kubernetes clusters.
Enables running the MCP server, with specific version requirements (v18 or higher) for proper functionality.
Used for package management during development of the MCP server.
Allows sending budget alerts and notifications to Slack via webhooks when spending thresholds are exceeded.
Kubecost MCP Server
An implementation of Model Context Protocol (MCP) server for Kubecost, enabling AI assistants to interact with your Kubecost cost management platform through natural language. This server allows for seamless integration with Visual Studio Code, Cursor, and other MCP clients through stdio transport protocol.
Features
- Transport Protocols: Supports stdio transport mode for flexible integration with different clients
- Complete Kubecost API Integration: Provides comprehensive access to Kubecost resources and operations
- Budget Management: Full CRUD operations for budget rules with notifications
- Cost Analysis: Access to cost allocation and asset data
- AI Assistant Ready: Pre-configured tools for AI assistants to interact with Kubecost in natural language
Installation
Prerequisites
- Node.js (v18 or higher recommended)
- pnpm package manager (for development)
- Kubecost instance with API access
- Kubecost API token or username/password
Usage with Cursor
- Follow the Cursor documentation for MCP support, and create a
.cursor/mcp.json
file in your project:
- Start a conversation with Agent mode to use the MCP.
Usage with VSCode
- Follow the Use MCP servers in VS Code documentation, and create a
.vscode/mcp.json
file in your project:
- Start a conversation with an AI assistant in VS Code that supports MCP.
Usage with Claude Desktop
- Follow the MCP in Claude Desktop documentation, and create a
claude_desktop_config.json
configuration file:
- Configure Claude Desktop to use this configuration file in settings.
Authentication Options
You can authenticate with Kubecost using either:
- API Token (recommended):
- Username/Password:
Self-signed Certificates
If your Kubecost instance uses self-signed certificates or certificates from a private Certificate Authority (CA), you may need to add the following environment variable to your configuration:
This disables TLS certificate validation for Node.js when connecting to Kubecost instances using self-signed certificates or certificates from private CAs that aren't trusted by your system's certificate store.
Warning: Disabling SSL verification reduces security. Use this setting only in development environments or when you understand the security implications.
Available Tools
The server provides the following Kubecost management tools:
Budget Management
list_budgets
: List all budget rulesget_budget
: Get detailed information about a specific budget rulecreate_budget
: Create a new budget ruleupdate_budget
: Update an existing budget ruledelete_budget
: Delete a budget rule
Cost Analysis
get_cost_allocation
: Get cost allocation data with filtering and aggregationget_assets
: Get asset data with filtering and aggregationhealth_check
: Check if Kubecost API is healthy and accessible
Budget API Examples
Create a Weekly Budget
Create a budget that resets every Wednesday with a budget of $100.00 USD, and will send an alert via email when spending has exceeded 75% of the spend limit:
Create a Monthly Budget
Create a budget for the kubecost
namespace which resets on the 1st of every month with a budget of $400.00 USD, and will send alerts via Slack and Microsoft Teams when spending has exceeded $100.00 of the spend limit:
For Development
- Clone the repository:
- Install project dependencies:
- Start the development server with hot reloading enabled:
Once the server is running, you can utilize the MCP server within Visual Studio Code or other MCP client.
Environment Variables
Variable | Required | Description |
---|---|---|
KUBECOST_BASE_URL | Yes | The base URL of your Kubecost instance |
KUBECOST_API_TOKEN | No* | API token for authentication |
KUBECOST_USERNAME | No* | Username for basic authentication |
KUBECOST_PASSWORD | No* | Password for basic authentication |
*Either API token or username/password combination is required.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License
About
This project provides a Model Context Protocol (MCP) server for Kubecost, enabling AI assistants to interact with cost management data through natural language.
Topics
kubernetes devops ai cost-management mcp kubecost model-context-protocol mcp-server budget-api cost-analysis
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
An implementation that enables AI assistants to interact with Kubecost cost management platform through natural language, providing access to budget management and cost analysis features.
Related MCP Servers
- AsecurityFlicenseAqualityA server that provides advanced mathematical and financial calculation capabilities for AI code assistants, enabling them to perform complex calculations like symbolic calculus, numerical methods, and financial analysis without implementing algorithms directly.Last updated -183JavaScript
- AsecurityAlicenseAqualityProvides tools for AI assistants to interact with the Ethereum blockchain through standard JSON-RPC methods, enabling queries for account balances, gas prices, and smart contract code.Last updated -68JavaScriptMIT License
- AsecurityAlicenseAqualityA command-line interface and API that allows users to analyze and visualize AWS cloud spending data by enabling Claude to query AWS Cost Explorer through natural language conversations.Last updated -4121PythonMIT License
- AsecurityAlicenseAqualityAn MCP to give AI agents extensive knowledge of your personal finances and control of your budgeting.Last updated -142PythonMIT License