Skip to main content

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:

  1. The client calls the Receipts proxy.
  2. The proxy forwards the call to the real upstream MCP server.
  3. The real output is captured.
  4. The proxy POSTs that result to POST /tools/record on the Receipts backend.
  5. 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_file
  • http_fetch
  • db_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:

  • stdio
  • sse
  • streamable_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": "/path/to/receipts/.venv/bin/python3",
      "args": ["-m", "receipts_mcp.server"],
      "cwd": "/path/to/receipts",
      "env": {
        "RECEIPTS_URL": "http://localhost:8000",
        "RECEIPTS_API_KEY": "<proxy-key>",
        "UPSTREAMS_PATH": "receipts_mcp/upstreams.json",
        "PYTHONPATH": "/path/to/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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

receipts_mcp-0.2.0.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

receipts_mcp-0.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file receipts_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: receipts_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for receipts_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3f08655a55a59b772e6ab65a5544adb2e560ca4d1d4f18ad5243f859374d9f73
MD5 d4ab2fe7bfef736bc3b896f7161baeb1
BLAKE2b-256 6548eda4bb805ef20615ac5babde39050d38ee25559307ce18185c313a729b63

See more details on using hashes here.

File details

Details for the file receipts_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: receipts_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for receipts_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 243ad3e02013b32affbe93c6c5e8471e4c000aed3d212b53c7cde9431f6e61dc
MD5 ba43d8809d1951573c3f3b8eb9533028
BLAKE2b-256 eaee5ae11891f281c7182e1c01da68dcbcab7b737ccac45615350804a53e2bab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page