Skip to main content

Transparent proxy to debug, record, validate, and replay MCP (Model Context Protocol) sessions

Project description

mcp-debugger

Transparent proxy to debug, record, validate, and replay MCP (Model Context Protocol) sessions.

mcp-debugger demo

PyPI version CI Python versions License: MIT Coverage


✨ Features

Feature What it does
🔍 Record Capture every JSON-RPC message between an MCP client and server
📋 Inspect Browse messages with syntax-highlighted, formatted terminal output
Validate Check MCP protocol compliance — handshake order, method names, schemas
🔄 Replay Regression-test server changes by replaying recorded sessions
📊 Stats Visualise tool usage, latency trends, and error rates
🔀 Compare Delta reports between two sessions (latency, errors, tool calls)
📤 Export JSON, Markdown, or OpenTelemetry (OTLP) traces
⚙️ Config Persistent user preferences — aliases, timeouts, defaults
🩺 Doctor Environment diagnostics — Python version, SQLite, Node.js, paths
🚀 Local-first No cloud, no signup — all data stays on your machine

📦 Installation

pip install mcp-debugger

With optional OpenTelemetry (OTLP) export support:

pip install "mcp-debugger[otlp]"

Requirements: Python 3.11+, Node.js (for npx-based MCP servers)


🚀 Quickstart

1. Record a session

mcp-debugger proxy \
  --server "npx -y @modelcontextprotocol/server-filesystem /tmp" \
  --name "my-first-session"

Interact with your MCP client (e.g. Claude Desktop). Press Ctrl+C to stop.

2. List recorded sessions

mcp-debugger list

3. Inspect a session

mcp-debugger inspect 1

4. Validate protocol compliance

mcp-debugger validate --server "npx -y @modelcontextprotocol/server-filesystem /tmp"

5. Replay against a new server version

mcp-debugger replay 1 --server "npx -y @modelcontextprotocol/server-filesystem /tmp"

6. Export to Markdown

mcp-debugger export 1 --format markdown --output session-report.md

🔧 Use with Claude Desktop

Edit your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "my-filesystem": {
      "command": "mcp-debugger",
      "args": [
        "proxy",
        "--server",
        "npx -y @modelcontextprotocol/server-filesystem /path/to/dir",
        "--name",
        "claude-session"
      ]
    }
  }
}

Every message between Claude and your server is now recorded transparently.


📖 Documentation

Document Description
Command Reference Every CLI command with all options and examples
Architecture How it works — components, data flow, sequence diagrams
Tutorials Step-by-step workflows for common use cases
Configuration All config keys, defaults, and examples
FAQ Common questions and troubleshooting
Contributing Development setup, test structure, PR process
Changelog Version history

🧪 Development Setup

git clone https://github.com/sushant-mutnale/mcp-debugger.git
cd mcp-debugger
python -m venv .venv
source .venv/bin/activate      # Linux/macOS
# or: .venv\Scripts\activate   # Windows
pip install -e ".[dev]"

# Run all tests
pytest

# With coverage
pytest --cov=mcp_debugger --cov-report=term-missing

# Lint and type-check
ruff check .
mypy src/mcp_debugger --ignore-missing-imports

🤝 Contributing

See CONTRIBUTING.md for setup instructions, coding style, and pull request process.


📄 License

MIT © Sushant Mutnale

Project details


Download files

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

Source Distribution

mcp_debugger-0.1.1.tar.gz (449.4 kB view details)

Uploaded Source

Built Distribution

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

mcp_debugger-0.1.1-py3-none-any.whl (68.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_debugger-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_debugger-0.1.1.tar.gz
  • Upload date:
  • Size: 449.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_debugger-0.1.1.tar.gz
Algorithm Hash digest
SHA256 48aa648b54b31e31a12fc764052466c892aa2b1dc17ba69ed358ed076dfbef04
MD5 f63113818c254f2b71a99080f1435004
BLAKE2b-256 32c494e8d10578f9f851c03eba6d1471240e0ea4605515761a44c832ce3ef3e1

See more details on using hashes here.

File details

Details for the file mcp_debugger-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_debugger-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 68.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_debugger-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2e83c1b6a304ed9f748a12c1f79541e9a8e2a5c71a3ec3d5bef5e68bfe5448e
MD5 3d9578711488b5ef05c08bf3bf8b434b
BLAKE2b-256 5b1482fe4c627ae65557ab903bc70bc3839b8c083bf43fd9605ab06bf46259d7

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