A lightweight WebSocket-based interceptor for local Model Context Protocol (MCP) communication.
mcp-intercept lets you observe and relay local MCP traffic between a stdio-based MCP process and any MCP-compatible host, such as Claude Desktop. It runs a small local WebSocket bridge that routes messages through an HTTP proxy, enabling inspection, debugging, or modification of protocol exchanges.
mcp_intercept.py launches an MCP server process (for example, a Node or Python script that implements MCP over stdio). It then starts a local WebSocket server and connects to it through an HTTP proxy such as Burp. All MCP messages between the client and server pass through this bridge, making it possible to inspect or manipulate them.
git clone https://github.com/gabriel-sztejnworcel/mcp-intercept
cd mcp-interceptpython -m venv .venv
.venv\Scripts\activatepython -m venv .venv
source .venv/bin/activatepip install -r requirements.txtYou need to configure your MCP host to run mcp_intercept.py as an MCP server, and pass the command for your target MCP server:
path/to/mcp-intercept/.venv/bin/python mcp_intercept.py --proxy-port 8080 path/to/mcp-server mcp-server-argspath/to/mcp-server mcp-server-args→ the MCP process to run and intercept--proxy-port 8080→ optional (default8080); the local HTTP proxy thatmcp-interceptwill route through
Use any WebSocket-capable proxy like Burp Suite to inspect the traffic on the specified port.
You can make mcp-intercept behave like a normal MCP server so Claude Desktop launches it automatically.
- macOS:
~/Library/"Application Support"/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"servers": {
"mcp-intercept": {
"command": "path/to/mcp-intercept/.venv/bin/python",
"args": [
"/path/to/mcp-intercept/mcp_intercept.py",
"node",
"/path/to/your-mcp-server.js"
]
}
}
}Replace
/path/to/...with your actual paths.
Upon restart, Claude will launch mcp-intercept, which spawns your MCP server and routes communication through the interceptor (and proxy, if configured).
- Spawns your target process (e.g.,
node mcp-server.js) withstdin/stdoutpiped. - Launches a local WebSocket server bound to
127.0.0.1:<random_port>. - Starts a WebSocket client that connects to that server via an HTTP proxy (default
127.0.0.1:8080). - Logs go to
stderr, keeping protocol bytes clean onstdout.
MIT License © 2025 Gabriel Sztejnworcel

