Kubeopt

by kubeopt

313 downloads
Not rated
GitHub

About

Kubernetes cluster cost analysis and optimization. Query costs, find savings opportunities, get rightsizing recommendations, and analyze pod spend across AKS, EKS, and GKE directly from Claude.

Details

Author
kubeopt
Downloads
313
Categories
Other, Infrastructure, Cloud Service

- Six MCP tools for querying cost and cluster data
- Connects to Azure AKS, AWS EKS, and Google GKE
- Runs 16 optimization algorithms (rightsizing, HPA, storage, etc.)
- Generates actionable implementation plans with kubectl commands
- Provides per-pod cost breakdowns filterable by namespace
- Supports on-demand fresh analyses with polling

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Kubeopt
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Run KubeOpt locally (python main.py) or deploy it, then configure your MCP client to execute the server script (python -m mcp_server.server) with the environment variables KUBEOPT_API_URL, KUBEOPT_USERNAME, and KUBEOPT_PASSWORD. After restarting the client, ask questions in plain English about Kubernetes costs.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "kubeopt": {
            "kubeopt": {
                "command": "python3",
                "args": [
                    "-m",
                    "mcp_server.server"
                ],
                "env": {
                    "KUBEOPT_API_URL": "http://localhost:5001",
                    "KUBEOPT_USERNAME": "kubeopt",
                    "KUBEOPT_PASSWORD": "your-password"
                }
            }
        }
    }
}

McpServers

{
    "kubeopt": {
        "command": "python3",
        "args": [
            "-m",
            "mcp_server.server"
        ],
        "env": {
            "KUBEOPT_API_URL": "http://localhost:5001",
            "KUBEOPT_USERNAME": "kubeopt",
            "KUBEOPT_PASSWORD": "your-password"
        }
    }
}

KubeOpt

License Python GitHub stars GitHub forks The Cost Engineer for Kubernetes KubeOpt analyzes your Kubernetes clusters, identifies cost optimization opportunities, and generates actionable implementation plans with copy-paste kubectl commands. Works with Azure AKS, AWS EKS, and Google GKE. ---

What It Does

- Connects to your cloud provider APIs and Kubernetes clusters - Runs 16 optimization algorithms (rightsizing, HPA, storage, networking, node pools, anomaly detection) - Calculates actual vs optimal costs with specific dollar savings per resource - Generates a 3-week implementation plan with kubectl commands ready to execute - Dashboard with cost breakdowns, workload analysis, and optimization scores

Claude AI Integration (MCP)

Ask Claude about your Kubernetes costs in plain English. KubeOpt ships an MCP server (mcp_server/) that exposes 6 tools over stdio transport. Once connected, Claude Desktop, Cursor, or Windsurf can query your cluster data directly — no copy-pasting dashboards. Tools exposed: | Tool | What it does | |------|-------------| | list_clusters | List all monitored clusters with cost data | | get_cost_summary | Portfolio-level cost summary across all clusters | | get_cluster_analysis | Detailed analysis for a specific cluster | | get_recommendations | Actionable recommendations sorted by savings impact | | analyze_cluster | Trigger a fresh analysis and poll until complete | | get_pod_costs | Per-pod cost breakdown, filterable by namespace |

Prerequisites

- KubeOpt running locally (python main.py) or deployed on Railway - Python virtual environment with dependencies installed (pip install -r requirements.txt)

Claude Desktop

Edit ~/.claude/claude_desktop_config.json: ``json { "mcpServers": { "kubeopt": { "command": "/path/to/kubeopt/.venv/bin/python3", "args": ["-m", "mcp_server.server"], "env": { "KUBEOPT_API_URL": "http://localhost:5001", "KUBEOPT_USERNAME": "kubeopt", "KUBEOPT_PASSWORD": "your-password" } } } } ` Restart Claude Desktop after saving.

Cursor

Open Cursor Settings → MCP and add a new server entry:
`json { "kubeopt": { "command": "/path/to/kubeopt/.venv/bin/python3", "args": ["-m", "mcp_server.server"], "env": { "KUBEOPT_API_URL": "http://localhost:5001", "KUBEOPT_USERNAME": "kubeopt", "KUBEOPT_PASSWORD": "your-password" } } } `

Windsurf / Codeium

Edit
~/.codeium/windsurf/mcp_config.json (create it if it doesn't exist): `json { "mcpServers": { "kubeopt": { "command": "/path/to/kubeopt/.venv/bin/python3", "args": ["-m", "mcp_server.server"], "env": { "KUBEOPT_API_URL": "http://localhost:5001", "KUBEOPT_USERNAME": "kubeopt", "KUBEOPT_PASSWORD": "your-password" } } } } ` Restart Windsurf after saving.

Example prompts

` What are my top 3 cost savings opportunities across all clusters? Which pods are costing the most in the production namespace? Give me a summary of total Kubernetes spend this month. What's the optimization score for my staging cluster? Trigger a fresh analysis on cluster prod-aks-eastus and report back. ` For more on the protocol: modelcontextprotocol.io ---

