feat(mcp): contract tools for targets, scans, SBOM, CVEs and the control mapping (#273) #353

Merged
sharang merged 1 commits from feat/mcp-contract-tools into main 2026-09-23 15:54:40 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 9cd4ba8b1a feat(mcp): contract tools for targets, scans, SBOM, CVEs and the control mapping (#273)
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 / Check (pull_request) Successful in 8m39s
breakpilot's document service pulls a target's evidence over MCP. It had
no way to find the targets, and no SBOM document or CVE list to pull.

- list_targets: id, name, type, artifact kinds and detected type (no
  credential leaves: the record is redacted first).
- get_scan_results: a target's scan runs, newest first.
- get_sbom: the whole SBOM as one CycloneDX 1.5 or SPDX 2.3 document, built
  by the same code as the agent's export (moved to compliance_core::sbom_docs).
- list_cves: the target's CVE alerts, highest CVSS first.
- get_control_mapping: the CRA Annex I mapping (OSCAL assessment results);
  oscal_assessment stays for existing clients.
- Shared cursor/JSON helpers for the tools; the server's instructions say
  to start with list_targets.

Not in this change (remaining in #273): run_scan (the MCP process cannot
start scans), token expiry, per-call audit and entitlement checks, and
hiding runtime-only tools in source-only deployments.

Tests: the summary never carries a credential; parameters; and the four
tools against a real tenant database (skips without MongoDB). Docs: the
MCP tool tables.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-09-23 17:37:48 +02:00