Transparent stdio interceptor for MCP JSON-RPC traffic. Like strace, but for MCP.
Project description
mcp-snoop
Transparent stdio interceptor for MCP JSON-RPC traffic.
Like strace, but for the Model Context Protocol. Wrap any MCP server and see every message in real time — tool calls, responses, errors. Zero dependencies.
$ mcp-snoop -- python3 my_server.py
mcp-snoop intercepting: python3 my_server.py
[03:14:22.847] →SERVER #1 initialize claude-desktop v1.0
[03:14:22.912] ←CLIENT #1 → server: my-server v0.1.0
[03:14:22.913] →SERVER notifications/initialized
[03:14:22.914] →SERVER #2 list tools
[03:14:22.916] ←CLIENT #2 → 8 tools
[03:14:23.201] →SERVER #3 call search_files(path="/tmp", pattern="*.py")
[03:14:23.847] ←CLIENT #3 → text: "['server.py', 'handler.py']"
mcp-snoop: 7 messages intercepted
Install
pip install mcp-snoop
Or run without installing:
uvx mcp-snoop -- python3 my_server.py
Usage
# Basic — logs all messages to stderr
mcp-snoop -- python3 my_server.py
# Verbose — print full JSON for each message
mcp-snoop --verbose -- node server.js
# Save trace to file
mcp-snoop --output trace.log -- uvx my-mcp-server
# No color (for CI/log files)
mcp-snoop --no-color -- python3 server.py
What you see
Each log line shows:
- timestamp —
HH:MM:SS.mmmUTC - direction —
→SERVER(client→server) or←CLIENT(server→client) - message ID —
#1,#2, etc. (pairs requests with responses) - summary — parsed tool name, arguments, result preview
With --verbose, the full JSON follows.
Why
You're building an MCP server. Your agent keeps calling the wrong tool. Something's returning garbage. The MCP Inspector requires a browser. You want to script against the logs.
mcp-snoop gives you the raw protocol traffic, right in your terminal.
Use in Claude Desktop / cline / any MCP client
Replace your server command with mcp-snoop -- <your command>:
{
"mcpServers": {
"my-server": {
"command": "mcp-snoop",
"args": ["--output", "/tmp/trace.log", "--", "python3", "my_server.py"]
}
}
}
All traffic between the client and your server is now logged to /tmp/trace.log.
Relationship to other tools
| Tool | What it does |
|---|---|
| agent-friend | Grades MCP schema quality (A+ to F) |
| mcp-patch | AST security scanner for MCP servers |
| mcp-pytest | pytest integration for testing MCP servers |
| mcp-snoop | Stdio interceptor — debug live protocol traffic |
License
MIT
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_snoop-0.1.0.tar.gz.
File metadata
- Download URL: mcp_snoop-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e841c74f261425262980802e58bc539e342a1dcbde05e25756ac683ca18a5849
|
|
| MD5 |
062f7e7f95874eb726e1fdc38f6d584b
|
|
| BLAKE2b-256 |
b535d538bbab5617826cffa8d6317101ae9f0d586f6cb84bcc1ce9fe5eae75c3
|
File details
Details for the file mcp_snoop-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_snoop-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccb12f19fc8cd9323272ee53a99ac9ecd082534c91a06ec96bb2bccbc7520823
|
|
| MD5 |
3f147a41f660298c5e6e879ee01b1050
|
|
| BLAKE2b-256 |
838815256dcaf96c73e96ae42b36278549babb22201702a2a5b2389521eac951
|