Files
pruefwerk/docs/features/mcp-server.md
T
sharangandSharang Parnerkar 6557f03d7c
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 3s
CI / Deploy Agent (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Dashboard (push) Successful in 3m0s
CI / Deploy Docs (push) Successful in 1m6s
feat(dashboard): add demo targets, fix MCP status, source-only UI (#252)
Demonstration plan, phase D3 (dashboard side). Pairs with #251, which adds the agent endpoints and the `source_only` feature flag.

**Add demo targets.** The Targets page (empty state) and the onboarding wizard now offer a button that lists what the agent would create, seeds it, and reports per target `created` / `already there` / `failed` with the error inline. That replaces "onboard something by hand before you can see anything" for a trial user; the curl script stays for ops.

**MCP status.** The card never turned *running* on staging: the health URL was built by appending `/health` to an endpoint that already ends in `/mcp`, and the ingress routes `/mcp/*` to a server that serves `/health` at its own root. The probe now tries `…/mcp/health` and then `…/health`, and `MCP_HEALTH_URL` overrides it outright for the seeded cards (staging: `https://pruefwerk-stage.breakpilot.com/mcp/health`). Unit-tested through `mcp_health_url_candidates`.

**Source-only mode.** The dashboard reads the agent's `features` list from the public version handshake (cached, and an older agent without the key degrades to "everything enabled"). With `source_only` it hides dynamic application testing, pentest, the ICS probe and the PLC runtime behind one short note rather than offering actions that fail at the tool, and a stage the pipeline reports as skipped for that reason renders neutral instead of red.

**Control column.** The findings table shows the control-mapping column only when at least one finding in view carries `control_refs`, so an environment without a control catalog does not show a column of em dashes.

Docs: getting-started gains the demo-target entry point and a section on static-analysis-only environments; the MCP feature page documents the status probe and `MCP_HEALTH_URL`, which is also in `.env.example`.

Verified locally: `cargo fmt --all --check`, `cargo clippy -p compliance-dashboard --features server --no-default-features`, both dashboard test suites (`server` and `web` features) green.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Co-authored-by: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com>
Reviewed-on: #252
2026-09-14 08:24:43 +00:00

4.5 KiB

MCP Integration

Prüfwerk exposes your security data through the Model Context Protocol (MCP), allowing LLM-powered tools to query your findings, SBOM data, and DAST results directly.

What is MCP?

The Model Context Protocol is an open standard that lets AI tools (like Claude, Cursor, or custom agents) connect to external data sources. Think of it as a way for your LLM to "see" your security data without you having to copy and paste it.

When an MCP client is connected to Prüfwerk, you can ask questions like "Show me all critical findings" or "What vulnerable packages does this repo have?" and the LLM will query Prüfwerk directly to get the answer.

Why It Matters

Without MCP, getting security data into an LLM conversation requires manual effort -- exporting reports, copying findings, pasting context. With MCP:

  • Your AI coding assistant can check for security issues as you write code
  • You can ask natural language questions about your security posture
  • Security data stays up to date because it is queried live, not exported statically
  • Multiple team members can connect their own LLM tools to the same data

Managing MCP Servers

Navigate to MCP Servers in the sidebar to manage your MCP server instances.

MCP servers management page

From this page you can:

  • Register new MCP server instances with their endpoint URL, transport type, and port
  • View server configuration, enabled tools, and status
  • 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.

Server status

The card shows running once the dashboard has reached the server's health endpoint. It probes <endpoint>/health and, for an endpoint that ends in /mcp, also the path with the prefix stripped — which is what a prefix-routing ingress needs. Where neither applies, set MCP_HEALTH_URL to the absolute URL to probe for the default server (staging: https://pruefwerk-stage.breakpilot.com/mcp/health). A server whose health endpoint cannot be reached is shown as stopped; the tools still work if the endpoint itself is reachable from your client.

Available Tools

The MCP server exposes seven tools that LLM clients can discover and call:

Findings Tools

Tool Description
list_findings Query findings with optional filters for repository, severity, status, and scan type. Returns up to 200 results.
get_finding Retrieve a single finding by its ID.
findings_summary Get finding counts grouped by severity and status, optionally filtered by repository.

SBOM Tools

Tool Description
list_sbom_packages List SBOM packages with filters for repository, vulnerabilities, package manager, and license.
sbom_vuln_report Generate a vulnerability report for a repository showing all packages with known CVEs.

DAST Tools

Tool Description
list_dast_findings Query DAST findings with filters for target, scan run, severity, exploitability, and vulnerability type.
dast_scan_summary Get a summary of recent DAST scan runs and finding counts.

Connecting an MCP Client

To connect an MCP-compatible tool (like Claude Desktop or Cursor) to your Prüfwerk MCP server:

  1. Go to MCP Servers in Prüfwerk 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

Once connected, the LLM client automatically discovers the available tools and can call them in response to your questions.

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

Example Queries

Once your MCP client is connected, you can ask questions like:

  • "Show me all critical findings across my repositories"
  • "What vulnerable packages does the backend service have?"
  • "Give me a summary of DAST findings for the staging target"
  • "How many open findings do we have by severity?"

The LLM translates your natural language question into the appropriate tool call and presents the results in a readable format.