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.
✨ 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
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 mcp_debugger-0.1.0.tar.gz.
File metadata
- Download URL: mcp_debugger-0.1.0.tar.gz
- Upload date:
- Size: 152.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e67f152986997851255e0ae98202e89c18440a1b14662c018042228bf0262b3b
|
|
| MD5 |
6c0b32b10cd789a3c1c371dedd31ffcf
|
|
| BLAKE2b-256 |
eeac442e69fe45a5ae7f001ca115a9eb20e49c26c38f0ed273750d6aa221ec15
|
File details
Details for the file mcp_debugger-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_debugger-0.1.0-py3-none-any.whl
- Upload date:
- Size: 68.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a40e18feed88942a6c15227824a350772a4e0926c5bd063a6829ac2342216be4
|
|
| MD5 |
96445b5e7a1ca69a733ab864bf598c5d
|
|
| BLAKE2b-256 |
e3e0ddfabacde15f9de90d2b1908c16995f001f7dcc5e1712c8e239302b3657a
|