docs(mcp): how to get an MCP token and connect a client #968

Merged
sharang merged 1 commits from docs/mcp-token-setup into main 2026-11-10 13:48:59 +00:00
Owner

What

docs/features/mcp-server.md explains how to get an MCP token and connect a client. docs/guide/api-keys.md notes that API keys are not for MCP.

Why

The docs were wrong in two places:

  • They told readers to use the MCP server entry's access token. compliance-mcp/src/auth.rs accepts only mcpt_ tokens from the mcp_tokens collection, which the MCP-Tokens page creates.
  • The example URL was …/mcp. The prod endpoint is /mcp/mcp; /mcp/health answers without a token.

Facts the text rests on (checked in code)

  • Tokens are created on /mcp-tokens (pages/mcp_tokens.rs, "Create Token" then "Create"). A token is shown once and only its hash is stored. Creating and revoking need a write role (role_gate/router_tests.rs).
  • POST /api/v1/mcp-tokens is not in KEY_SCOPES, so a portal API key cannot create a token. The endpoint refuses anything that doesn't start with mcpt_ ("Invalid token format").
  • In source-only deployments (prod) the overview's MCP-Server card is hidden (overview.rs, !source_only), and there is no sidebar entry. The page itself is not gated, so the docs give its direct URL. Adding a visible link is a separate change.

Docs only; no code changes.

🤖 Generated with Claude Code

## What `docs/features/mcp-server.md` explains how to get an MCP token and connect a client. `docs/guide/api-keys.md` notes that API keys are not for MCP. ## Why The docs were wrong in two places: - They told readers to use the MCP server entry's access token. `compliance-mcp/src/auth.rs` accepts only `mcpt_` tokens from the `mcp_tokens` collection, which the MCP-Tokens page creates. - The example URL was `…/mcp`. The prod endpoint is `/mcp/mcp`; `/mcp/health` answers without a token. ## Facts the text rests on (checked in code) - Tokens are created on `/mcp-tokens` (`pages/mcp_tokens.rs`, "Create Token" then "Create"). A token is shown once and only its hash is stored. Creating and revoking need a write role (`role_gate/router_tests.rs`). - `POST /api/v1/mcp-tokens` is not in `KEY_SCOPES`, so a portal API key cannot create a token. The endpoint refuses anything that doesn't start with `mcpt_` ("Invalid token format"). - In source-only deployments (prod) the overview's MCP-Server card is hidden (`overview.rs`, `!source_only`), and there is no sidebar entry. The page itself is not gated, so the docs give its direct URL. Adding a visible link is a separate change. Docs only; no code changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-11-10 13:23:09 +00:00
docs(mcp): how to get an MCP token and connect a client
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m9s
CI / Check (pull_request) Successful in 17m44s
7c45a94c64
The MCP endpoint accepts only MCP tokens (mcpt_…) from the MCP-Tokens page,
which a signed-in person creates; the docs said to use the MCP server
entry's access token, which the endpoint refuses, and gave a wrong URL.
Portal API keys neither work at the endpoint nor can create MCP tokens.

- Step by step: create the token at /mcp-tokens (also reachable in
  source-only deployments, where the overview card is hidden), add the
  server with the real endpoint (/mcp/mcp) to Claude Code or a JSON-configured
  client, check /mcp/health, and read the three 401 answers.
- API-Schlüssel: a note that keys are not for MCP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang merged commit 589c3b440b into main 2026-11-10 13:48:59 +00:00
Sign in to join this conversation.