⚡ New — Kimi K3 is live: bring your own Moonshot key →
Documentation

Wire Claude Code (or any agent) to the gateway

← Cookbook

Expose BharatRouter to MCP clients so an agent can route through one governed endpoint.

MCP serverAgentsIntermediate10 min

BharatRouter ships a Model Context Protocol (MCP) server, so any MCP client — Claude Code, Cursor, your own agent — can discover and call the gateway over streamable HTTP with a bearer key. One endpoint, with your routing, residency and budgets applied to every agent call.

You'll use: the gateway's MCP server. Full reference: MCP for agents and Agents.

Discover the server

curl -s https://api.bharatrouter.com/.well-known/mcp/server-card.json

Add it to Claude Code

claude mcp add --transport http bharatrouter \
  https://api.bharatrouter.com/mcp \
  --header "Authorization: Bearer br-..."

Or declare it in a project .mcp.json:

{
  "mcpServers": {
    "bharatrouter": {
      "type": "http",
      "url": "https://api.bharatrouter.com/mcp",
      "headers": { "Authorization": "Bearer br-..." }
    }
  }
}

How it works

The MCP server authenticates with the same br-… key as the REST API, so the agent inherits your org's routing rules, per-key budgets and residency policy. Pin data_policy: "india_only" on the key's defaults to keep an autonomous agent from ever leaking data offshore.

Want the raw tool-calling loop instead of MCP? See the Agents page for a tools/tool_calls example.

More recipes in the Cookbook, or see the fullAPI reference.