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

# Agents & MCP

> Give an agent every Routeur endpoint as a tool, over the Model Context Protocol.

Routeur runs a remote **MCP server** at `https://api.routeur.app/mcp`. Any client that speaks the Model Context Protocol — Claude, Cursor, ChatGPT, the OpenAI Agents SDK, your own agent — can read every market on Kalshi and Polymarket, the relations proven between their contracts, the mispricings those relations expose, and strategies measured against settled history, without writing a line of HTTP.

<CardGroup cols={2}>
  <Card title="Claude Code & Claude Desktop" icon="message" href="/agents/claude">
    One command, or one block of JSON.
  </Card>

  <Card title="Cursor" icon="code" href="/agents/cursor">
    Add it to `mcp.json` and use it from Composer.
  </Card>

  <Card title="ChatGPT & the OpenAI Agents SDK" icon="sparkles" href="/agents/openai">
    Hosted MCP tools, or a few lines of Python.
  </Card>

  <Card title="Any MCP client" icon="plug" href="/agents/clients">
    Streamable HTTP directly, or `mcp-remote` for stdio-only clients.
  </Card>
</CardGroup>

## What the server is

|                   |                                                                                                   |
| ----------------- | ------------------------------------------------------------------------------------------------- |
| Endpoint          | `https://api.routeur.app/mcp`                                                                     |
| Transport         | Streamable HTTP (single `POST`, JSON responses)                                                   |
| Protocol versions | `2026-07-28`, `2025-11-25`, `2025-06-18`, `2025-03-26`                                            |
| Auth              | `Authorization: Bearer <key>` or `X-API-Key: <key>` — the same [API key](/authentication) as REST |
| Sessions          | Stateless: no session header, nothing to keep alive                                               |
| Server card       | [`https://api.routeur.app/.well-known/mcp.json`](https://api.routeur.app/.well-known/mcp.json)    |

A request without a key is refused with `401` and a `WWW-Authenticate: Bearer` challenge, exactly like the REST API.

## What it exposes

<AccordionGroup>
  <Accordion title="Tools: one per endpoint, plus five composed ones" icon="wrench">
    Every documented `GET` endpoint is a tool, generated from the same OpenAPI description this reference is built from. The tool is named after the operation (`list_opportunities`, `get_market`, `list_relations`), its arguments are that endpoint's parameters, and its result is that endpoint's JSON body, unchanged. When an endpoint is added to the API, the tool appears with it.

    On top of those, five **composed tools** answer a whole question in one call and return compact rows a model can actually read: `find_opportunities`, `compare_venues`, `explain_relation`, `market_snapshot` and `search_markets`. See the [tool reference](/agents/tools).
  </Accordion>

  <Accordion title="Resources: the background needed to read a number" icon="book">
    `routeur://concepts/glossary`, `routeur://concepts/relations` (how a relation is proven), `routeur://concepts/leads-and-fees` (what depth, executable and estimated fees mean), `routeur://concepts/prices` (asks, spread, volume, freshness), `routeur://openapi.json`, plus the live `routeur://categories`, `routeur://topics` and `routeur://topics/{slug}`.
  </Accordion>

  <Accordion title="Prompts: three workflows worth running" icon="list-check">
    `scan_for_mispricings` (sweep a category for prices that break a proven relation), `brief_me_on_event` (a sourced briefing on one event), `backtest_price_band` (what buying a price band returned in settled history). Each names the tools to use and the traps to avoid.
  </Accordion>
</AccordionGroup>

## Keys, limits and metering

Your MCP calls and your REST calls are the same traffic on the same key.

* A tool call counts as the API requests it makes. `get_market` costs one; `market_snapshot`, which reads five endpoints, costs five. Each tool's description says what it costs.
* Protocol messages — `initialize`, `tools/list`, `prompts/list` — are authenticated but not counted.
* The per-minute limit and daily quota are your [tier's](/rate-limits). Over either, the tool call comes back as a tool error naming `rate_limited` or `daily_quota_exceeded`, with the seconds to wait.
* Reading `routeur://categories`, `routeur://topics` or a topic counts as one request; the concept pages and the OpenAPI resource cost nothing.

<Tip>
  Keep the key server-side. In a desktop client it lives in that client's config file; prefer an environment variable over pasting the key into a file you might commit.
</Tip>

## Everything is read-only

Every tool is marked `readOnlyHint` and `idempotentHint`. Nothing on this server places an order, follows a market, posts anything or changes an account — Routeur is not a broker, exchange or adviser, and there is no write path today. User-scoped actions, if they arrive, will be a separate, clearly-marked surface behind OAuth, never a silent addition to these tools.

## What an agent should know before it quotes a number

<Warning>
  These are the mistakes models make with this data. The server states them in its instructions and its concept resources, but say them in your own system prompt too.

  * Prices are **asks** per contract that pays \$1, as exact decimal strings. The spread (`yes_ask + no_ask - 1`) is what crossing costs; a wide spread is a thin book, not an edge.
  * A relation is **proven**, never guessed. No relation coming back means none was proven, not that two markets are unrelated.
  * A gap between venues is only money when both books have size and fees leave something. Only leads with `depth.executable` could be filled at a profit when the books were read.
  * Strategy and calibration figures are **settled history**, before fees, and are not a forecast.
  * Kalshi is read every 15 minutes, Polymarket every 30, and the graph is rebuilt hourly; every graph-derived answer names its `graph_run`.
</Warning>

## Not using MCP?

`https://routeur.app/llms.txt` and `https://routeur.app/llms-full.txt` describe Routeur for agents in plain text, and the [REST API](/quickstart) is the same data over ordinary HTTP.
