A CI gate for MCP configs that takes mcp-audit-tool's SARIF from 12 schema errors to 0
mcpaudit-preflight finds every MCP config in a repo, scans it with mcp-audit-tool's 12 rules and uploads fixed SARIF. On our poisoned fixture it found 15 issues and exited 1.
By David Discua
Measured in the lab
- 15
- findings, poisoned fixture
- 12/12
- rules triggered
- 12
- schema errors, raw SARIF
- 0
- schema errors, normalized
- Clean fixture: 4 configs, 5 servers, 0 findings, exit 0
- Poisoned fixture: 5 configs, 8 servers, exit 1 at --fail-on high
- One MAT-001 env-reference false positive dropped per fixture
- Normalized SARIF passed the 2.1.0 schema with 0 errors
- Real upload to GitHub code scanning was not tested
From reports/preflight.json · run on October 21, 2026. mcp-audit-tool 1.0.0 at 94fec3b; SARIF checked against the schema in github/codeql-action v4.39.0 with Python jsonschema; fixtures/clean and fixtures/poisoned
How it is wired
01/03A pull request changes an MCP config, and the path filter starts the reusable workflow.
mcp-audit-tool has 12 static rules for risky MCP configs: hidden instructions in server descriptions, hardcoded secrets, unpinned npx packages that can change under you, and * trust lists. mcpaudit-preflight wraps it as a CLI, an agent skill and a reusable GitHub workflow that finds every MCP config in a repo, scans each one and uploads SARIF to code scanning. On our poisoned fixture it found 15 issues across 8 servers and failed the gate. Upstream's raw SARIF failed the SARIF 2.1.0 schema that GitHub's upload action checks against, with 12 errors per fixture.
The catch
The SARIF needed fixing before code scanning could use it. Upstream writes rule levels such as "CRITICAL", which SARIF does not allow, and points every result at line 1. The wrapper maps levels to valid SARIF levels, adds security-severity so code scanning can rank alerts, makes URIs repo-relative and points startLine at the server's key. Schema errors went from 12 to 0. We checked against the schema file inside github/codeql-action v4.39.0 with Python jsonschema, while the action itself uses a JavaScript validator. The real upload, the alert display and the path filter on GitHub are untested.
The scan is static, too. It reads committed config files and never starts a server, so tool poisoning that a server serves at runtime goes undetected. Rug-pull coverage means risk signals (MAT-003 for unpinned packages, MAT-012 for wildcard trust), and a paraphrased hidden instruction can get past MAT-010's regexes. We also drop one upstream false positive: MAT-001 reports env references like "${env:GITHUB_TOKEN}" as hardcoded secrets, and the wrapper lists those as suppressed in the JSON report.
What we ran (keyless)
uv sync --frozen
uv run mcpaudit-preflight discover --root fixtures/poisoned
uv run mcpaudit-preflight scan --root fixtures/poisoned --fail-on high --sarif out.sarif
uv run mcpaudit-preflight scan --root fixtures/clean
uv run python scripts/report.py
From reports/preflight.json, run on October 21, 2026, with mcp-audit-tool 1.0.0 at commit 94fec3b:
| Metric | fixtures/clean | fixtures/poisoned |
|---|---|---|
| MCP configs discovered | 4 | 5 |
| Servers scanned | 5 | 8 |
| CRITICAL / HIGH / MEDIUM / LOW | 0 / 0 / 0 / 0 | 3 / 8 / 4 / 0 |
| Distinct rules triggered (of 12) | 0 | 12 |
| MAT-001 env-reference false positives dropped | 1 | 1 |
Exit code, --fail-on high | 0 | 1 |
Exit code, --fail-on none | 0 | 0 |
| SARIF results | 0 | 15 |
| Schema errors, raw / normalized SARIF | 12 / 0 | 12 / 0 |
The poisoned configs sit in .mcp.json, .cursor/mcp.json, .vscode/mcp.json, claude_desktop_config.json and ops/agents.mcp.yml, and discovery found all five.
How it is wired
A small caller workflow in your repo triggers only on MCP config paths and calls the reusable mcp-preflight.yml. Discovery always scans files with known names such as .mcp.json and claude_desktop_config.json, and scans files like *mcp*.yaml or .vscode/settings.json only when they contain an MCP server map. A config that fails to parse exits 2, so the gate fails closed. The workflow uploads SARIF before it enforces --fail-on, so a blocked PR still shows its alerts.
Minilab (open source)
Upstream is graygnatconsole/mcp-audit-tool (667 stars, MIT, Python, as of October 24, 2026). It has no releases, tags or PyPI package, so the commit pin in uv.lock is the only version handle. Copy examples/consumer-workflow.yml into another repo, pin preflight-ref to a reviewed SHA, and re-run uv run python scripts/report.py to regenerate reports/preflight.json.
Run it yourself
SkilledDragonCorp/mcpaudit-preflight
Clone, install and run the report with no API keys. The numbers above are what that run writes.
uv sync --frozen && uv run mcpaudit-preflight scan --root fixtures/poisoned --fail-on high --sarif out.sarifSkilledDragon is not affiliated with GrayGnatConsole or mcp-audit-tool, GitHub, Anthropic, Anysphere, Microsoft or the Model Context Protocol project. Numbers are from our own keyless lab run on fixture configs; re-run the report before relying on them. Marks belong to their owners.
All labs