NewAgent Observability is live.
Back to directory
OpenCost logo

OpenCost MCP server: three tools, already running

A server nobody has to install, what its three tools cover, and why being on by default is the fact that matters most here.

Connector
Official, built into every deployment
Coverage
Allocation costs, asset costs, cloud costs
Tools
3, enabled by default
Biggest risk for an agent
It is already listening on port 8081

Last verified 1 September 2026 · from OpenCost's own documentation and the `opencost/opencost` repository

This page is one of 90 in a directory of monitoring and developer tools. Each page checks what an AI coding agent can get out of the tool through its MCP server, the connector that lets the agent query the tool directly.

Summary

OpenCost does not ship a separate MCP server. The server is part of OpenCost itself, enabled by default in all deployments, listening on port 8081 and included in the official Helm chart.

It exposes 3 tools: get_allocation_costs for Kubernetes cost allocation, get_asset_costs for nodes, disks and load balancers, and get_cloud_costs for provider spend.

Most connectors in this guide are something you decide to add. This one is something you decide to turn off, and OpenCost documents how.

What is the OpenCost MCP server?

It is OpenCost's server for the Model Context Protocol. OpenCost is the CNCF (Cloud Native Computing Foundation) project that measures Kubernetes spend, and it is the upstream of several commercial cost products.

The three tools map onto OpenCost's three data models. Allocation is cost attributed to Kubernetes objects, assets are the underlying infrastructure, and cloud costs are what the provider billed.

Each takes a window parameter as its only required argument, written the way OpenCost writes time windows: 7d, 1h, 30m. get_allocation_costs accepts more. You can aggregate, set a step, choose whether values accumulate, and set two separate controls for idle cost.

OpenCost exposes allocation, asset and cloud-cost queries from the service built into each deployment. That gives an agent Kubernetes financial data, but no code-review, CI or agent-observability surface.

Part of the workWhat OpenCost has hereCan an agent reach it
Code, tests & reviewNoneNothing for code or review
CI & releaseNoneNo pipeline or deployment tools
Production observabilityNode, disk and load balancer inventoryPartial. get_asset_costs describes the infrastructure behind the bill; there are no metrics, logs or traces
Agent observability & evalsNoneNo traces or evaluations for your own agents
AI cost managementKubernetes allocation, asset and cloud costPartial. Kubernetes spend is the core strength. Token spend is not an OpenCost concept

For an agent, that means OpenCost answers what a namespace, workload or node cost over a window. It measures and does not recommend: there are no tools that recommend a new CPU or memory request, and none that name a saving. The agent gets numbers and reasons about them itself.

What can an AI agent do with OpenCost?

TaskToolsWorksWatch out for
Ask what a namespace costget_allocation_costsYeswindow is required; aggregate accepts namespace, pod or node
Decide how idle cost is countedget_allocation_costsYesshare_idle and include_idle are separate switches and change the totals
See what the infrastructure costsget_asset_costsYesCovers nodes, disks and load balancers; window is the only parameter
Compare spend across providersget_cloud_costsYesFilters by provider, service, category, region and account ID
Trend cost over timeget_allocation_costsYesstep sets resolution and accumulate decides whether values add up
Get a savings recommendationKubecost or CloudZeroNo, separate serverOpenCost measures. It does not recommend rightsizing. No Kubecost or CloudZero tool name is given here
See why a workload got slowerPrometheus or GrafanaNo, separate serverOpenCost reads utilization for costing, not for performance. No Prometheus or Grafana tool name is given here

The idle switches deserve a decision before the first query. share_idle distributes unused capacity across workloads and include_idle reports it separately, so the same window can produce two defensible totals.

3 tools documented, enabled by default in every deployment

Kubernetes allocation1
get_allocation_costs
Infrastructure1
get_asset_costs
Cloud provider spend1
get_cloud_costs

Counts come from OpenCost's own MCP documentation, read 24 August 2026. The server is part of the OpenCost binary rather than a package, so there is nothing standalone to capture tools/list from.

What connecting costs before the first question

A context window is the amount of text a model can hold at once. Three cost tools are built into every OpenCost deployment and enabled by default on port 8081. They cost 496 to 645 tokens on Claude, which is close to the floor for any connection at all.

Because they are on by default, this is context an OpenCost deployment spends whether the team asked for MCP or not.

Tool setToolsTokens (GPT-5.6, GPT-5.5)Tokens (GPT-4, GPT-3.5)Tokens (Claude Haiku 4.5 to Opus 5)Share of a 200,000-token window
Every tool documented371 to 9867 to 94496 to 6450.0% to 0.3%

