> ## 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.

# Any MCP client

> Streamable HTTP by hand, an SDK client, or mcp-remote for clients that only speak stdio.

## The endpoint

`POST https://api.routeur.app/mcp`, JSON-RPC over Streamable HTTP.

| Header                 | Value                                                           |
| ---------------------- | --------------------------------------------------------------- |
| `Authorization`        | `Bearer <your API key>` (or `X-API-Key: <key>`)                 |
| `Content-Type`         | `application/json`                                              |
| `Accept`               | `application/json, text/event-stream`                           |
| `MCP-Protocol-Version` | The version you negotiated, on every request after `initialize` |

The server is **stateless**: it sets no `Mcp-Session-Id`, nothing needs to be kept alive, and `GET` and `DELETE` are not used. Responses are plain JSON, so any HTTP client can drive it.

```bash List the tools theme={null}
curl -s https://api.routeur.app/mcp \
  -H "Authorization: Bearer $ROUTEUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

```bash Call a tool theme={null}
curl -s https://api.routeur.app/mcp \
  -H "Authorization: Bearer $ROUTEUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{
        "name":"find_opportunities",
        "arguments":{"category":"Sports","limit":5}}}'
```

A tool result carries the JSON as text content and, for the composed tools, the same object as `structuredContent`. A failed call comes back as a tool result with `isError` and a readable message — including `rate_limited` and `daily_quota_exceeded`, so the model can wait rather than crash.

## SDK clients

Any MCP SDK works; point its streamable-HTTP transport at the endpoint and add the header.

```typescript TypeScript theme={null}
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';

const transport = new StreamableHTTPClientTransport(new URL('https://api.routeur.app/mcp'), {
  requestInit: { headers: { Authorization: `Bearer ${process.env.ROUTEUR_API_KEY}` } },
});
const client = new Client({ name: 'my-agent', version: '1.0.0' });
await client.connect(transport);

const { tools } = await client.listTools();
const snapshot = await client.callTool({ name: 'market_snapshot', arguments: { venue: 'kalshi', id: process.env.MARKET_ID } });
```

```go Go theme={null}
package main

import (
    "context"
    "net/http"
    "os"

    "github.com/modelcontextprotocol/go-sdk/mcp"
)

type keyed struct{ key string }

func (k keyed) RoundTrip(r *http.Request) (*http.Response, error) {
    clone := r.Clone(r.Context())
    clone.Header.Set("Authorization", "Bearer "+k.key)
    return http.DefaultTransport.RoundTrip(clone)
}

func main() {
    client := mcp.NewClient(&mcp.Implementation{Name: "my-agent", Version: "1.0.0"}, nil)
    transport := &mcp.StreamableClientTransport{
        Endpoint:   "https://api.routeur.app/mcp",
        HTTPClient: &http.Client{Transport: keyed{os.Getenv("ROUTEUR_API_KEY")}},
    }
    session, err := client.Connect(context.Background(), transport, nil)
    if err != nil {
        panic(err)
    }
    defer session.Close()
    // session.ListTools, session.CallTool, session.ReadResource, session.GetPrompt.
}
```

## stdio-only clients

Clients that can only launch a local process reach the server through `mcp-remote`:

```json theme={null}
{
  "mcpServers": {
    "routeur": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "https://api.routeur.app/mcp",
        "--header", "Authorization: Bearer ${ROUTEUR_API_KEY}"
      ],
      "env": { "ROUTEUR_API_KEY": "rk_live_..." }
    }
  }
}
```

<Note>
  `mcp-remote` runs on your machine and holds the key in its process; the traffic still goes to `api.routeur.app` over TLS. Prefer a native remote connection where your client supports one.
</Note>

## Discovery

`https://api.routeur.app/.well-known/mcp.json` and `https://routeur.app/.well-known/mcp.json` describe the server — endpoint, transport, protocol versions, how to authenticate and what the tools are — without a key. `https://routeur.app/llms.txt` and `/llms-full.txt` do the same in plain text for agents that read a site before using it.
