Skip to main content
Point a coding agent at your account by registering the Sapot Chat MCP server. This page covers the connection contract, the claude mcp add command, the .mcp.json shape, how to verify, and how to remove or rotate a key.

The connection contract

The MCP server is a stateless Streamable-HTTP proxy (built on FastMCP) that lives at <mcp-url>/mcp. It runs no inference and holds no credentials — on every request it simply relays your scoped agent key to the Sapot Chat REST API, which authenticates and authorizes the call. Every request must carry two headers:
The account id is fixed by the connection — it is pinned on the header, never passed as a tool argument. The API independently rejects any request whose account id does not match the key’s account, so a key can only ever touch the one account it was minted for.
Authorization: Bearer … is preferred. A few MCP clients treat the Authorization header specially — those may instead send the key as X-Api-Access-Token: <agent key>, which the server accepts as a fallback.

Connect with Claude Code

Register the server in one command:
Replace https://mcp.sapot.ai/mcp with your environment’s MCP URL, YOUR_AGENT_KEY with the key from Settings → API & Agents, and YOUR_ACCOUNT_ID with your numeric account id.

Configure via .mcp.json

Instead of the CLI, you can declare the server in config. The shape is identical everywhere; only the file location and who it applies to differ.
Add a .mcp.json at your repo root. This is shared with everyone who works in the project.
A project .mcp.json is often committed to source control. Do not check a live agent key into a shared repo — use a per-developer key, an environment variable, or the user-level config below.

Verify the connection

1

Check the server is registered

The sapot server should appear as connected.
2

List the tools

Ask your agent to list its available tools. You will only see the tools your key’s scopes unlock — a key with just conversations:read, for example, exposes the six conversation read tools. If a whole domain is missing, that scope was not granted. See the scope model in Authentication & Scopes.
3

Run a read

“List my open conversations.”
A result confirms the key, headers, and account binding all line up.

Other MCP clients

Any MCP-compatible client connects the same way: HTTP transport to <mcp-url>/mcp, with the two headers on every request (Authorization: Bearer <agent key> and X-Sapot-Account-Id: <account id>). There is nothing Claude-Code-specific about the server — use your client’s own HTTP-server configuration with those values.

Remove or rotate a key

There is no in-place rotation. To rotate, revoke the old key and mint a new one, then re-point the connection.
  • Remove the connection: claude mcp remove sapot (or delete the entry from .mcp.json / user config).
  • Rotate the key: in the dashboard, go to Settings → API & Agents, revoke the current key, and create a fresh one. Then re-run claude mcp add … (or update .mcp.json) with the new key. Revoking a key immediately stops every connection using it.

When something fails

A denied tool, a missing the required scope message, or a 429 quota response are expected, enforced behaviors — not connection bugs. Connection-time and per-call errors are catalogued in Errors & Quotas.