GitHub Action

Run a Kubernetes cost scan on every pull request or on a schedule. The action posts a summary as a PR comment (upserted on re-runs) and writes results to the GitHub Step Summary. What you get on each PR:
`

KubeOpt Cost Scan — 2026-04-27

| Cluster | Provider | Monthly Spend | Savings Available | |------------------|----------|---------------|-------------------| | prod-eks-us-east | AWS | $4,120 | $890/mo | | staging-aks-weu | Azure | $1,340 | $210/mo | Total potential savings: $1,100/mo <details> <summary>Top opportunities</summary> 1. $540/mo — prod-eks-us-east — Rightsize 6 over-provisioned node groups 2. $350/mo — prod-eks-us-east — Enable HPA on 4 deployments with static replicas 3. $210/mo — staging-aks-weu — Remove 3 idle nodes outside business hours </details>
`

Setup

1. Add secrets to your repository Go to Settings → Secrets and variables → Actions and add: | Secret | Value | |--------|-------| |
KUBEOPT_URL | URL of your KubeOpt instance (e.g. https://demo.kubeopt.com) | | KUBEOPT_USERNAME | KubeOpt username | | KUBEOPT_PASSWORD | KubeOpt password | 2. Create .github/workflows/cost-scan.yml `yaml name: K8s Cost Scan on: pull_request: types: [opened, synchronize] schedule: - cron: '0 8 1' # Every Monday at 08:00 UTC workflow_dispatch: permissions: contents: read pull-requests: write jobs: cost-scan: name: KubeOpt Cost Scan runs-on: ubuntu-latest steps: - name: Run KubeOpt cost scan id: kubeopt uses: kubeopt/kubeopt@v1 with: kubeopt-url: ${{ secrets.KUBEOPT_URL }} kubeopt-username: ${{ secrets.KUBEOPT_USERNAME }} kubeopt-password: ${{ secrets.KUBEOPT_PASSWORD }} top: 5 post-comment: ${{ github.event_name == 'pull_request' && 'true' || 'false' }} - name: Print savings to log if: always() run: echo "Total savings available: ${{ steps.kubeopt.outputs.total-savings }}/mo" `

Inputs

| Input | Required | Default | Description | |-------|----------|---------|-------------| |
kubeopt-url | yes | | URL of your KubeOpt instance | | kubeopt-username | yes | kubeopt | KubeOpt username | | kubeopt-password | yes | | KubeOpt password | | cluster-id | no | (all clusters) | Scan a specific cluster only | | top | no | 5 | Number of top savings opportunities to show | | post-comment | no | true | Post results as a PR comment |

Outputs

| Output | Description | |--------|-------------| |
total-savings | Total potential monthly savings in USD | | scan-summary | Full markdown summary (use in downstream steps) |

Scan a specific cluster

`yaml - uses: kubeopt/kubeopt@v1 with: kubeopt-url: ${{ secrets.KUBEOPT_URL }} kubeopt-username: ${{ secrets.KUBEOPT_USERNAME }} kubeopt-password: ${{ secrets.KUBEOPT_PASSWORD }} cluster-id: prod-eks-us-east-1 top: 10 `

Notes

- The action checks out
kubeopt/kubeopt@v1 at runtime to run the scan. No local install needed. - PR comments are upserted: re-running the action updates the existing comment rather than adding a new one. - Requires pull-requests: write permission to post comments. - The action does not modify your cluster. It is read-only. ---

Architecture

` KubeOpt Platform +----------------------------------------------------------+ | | | React SPA (Recharts) FastAPI REST API (v2) | | frontend/dist/ presentation/api/v2/ | | | +---------------------------+------------------------------+ | +------------------+------------------+ | | | +-------v------+ +-------v------+ +--------v-------+ | Algorithms | | Analytics | | ML Models | | (16 modules)| | Collectors | | Anomaly Det. | | rightsizing | | Processors | | CPU Optimizer | | HPA, storage| | Scorer | | Workload Cls | +--------------+ +--------------+ +----------------+ | | | +-------v------------------v------------------v-------+ | Cloud Provider Abstraction | | 6 interfaces: Auth, Executor, Metrics, Costs, | | Accounts, Inspector | +---+-----------------+-----------------+-------------+ | | | +---v---+ +----v----+ +----v----+ | Azure | | AWS | | GCP | | (AKS) | | (EKS) | | (GKE) | +-------+ +---------+ +---------+ `

Hosted Services (not in this repo)

| Service | Purpose | Endpoint | |---------|---------|----------| | Plan Generation | Generates optimization plans | plan.kubeopt.com | | AI Chat | Conversational cluster analysis | ai.kubeopt.com | | License Manager | License validation | license.kubeopt.com | These services require a PRO or ENTERPRISE license. The core analysis engine works without them.

Quick Start

Prerequisites

- Python 3.11+ - Node.js 18+ (for frontend build) - Cloud provider credentials (Azure, AWS, or GCP)

Run Locally

``bash
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.