MITM proxy that captures HTTP/HTTPS traffic during development and exposes it via MCP for querying by Claude Code
npm install mitmmcpA JavaScript-based MITM (Man-in-the-Middle) proxy that captures network requests during development and exposes them via Model Context Protocol (MCP) for querying by Claude Code.
MITM MCP intercepts HTTP/HTTPS traffic from your browser or application, stores it in SQLite, and lets you query it through Claude Code. Perfect for debugging API calls, tracking errors, and understanding network behavior during development.
- Easy setup: No installation needed with npx
- Capture focus: Filter capture to specific domains to keep database small and queries fast
- Error tracking: Find failed requests (4xx/5xx) instantly
- Query with Claude: Ask Claude to find requests, search bodies, filter by method/status
- HTTPS support: Automatic certificate handling
- Zero config: Works out of the box with sensible defaults
Prerequisites: Node.js 18+
No installation needed! Just use npx:
``bash`
npx mitmmcp
The proxy starts on port 8080 and stores data in ~/.local/share/mitmmcp/ (or platform equivalent).
`bash
npx mitmmcp
$3
`bash
claude mcp add --transport stdio mitmmcp -- npx -y -p mitmmcp mitmmcp-server
`Then restart Claude Code.
Manual configuration (edit ~/.claude.json)
`json
{
"mcpServers": {
"mitmmcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "-p", "mitmmcp", "mitmmcp-server"]
}
}
}
`
$3
For browsers (launches separate Chrome instance with proxy):
`bash
macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--user-data-dir="$HOME/.chrome-proxy-profile" \
--proxy-server="http://localhost:8080"
`For applications:
`bash
export HTTP_PROXY=http://localhost:8080
export HTTPS_PROXY=http://localhost:8080
`$3
Ask Claude to analyze captured traffic:
`
"Start capturing requests for *.myapp.test"
"Show me the most recent failed requests"
"Find all POST requests to /api/users"
"Get errors from third-party APIs triggered by my app at localhost:3000"
"Search for requests containing 'authentication' in the body"
`CLI Options
`bash
mitmmcp --helpOptions:
-p, --port Proxy server port (default: 8080)
-c, --capture Domain patterns to capture (e.g., ".test,localhost:")
-d, --db-path Custom SQLite database file path
-h, --help Show this help message
`Documentation
- Proxy Configuration - PAC files, browser extensions, etc.
- HTTPS Setup - Certificate trust and self-signed upstream servers
- Further Information - Architecture, database schema, MCP tools, etc.
Development
See docs/FURTHER_INFO.md for project structure.
$3
`bash
git clone https://github.com/cloudshipco/mitmmcp.git
cd mitmmcp
npm install
npm run build
npm run proxy
`$3
`bash
npm run dev # Run in development mode
npm run build # Build
npm test # Run tests
``MIT
Contributions welcome! Please open an issue or PR.