docs(mcp): how to get an MCP token and connect a client #968
No files matched your search
+76
-12
@@ -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.
|
||||
|
||||
@@ -39,6 +39,11 @@ Person vorbehalten.
|
||||
|
||||
## Gut zu wissen
|
||||
|
||||
- **Nicht für MCP.** Ein LLM-Werkzeug (Claude Code, Cursor, …) meldet sich an
|
||||
der MCP-Schnittstelle mit einem eigenen MCP-Token (`mcpt_…`) an, nicht mit
|
||||
einem API-Schlüssel. MCP-Tokens legt eine angemeldete Person im Dashboard
|
||||
unter `/mcp-tokens` an; siehe [MCP-Schnittstelle](/features/mcp-server#connecting-an-mcp-client).
|
||||
|
||||
- **Widerruf wirkt nach höchstens 60 Sekunden.** Prüfwerk merkt sich das
|
||||
Prüfergebnis eines Schlüssels eine Minute lang.
|
||||
- **Nachvollziehbarkeit:** Änderungen mit einem Schlüssel stehen im Verlauf
|
||||
|
||||
Reference in new issue
Block a user