mitmmcp
v1.0.5
Published
MITM proxy that captures HTTP/HTTPS traffic during development and exposes it via MCP for querying by Claude Code
Maintainers
Readme
MITM MCP - Network Traffic Capture & Query System
A 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.
What is it?
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.
Key Features
- 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
Installation
Prerequisites: Node.js 18+
No installation needed! Just use npx:
npx mitmmcpThe proxy starts on port 8080 and stores data in ~/.local/share/mitmmcp/ (or platform equivalent).
Quick Start
1. Start the Proxy
npx mitmmcp
# Optional: custom port or capture filter
npx mitmmcp --port 9090 --capture="*.test,localhost:*"2. Configure Claude Code MCP Server
claude mcp add --transport stdio mitmmcp -- npx -y -p mitmmcp mitmmcp-serverThen restart Claude Code.
{
"mcpServers": {
"mitmmcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "-p", "mitmmcp", "mitmmcp-server"]
}
}
}3. Configure Your Browser or Application
For browsers (launches separate Chrome instance with proxy):
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--user-data-dir="$HOME/.chrome-proxy-profile" \
--proxy-server="http://localhost:8080"For applications:
export HTTP_PROXY=http://localhost:8080
export HTTPS_PROXY=http://localhost:80804. Query with Claude Code
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
mitmmcp --help
Options:
-p, --port <port> Proxy server port (default: 8080)
-c, --capture <patterns> Domain patterns to capture (e.g., "*.test,localhost:*")
-d, --db-path <path> Custom SQLite database file path
-h, --help Show this help messageDocumentation
- 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.
Local Development Setup
git clone https://github.com/cloudshipco/mitmmcp.git
cd mitmmcp
npm install
npm run build
npm run proxyDevelopment Commands
npm run dev # Run in development mode
npm run build # Build
npm test # Run testsLicense
MIT
Contributing
Contributions welcome! Please open an issue or PR.
