Skip to main content
RootSign works at the Model Context Protocol layer, so any agent that uses MCP tools can be recorded without a framework adapter. The proxy sits between the agent’s MCP client and the MCP server, records each tools/call, and forwards it unchanged; the agent only connects to a different URL. The audit server goes the other way: it exposes RootSign’s own records as read-only MCP tools, so an auditing agent can list sessions and verify chains.

Install

The proxy speaks MCP’s streamable HTTP transport and is tested against servers built with FastMCP from the official MCP Python SDK, with JSON and SSE replies, with and without session IDs.

See it work

This script runs all three parts on your machine in one process: an ordinary MCP server, the RootSign proxy in front of it, and an MCP client that calls two tools through the proxy. Nothing is mocked; they talk real HTTP to each other on ports 8001 and 8000.
demo.py

Verify the session

Put the proxy in front of your server

In production the proxy is its own process. Save this as proxy.py, point it at your server with MCP_UPSTREAM_URL, and change your agent’s MCP server URL to http://127.0.0.1:8000/mcp:
proxy.py
The proxy opens one session at start-up, and every tools/call from every client lands on that session’s chain until you stop it with Ctrl+C. When it stops, it prints the session ID to verify:
create_proxy_app() also accepts redaction_config= to redact arguments and results before they are hashed, and require_approval=True to hold each call until a person approves it. See Redact PII and Require human approval.

What the proxy records and forwards

For a tools/call, tool_name is the MCP tool name and the input is the call’s arguments, exactly as the client sent them:
The output is the server’s whole JSON-RPC response under result, so the record shows exactly what the agent received:
If the server answers a tools/call with an HTTP error, the call is still recorded, with an empty output, and the client receives the server’s error response. If the server redirects, the proxy follows the redirect itself, so a client can never be sent around the proxy to the server’s real address.

Let an agent query the audit log

The audit server exposes RootSign’s records as four read-only MCP tools:
The audit server reads the PostgreSQL store, so it needs pip install 'rootsign[mcp,postgres]' and a database set up with rootsign-admin. It cannot read JSONL session files.
Save this as audit_server.py:
audit_server.py
Run it with uvicorn and connect any MCP client to http://127.0.0.1:8002/mcp:

How interception works

The proxy is an ASGI app built with FastAPI. It reads each JSON-RPC request, and for tools/call it records the call through the same code path as @rootsign.trace, with redaction applied before hashing, then forwards it. The session is found the same way as for framework tools: from rootsign.session() when the proxy runs inside one, or from ctx= and client= passed to create_proxy_app(). The design is in ADR-010.

Limitations

Start the proxy inside a session. create_proxy_app() itself does not need one, but each tools/call does. Without an active rootsign.session() or explicit ctx= and client=, the call fails with RootSignNotInitializedError.
  • Streamable HTTP only. The proxy is an HTTP service, so it cannot sit in front of an MCP server that a client launches over stdio.
  • Messages a server sends before a tool’s result are dropped. If a server streams progress notifications ahead of a tools/call result, the proxy returns only the result.
  • One session per proxy process. All clients share it, so their calls interleave on one chain.

Full example

Both scripts are in examples/mcp-proxy in the repository, and CI runs demo.py.

LangGraph and LangChain

Instrument the tools in a LangGraph agent.

CrewAI

Instrument the tools of a CrewAI agent.

Any Python function

Record calls to functions that are not framework tools.