OpenCost (K8s Cost)

OpenCost (K8s Cost) MCP Connector for Claude

D

Monitor and analyze Kubernetes infrastructure costs — query workload allocations, backing assets, and cloud billing directly from your AI agent.

6 tools Official Updated Jun 28, 2026 Official Vinkius Partner

Connect your OpenCost instance to any AI agent to gain real-time visibility into your Kubernetes spending and infrastructure efficiency through natural language.

What you can do

  • Workload Allocation — Query costs and resources allocated to clusters, nodes, namespaces, controllers, and pods using get_allocation.
  • Asset Inspection — Retrieve backing cost data for physical infrastructure like Nodes, Disks, and Load Balancers via get_assets.
  • Cloud Billing Integration — Access AWS CUR, Azure Export, and GCP Billing data directly with get_cloud_cost to reconcile K8s costs with provider bills.
  • Third-Party Costs — Track external service expenses (e.g., Datadog, MongoDB Atlas) using custom cost timeseries and total summary tools.
  • Granular Filtering — Aggregate data by labels, annotations, or service levels to understand exactly where your budget is going.

How it works

  1. Subscribe to this server
  2. Enter your OpenCost API Base URL
  3. Start auditing your cloud spend from Claude, Cursor, or any MCP client

Who is this for?

  • DevOps & Platform Engineers — Identify expensive namespaces or orphaned resources without manual dashboard diving.
  • FinOps Teams — Reconcile internal Kubernetes allocations with external cloud provider billing reports instantly.
  • Engineering Managers — Get quick summaries of project-based costs to stay within budget during development cycles.
kubernetescost-optimizationcloud-billinginfrastructure-monitoringresource-allocationfinops

6 tools expose this connector's capabilities to your AI agent.

get_allocation

Query costs and resources allocated to Kubernetes workloads

get_assets

Retrieve backing cost data broken down by individual assets

get_cloud_cost

Retrieve cloud cost data directly from cloud provider billing reports

get_custom_cost_timeseries

g., Datadog, MongoDB Atlas). Get samples of third-party service costs over time steps

get_custom_cost_total

Get summary of third-party costs over a window

set_log_level

Change OpenCost log level at runtime

See how to talk to your AI agent using OpenCost (K8s Cost).

Show me the cost allocation for all namespaces over the last 7 days.

I've retrieved the allocation data for the last 7 days. The 'production' namespace accounts for 65% of the spend ($420.50), followed by 'staging' at 20% ($130.00). Would you like to see the breakdown by controller kind?

What are the backing asset costs for our nodes today?

Querying asset data... For today, your cluster nodes have incurred a cost of $45.20. This includes compute costs for 12 m5.large instances and associated EBS volumes. No load balancer costs were detected in this window.

Get the total summary for third-party service costs for the current month.

The total custom costs for this month sum up to $1,250.00. The largest contributors are Datadog ($800.00) and MongoDB Atlas ($450.00). Would you like to see the daily timeseries for these services?

Yes. Use the `get_allocation` tool and set the `aggregate` parameter to 'namespace'. You can also specify a `window` like '7d' to see trends over the last week.

Related Connectors