Implementation:2akouwu Reverify run mcp server
| Knowledge Sources | |
|---|---|
| Domains | MCP, JSON_RPC, Tool_Integration |
| Last Updated | 2026-10-24 12:00 GMT |
Overview
Concrete tool for running the MCP stdio server that exposes Reverify's 10-tool RE toolkit to AI agents via JSON-RPC 2.0, provided by the Reverify library.
Description
The run_mcp_server function implements the MCP stdio server loop. It reads JSON-RPC 2.0 requests from stdin (one per line) and writes responses to stdout. It handles initialize (returns protocol version, capabilities, server info, and LEDGER_INSTRUCTIONS), ping, tools/list (returns the 10-tool manifest), tools/call (dispatches to handle_tool_call), resources/list (lists ledgers as resources), and resources/read (reads a ledger via reverify://ledger/<sha24> URI). Notifications receive no response.
Usage
Use this function when you need to:
- Start the MCP server for an AI agent client (Claude Code, Cursor, Cline, OpenCode).
- Run
reverify-mcpconsole script. - Integrate Reverify into an MCP-compatible tool ecosystem.
Code Reference
Source Location
- Repository: Reverify
- File: reverify/mcp_server.py
- Lines:
run_mcp_serverat L426-444;TOOLS_MANIFESTat L46-203;LEDGER_INSTRUCTIONSimported from reverify/ledger.py:L70-76
Signature
def run_mcp_server() -> None:
"""Read JSON-RPC 2.0 requests from stdin, write responses to stdout."""
TOOLS_MANIFEST: List[Dict[str, Any]] = [
# 10 tool definitions with name, description, inputSchema
# re_auto_triage, re_parse_pe, re_parse, re_backends,
# re_pattern_scan, re_disasm, re_verify_claim, re_semantic,
# re_checkpoint, re_ledger
]
Import
from reverify.mcp_server import run_mcp_server
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (stdin) | str | Yes | JSON-RPC 2.0 requests, one per line |
Outputs
| Name | Type | Description |
|---|---|---|
| (stdout) | str | JSON-RPC 2.0 responses, one per line |
Usage Examples
Start the Server
from reverify.mcp_server import run_mcp_server
run_mcp_server() # blocks; reads stdin, writes stdout
CLI Usage
# Console script entry point
reverify-mcp
# Or via module
python -m reverify.mcp_server
Client Configuration (Claude Code)
{
"mcpServers": {
"reverify": {
"command": "reverify-mcp"
}
}
}