Install Mettle
Review MCP.
Set up the local server, connect your coding agent, and use the sample report to check that your first review works.
Read the sample reportInstallation
On macOS or Linux, you’ll need Git and Python 3.10 or later. Open a terminal in the directory where you want to keep Mettle. Read this guide on GitHub.
Clone the repository and install dependencies
git clone https://github.com/MettleSecurity-code/mettle-review-mcp.git
cd mettle-review-mcp
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
Verify the installation
.venv/bin/python -m unittest discover -s tests -v
The tests launch a client and server, read the sample reports, and check their evidence. A successful run ends with OK. Keep this terminal in the repository root for the agent setup below.
Connect an agent
Choose your client. These commands use absolute paths derived from the checkout directory and register the proposed revision with its baseline.
Claude Code
claude mcp add --scope local --transport stdio mettle-review -- \
"$PWD/.venv/bin/python" "$PWD/mcp_server.py" \
--report "$PWD/examples/reports/proposed/report.json" \
--baseline "$PWD/examples/reports/baseline/report.json"
Open Claude Code in the same checkout and run /mcp to check the connection. Ask Claude to read the proposed report using mettle-review.
Codex CLI
codex mcp add mettle-review -- \
"$PWD/.venv/bin/python" "$PWD/mcp_server.py" \
--report "$PWD/examples/reports/proposed/report.json" \
--baseline "$PWD/examples/reports/baseline/report.json"
codex mcp list
Start a new Codex CLI session and check /mcp. Ask Codex to call review_status and explain which checks ran.
Other stdio clients
For a client that accepts mcpServers, replace /path/to/mettle-review-mcp throughout this configuration with the absolute path to your checkout. Your client launches the server on your machine.
{
"mcpServers": {
"mettle-review": {
"command": "/path/to/mettle-review-mcp/.venv/bin/python",
"args": [
"/path/to/mettle-review-mcp/mcp_server.py",
"--report", "/path/to/mettle-review-mcp/examples/reports/proposed/report.json",
"--baseline", "/path/to/mettle-review-mcp/examples/reports/baseline/report.json"
]
}
}
}
Ask about a review
Explain the merge decision
Use mettle-review to explain the merge decision. Call review_status and report the policy, blockers and coverage gaps. Use list_findings and finding_evidence to cite the supporting evidence by finding ID. Call compare_audits to explain what changed from the baseline. Call out anything the evidence leaves unresolved.
The proposed revision adds MS-002 at line 11 and skips the syntax check. To review the fix, set --report to examples/reports/fixed/report.json and --baseline to examples/reports/proposed/report.json using absolute paths. Restart the connection. Both checks now pass. Review the source change before marking the findings remediated.
For your own review, point --report at a MettleSecurity schema 1.0 export and keep its evidence/ directory beside it. Include --baseline when you have an earlier report to compare.
Pair the report with a source review
Read the capture for MS-002 using mettle-review. Compare examples/source/proposed/client.py and examples/source/fixed/client.py in this checkout. Cite the changed lines and suggest a regression check for the timeout. Say which observations came from the report and which came from the source.
Use the proposed report for this prompt. The agent reads the capture through MCP and opens the sample Python files with its own workspace tools.
MCP tool reference
list_findings- Page through finding IDs, titles, severity, confidence and review status. Supply
offsetandlimitto continue. finding_evidence- Read sanitized text for a
finding_idand captureindex. The server verifies the capture’s SHA-256. Passnext_offsetback asoffsetto continue. review_status- Read the active policy, pass status, finding IDs that block the review, and coverage gaps.
compare_audits- Compare the selected reports and see findings that are new, still present, changed, or no longer observed. A comparison requires
--baseline. mettle://review/summary- Read the decision, coverage and comparison as one JSON resource in clients that expose MCP resources.
The default policy blocks open findings at high severity or above and probable confidence or above. It also requires complete check coverage. Match those settings to your review job when comparing decisions.
Troubleshooting
- Server fails to start
- Check that the configured interpreter can import
mcp. Check the absolute paths tomcp_server.pyand both reports. The startup error identifies invalid--reportor--baselineinput. - Evidence fails verification
- Keep the report with the evidence produced by that same review. Use the original capture filenames and report. A digest mismatch prevents the server from returning the capture.
- Findings are visible but comparison is unavailable
- Set
--baselineto the earlier report and restart the client session. Use reports for the same project and scope.
Use reports from a trusted producer. Review captures for sensitive data before sharing them with your agent and check how your client sends evidence to its model provider.