> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorcost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Connect an AI assistant to your TensorCost spend over a remote MCP server, with a key in a header.

TensorCost runs a remote MCP server over HTTP. An assistant that supports remote MCP servers with custom headers can list your spend, budgets, recommendations, routing decisions and alerts, and answer questions about them.

```text theme={null}
https://api.tensorcost.com/v1/mcp
```

The server speaks JSON-RPC 2.0 over HTTP `POST` (`initialize`, `tools/list`, `tools/call`, `ping`). It authenticates with a key in the `X-MCP-Key` header.

## Create a key

**1. Open Connect › API keys**

Choose **New MCP key** and give it a name.

**2. Copy the key and the config**

The key starts with `tc_mcp_` and is shown once. After you create it, the console also shows this client configuration:

```json theme={null}
{
  "mcpServers": {
    "tensorcost": {
      "url": "https://api.tensorcost.com/v1/mcp",
      "headers": { "X-MCP-Key": "tc_mcp_..." }
    }
  }
}
```

**3. Add it to your assistant**

Use whatever your client calls a remote or HTTP MCP server, with the URL and the header above.

The key's transport setting (`http` or `stdio`) is only a label. Every key works over HTTP at the URL above; there is no stdio package.

> [!NOTE]
>
> The server authenticates with the key header only. It does not offer OAuth sign-in, so a client that can connect to a remote server only through an OAuth flow cannot use it. Clients that run local stdio servers need a bridge that can pass a header to a remote server.

## What a key can do

An MCP key inherits the roles of the person who created it, so it can reach tools that a REST API key cannot. Each key also carries scopes, which default to read-only, and a rate limit of 60 requests a minute. Tools that change things need a `write` scope.

## Tools

Which tools you see depends on what your workspace has deployed.

| Area | Tools | Scope |
| - | - | - |
| Cost | `get_cost_summary`, `get_cost_series`, `get_cost_forecast`, `query_cost_pivot` | read |
| Spend | `get_spend_by_model`, `get_cost_by_feature`, `get_spend_by_user` | read |
| Budgets and savings | `list_budgets`, `get_budget_status`, `get_savings_ledger`, `get_savings_ledger_summary`, `get_savings_replay` | read |
| Recommendations | `list_recommendations` | read |
| | `dismiss_recommendation` | write, and the admin role |
| Routing | `list_routing_decisions`, `get_routing_decision`, `list_routing_policies`, `get_policy_readiness`, `list_sdk_traces`, `list_ai_workloads` | read |
| Anomalies | `list_anomalies`, `list_hardware_anomalies` | read |
| | `accept_inference` | write |
| Alerts | `list_alerts` | read |
| | `acknowledge_alert` | write |
| GPUs | `list_gpu_instances`, `list_idle_gpus`, `get_instance_metrics`, `list_gpu_agents`, `get_fleet_health` | read |
| Accounts and setup | `list_cloud_accounts`, `get_cloud_sync_status`, `get_onboarding_status` | read |
| SDK keys | `list_sdk_keys` | read |
| | `revoke_sdk_key`, `mint_sdk_key` (needs `confirm: true`) | write |
| Other | `provision_agent` (needs `confirm: true`), `policy.draft` | write |

Ask the assistant for what you would ask the console: "What did we spend by model last week?", "Which budgets are over 80 percent?", "Show the last routing decisions that fell back."


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.