MCP proxy that records and cryptographically signs AI agent tool calls
Project description
Receipts MCP Proxy
receipts_mcp/ is a stdio MCP server that sits between an MCP client and one or more upstream MCP servers.
For each tool call:
- The client calls the Receipts proxy.
- The proxy forwards the call to the real upstream MCP server.
- The real output is captured.
- The proxy POSTs that result to
POST /tools/recordon the Receipts backend. - The real result is returned to the client even if receipting fails.
Upstream tools are namespaced as <server>__<tool> so collisions do not clobber each other.
If no upstream config file exists, the proxy falls back to the built-in demo tools:
write_filehttp_fetchdb_query
Those demo tools are forwarded to the backend's /tools/call endpoint.
Setup
pip install receipts-mcp
cp upstreams.json.example upstreams.json
Configuration
receipts_mcp/config.py reads environment variables and an upstreams JSON file.
Environment variables:
| Variable | Default | Purpose |
|---|---|---|
RECEIPTS_URL |
http://localhost:8000 |
Receipts backend URL |
RECEIPTS_API_KEY |
empty | Proxy-role API key used for /tools/record |
UPSTREAMS_PATH |
receipts_mcp/upstreams.json |
Path to upstream config |
TOOL_TIMEOUT_SECONDS |
60 |
Max time for an upstream tool call |
RECORD_TIMEOUT_SECONDS |
5 |
Max time for backend receipting |
The upstreams file supports:
stdiossestreamable_http
${ENV_VAR} references inside env and headers are expanded from the process environment.
Example:
{
"include_demo_tools": false,
"upstreams": {
"github": {
"transport": "stdio",
"command": "/path/to/github-mcp",
"args": [],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}
Claude Code / Cursor config
Add this to ~/.claude/claude_mcp_config.json or the equivalent Cursor MCP config:
{
"mcpServers": {
"receipts": {
"command": "/home/shreyansh/receipts/.venv/bin/python3",
"args": ["-m", "receipts_mcp.server"],
"cwd": "/home/shreyansh/receipts",
"env": {
"RECEIPTS_URL": "http://localhost:8000",
"RECEIPTS_API_KEY": "<proxy-key>",
"UPSTREAMS_PATH": "receipts_mcp/upstreams.json",
"PYTHONPATH": "/home/shreyansh/receipts"
}
}
}
}
Restart the MCP client after changing the config.
Runtime behavior
- One proxy process gets one
mcp-<hex>session ID. - All tool calls from that process share that session so they can be reconciled together.
- If the backend is unreachable, the tool result still returns and the receipt is skipped.
- If the backend rejects the API key, the proxy logs it as a configuration error.
Run
python3 -m receipts_mcp
or
python3 -m receipts_mcp.server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file receipts_mcp-0.1.1.tar.gz.
File metadata
- Download URL: receipts_mcp-0.1.1.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08d2af7f4b231b7924061906eb3136fd6569c13844992b2f45c8a0d39f139200
|
|
| MD5 |
bc45ed93996e6a117e66b06dde9edeff
|
|
| BLAKE2b-256 |
fd794e217138f0401f6e93523853139c066bae609e6bb1a937d8543a7a51f99e
|
File details
Details for the file receipts_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: receipts_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
293e19c1f42cd275e503353877c858e108fa7810c8537c086ac7098d735314d3
|
|
| MD5 |
9073a69f53cd01ef7c02fbcda81adc6f
|
|
| BLAKE2b-256 |
f75ae1d8fd74b0236e1f408b232dd35754110d0fe86b5fdaeee0dcbc6654bf4e
|