Encodings: GPT-5.6, GPT-5.5 o200k_base; GPT-4, GPT-3.5 cl100k_base; Claude Haiku 4.5 to Opus 5 count_tokens. Counted from the 3 tool entries in the vendor's own documentation. That is the only public inventory.

The server could not be run for a live tools/list. So no input schemas are available. These figures cover each tool's name and description only. They are a floor, not the figure.

The Claude columns are measured through the API's count_tokens endpoint, with an empty schema per tool. So they cover the same content as the GPT columns. The range there is two tokenizer generations. Haiku 4.5 and Opus 4.6 sit at the low end. Opus 5 and Sonnet 5 sit at the high end. The gap between them is about a third.

OpenCost MCP server limits: where answers come back incomplete

OpenCost starts by default and reports without interpreting; those properties explain its limits.

The server is running whether or not anyone decided to run it.

OpenCost's documentation states the MCP server is enabled by default in all deployments, starts automatically, and is built into the Helm chart. It listens on port 8081 over HTTP.

It carries no authentication of its own, so anything that can route to that port inside the cluster can call all three tools.

Guard: Audit what can reach port 8081, and disable the server through the chart if you did not intend to expose it.

The agent says: That namespace cost $4,200. Idle handling can move that figure.

get_allocation_costs takes share_idle and include_idle as separate optional parameters. Sharing distributes unused capacity across workloads; including reports it separately.

Guard: Require the agent to state both settings alongside any allocation figure.

The agent says: OpenCost suggests resizing this deployment. It has no recommendation tool.

The three documented tools return allocation, asset and cloud cost data. None of them produces a rightsizing or savings recommendation.

Guard: Treat any suggestion as the model's own reasoning over OpenCost's numbers, and say so.

How to configure OpenCost MCP for agents

  1. 1

    Decide whether you want it on

    It starts automatically with OpenCost on port 8081. The documentation states users have full control to disable it or change the port.

  2. 2

    Treat port 8081 as an interface

    It speaks HTTP, so whatever can reach that port in your cluster can call these tools.

  3. 3

    Settle the idle question

    share_idle and include_idle change what a cost figure means, and neither is more correct than the other.

  4. 4

    Know what is absent

    There are no savings, rightsizing or recommendation tools. OpenCost reports; it does not advise.

Paste this into your agent’s instructions

Two switches change a cost total without changing the query, and the window syntax is OpenCost's own. Both belong in the answer.

Terminal
When you answer using OpenCost MCP tools, state:
- The window you queried, in OpenCost's own syntax.
- How idle cost was handled. share_idle and include_idle
  produce different totals for the same period.
- Which tool the figure came from. Allocation, asset and
  cloud cost are three different views of spend.
Never state that data does not exist. State that no cost
data was returned for the window above.
Write your answer in ASD-STE100 Simplified Technical
English. Use short sentences with one idea in each.

Do you need the MCP server at all?

Not for reporting. OpenCost has a well-documented HTTP API, and the three tools are thin wrappers over it. For a dashboard or a scheduled export, calling the API directly is simpler.

The connector earns its place in a conversation about a specific workload, where the agent can move from a namespace total to the assets underneath it without leaving the editor.

For savings analysis over the same data, Kubecost builds rightsizing, abandoned-workload detection and quota recommendations on top of OpenCost.

Use the API for reporting. Connect the server when an agent is investigating a specific cost, and reach for Kubecost when you want advice rather than numbers.

OpenCost MCP server setup

There is nothing to install. If OpenCost is running, the MCP server is running with it, on port 8081.

The documentation describes it as zero configuration and built into the official Helm chart for production deployments.

Claude Code

No credentials appear here, and OpenCost enforces none of its own. Whatever can reach port 8081 can call the tools.

Terminal
claude mcp add --transport http opencost \
  http://opencost.opencost.svc:8081

Cursor

In ~/.cursor/mcp.json. Still no credentials: this is an in-cluster HTTP endpoint.

Terminal
{"mcpServers":{"opencost":{
  "url":"http://opencost.opencost.svc:8081"}}}

Codex CLI

Codex reads TOML, so the JSON blocks above will not transfer. No credentials belong here either.

Terminal
[mcp_servers.opencost]
url = "http://opencost.opencost.svc:8081"

Every other client

Each block below is the configuration for one client, with the file path and the key that client expects.

Turning it off, or moving it

