docs(mcp): how to get an MCP token and connect a client (#968)
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Dashboard (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Agent (push) Canceled after 0s
CI / Deploy Docs (push) Successful in 1m14s

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>
This commit was merged in pull request #968.
This commit is contained in:
sharangandClaude Opus 5.5 committed 2026-11-10 13:48:58 +00:00
1 parent b9acabb6ba
commit 589c3b440b
2 files changed
+81 -12

No files matched your search

+76 -12
View File
@@ -23,11 +23,12 @@ There is no sidebar entry for MCP. The **Übersicht** (Overview) has an
**MCP-Server** card: **Verwalten** (Manage) opens the MCP server page, and
**MCP-Tokens** opens the bearer tokens an IDE or LLM client connects with.
::: info Not in source-only deployments
::: info Source-only deployments
In a deployment that scans source code only, such as the pilot, the MCP-Server
card is hidden, so these pages are not reachable from the dashboard. The
evidence the MCP tools return is also in the evidence pack on each target's
page.
card is hidden. The token page still opens directly at `/mcp-tokens`
(for example `https://pruefwerk.breakpilot.com/mcp-tokens`), and the MCP
endpoint answers as usual. The evidence the MCP tools return is also in the
evidence pack on each target's page.
:::
From the MCP server page you can:
@@ -37,7 +38,9 @@ From the MCP server page you can:
- **Manage access tokens** -- reveal, copy, or regenerate bearer tokens for authentication
- **Delete** servers that are no longer needed
Each registered server is assigned a random access token on creation. You use this token in your MCP client configuration for authenticated access.
Each registered server entry has an access token of its own. The MCP endpoint
does not accept it: a client signs in with a token from **MCP-Tokens**
(see [Connecting an MCP Client](#connecting-an-mcp-client)).
### Server status
@@ -102,15 +105,76 @@ manifest of sha256 checksums) is also served as one ZIP at
## Connecting an MCP Client
To connect an MCP-compatible tool (like Claude Desktop or Cursor) to your Prüfwerk MCP server:
An MCP client (Claude Code, Claude Desktop, Cursor, …) needs two things: the
endpoint URL and an MCP token.
1. Open **Verwalten** or **MCP-Tokens** on the overview's MCP-Server card and note the server endpoint URL and access token
2. In your MCP client, add a new server connection with:
- **URL** -- the MCP server endpoint (e.g. `https://your-pruefwerk-instance/mcp`)
- **Transport** -- Streamable HTTP
- **Authentication** -- Bearer token using the access token from Prüfwerk
### 1. Create an MCP token
Once connected, the LLM client automatically discovers the available tools and can call them in response to your questions.
1. Open **MCP-Tokens**: from the overview's MCP-Server card, or directly at
`/mcp-tokens` (prod: `https://pruefwerk.breakpilot.com/mcp-tokens`).
2. Choose **Create Token**, give it a name that says where it is used (for
example "Claude Code, laptop"), and choose **Create**.
3. Copy the token from the banner. It starts with `mcpt_` and is shown **only
once**; Prüfwerk keeps just its hash. If it is lost, create a new one.
Creating and revoking tokens needs a role that may change data; read-only roles
see the list only. A token belongs to the organisation it was created in and
gives the client that organisation's data. The list shows when each token was
last used. **Revoke** ends a token at once.
::: warning Portal API keys do not work here
The MCP endpoint accepts only MCP tokens (`mcpt_…`). An API key from the portal
(`bp_…`, see [API-Schlüssel](/guide/api-keys)) is refused, and an API key
cannot create MCP tokens either: that takes a person signed in to the
dashboard. The server entry's access token on the MCP server page is not
accepted either.
:::
### 2. Add the server to your client
- **URL**: `https://<your-pruefwerk>/mcp/mcp` (prod:
`https://pruefwerk.breakpilot.com/mcp/mcp`, staging:
`https://pruefwerk-stage.breakpilot.com/mcp/mcp`)
- **Transport**: Streamable HTTP
- **Header**: `Authorization: Bearer mcpt_…`
Claude Code:
```sh
claude mcp add --transport http pruefwerk https://pruefwerk.breakpilot.com/mcp/mcp \
--header "Authorization: Bearer mcpt_…"
```
A client configured with JSON (Cursor, Claude Desktop with remote servers):
```json
{
"mcpServers": {
"pruefwerk": {
"type": "http",
"url": "https://pruefwerk.breakpilot.com/mcp/mcp",
"headers": { "Authorization": "Bearer mcpt_…" }
}
}
}
```
Keep the token out of shared or committed config files; use your client's
secret or environment-variable support where it has one.
Once connected, the client discovers the tools above and calls them in response
to your questions.
### 3. Check the connection
`https://<your-pruefwerk>/mcp/health` answers `ok` without a token. If the
client still cannot connect, the endpoint's 401 answer says why:
| Answer | Meaning |
|---|---|
| `Missing bearer token` | The `Authorization` header is not sent. |
| `Invalid token format` | The value is not an MCP token (`mcpt_…`), for example a portal API key. |
| `Invalid or revoked token` | The token was revoked, mistyped or created in another installation (stage and prod have separate tokens). |
::: tip
The MCP server is read-only -- it only queries data. It cannot modify findings, trigger scans, or change configuration. This makes it safe to expose to LLM clients.