The documentation states users have full control to disable the server or configure a custom port. No credentials are involved either way.

Terminal
# Configure or disable the MCP server through the
# OpenCost Helm chart values, where it is bundled.
Reaching it from outside the cluster

Port-forwarding is the usual route for a local client. It carries no authentication, so treat the forwarded port accordingly.

Terminal
kubectl port-forward -n opencost svc/opencost 8081:8081

Read-only access, permissions and security

  • It is on unless you turn it off

    The server starts automatically with every OpenCost deployment, which is the opposite default from most connectors here.

  • There is no authentication in the server itself

    It listens on port 8081 over HTTP, so network policy is the boundary.

  • Every tool reads

    None of the three creates, changes or deletes anything.

  • Cost data describes your infrastructure

    Namespace and workload names travel to the model with the numbers, which is a disclosure even though no credential is involved.

Troubleshooting

The endpoint is not reachable
Check the port. The server runs on 8081 by default, which is separate from the OpenCost API port most deployments already expose.
A query is rejected
Have the agent read the tool schema before it composes a call. window is required on all three tools and uses OpenCost's syntax, such as 7d, 1h or 30m.
Two people get different totals for the same period
Compare the idle settings. share_idle distributes idle cost across workloads and include_idle reports it as its own line.
There are no savings recommendations
There are none to find. OpenCost measures cost; Kubecost builds rightsizing and savings analysis on top of the same data.

OpenCost MCP server: Reference

ItemValueScope
StatusBuilt into OpenCost core · v1.121.1 released 5 August 2026 · repository pushed 31 August 2026
Adoption6,719 stars on opencost/opencost
DistributionPart of every deployment, and built into the official Helm chart
Default stateEnabled, on port 8081
TransportHTTP
AuthNone in the server. Network policy is the boundary
Tools3, all read-onlyTaken from OpenCost's own documentation, not the wire
Required parameterwindow, in OpenCost syntax such as 7d
Savings toolsNone. OpenCost measures rather than recommends

What engineers report

OpenCost is a widely adopted CNCF project, so the adoption figures below describe the project rather than the connector.

What was checkedWhat it shows
Stars on opencost/opencost6,694
Last push21 August 2026
Documented tools3
Default stateEnabled in all deployments
Default port8081
Writing tools0

Tool inventory, the default-on behavior, the port and the Helm bundling were read from OpenCost's own MCP documentation on 24 August 2026. Repository facts come from the GitHub API on the same date. The server is part of the OpenCost binary, so no standalone tools/list capture was possible.

Should you connect an agent to OpenCost?

Yes. Best for in-cluster use with port 8081 restricted, and the idle settings agreed before anyone quotes a total.

Strongest fit
Teams already running OpenCost who want cost questions answered without adding anything.
Main advantage
Zero installation and zero configuration: it is already running in every deployment.
Main weakness
Three tools and no recommendations, so an agent gets numbers and must interpret them itself.
Operational risk
It listens by default with no authentication, so cluster network policy is the only boundary.

From Oodle

One platform for agent traces and infrastructure

Agent traces usually sit in a different product from the rest of your telemetry, so when a slow database makes an agent slow the symptom is in one tool and the cause is in another. Oodle keeps both in one query surface, from $10 per million spans.

See agent observability

Frequently asked questions

How many tools does the OpenCost MCP server have?

3: get_allocation_costs, get_asset_costs and get_cloud_costs. Read from OpenCost's own documentation on 24 August 2026.

Do I need to install it?

No. The documentation states it is enabled by default in all deployments, runs on port 8081 and is built into the official Helm chart.

Can I turn it off?

Yes. OpenCost documents full user control to disable the server or configure a custom port.

Does it need credentials?

No, and that is the risk. It listens over HTTP with no authentication of its own, so network policy decides who can call it.

Does it recommend savings?

No. It reports allocation, asset and cloud cost. Kubecost builds rightsizing and savings analysis on top of the same data.

Changelog

  • 31 August 2026. OpenCost core last pushed, carrying 6,719 stars. The server ships inside it.
  • 27 March 2019. opencost/opencost created on GitHub.

Sources

Every number on this page traces to one of these

  1. OpenCost MCP server documentation on opencost.io, read 24 August 2026
  2. Repository facts from the GitHub API · opencost/opencost, retrieved 24 August 2026
  3. Tool names and parameters from the same documentation page

OpenCost’s own MCP documentation

Also Kubernetes and cloud cost:

For what the cluster is doing: