mitmproxy-mcp
Enables Codeium (Windsurf) AI agents to analyze, intercept, and replay HTTP/HTTPS traffic via mitmproxy.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mitmproxy-mcpshow me the last 5 POST requests to /api/login"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mitmproxy-mcp
MCP server for mitmproxy that lets any MCP client analyze, intercept, and replay HTTP/HTTPS traffic.
What is this
mitmproxy-mcp runs as a mitmproxy addon. It embeds an MCP server directly in the proxy process, giving AI agents access to 24 tools for traffic analysis, request replay, interception control, and proxy configuration.
All captured data stays in-memory. Sensitive values (tokens, passwords, API keys, JWTs) are automatically redacted before being sent to the AI.
Related MCP server: mitm-mcp
Installation
git clone https://github.com/moha-abdi/mitmproxy-mcp.git
cd mitmproxy-mcp
python3.10 -m venv .venv
source .venv/bin/activate
uv pip install -e ".[dev]"
# one-time: make mitmproxy/mitmdump/mitmweb use this env
# (prevents missing addon deps like `mcp` when system mitmproxy is used)
mitmproxy-mcp install-shims --forceRequires Python 3.10+ and mitmproxy >= 10.0.0.
Agent Skill (optional)
This repo also ships a skill definition in SKILL.md for the npx skills ecosystem.
Install it with:
npx skills add moha-abdi/mitmproxy-mcpAfter installing, compatible coding agents can load the mitmproxy-mcp skill and get project-specific usage guidance.
Setup
1. Configure mitmproxy
Create or edit ~/.mitmproxy/config.yaml:
scripts:
- /absolute/path/to/mitmproxy-mcp/addon.py
mcp_transport: sse
mcp_port: 90112. Start mitmproxy
mitmproxy # interactive TUI
mitmweb # web interface
mitmdump # headlessThe MCP server starts automatically on http://localhost:9011/sse.
If the command still resolves to a system install, ensure your shim directory (default ~/.local/bin) is earlier in PATH, then restart the terminal.
3. Connect your AI client
All clients connect to the same SSE endpoint. Make sure mitmproxy is running before connecting.
OpenCode's local type bridges via supergateway. Requires Node.js.
Add to opencode.json in your project root, or ~/.config/opencode/opencode.json globally:
{
"mcp": {
"mitmproxy": {
"type": "local",
"command": ["npx", "-y", "supergateway", "--sse", "http://127.0.0.1:9011/sse"],
"enabled": true
}
}
}Via the CLI (project-level):
claude mcp add --transport sse mitmproxy http://localhost:9011/sseTo add globally across all projects:
claude mcp add --scope user --transport sse mitmproxy http://localhost:9011/sseOr add manually to ~/.claude.json:
{
"mcpServers": {
"mitmproxy": {
"type": "sse",
"url": "http://localhost:9011/sse"
}
}
}Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"mitmproxy": {
"url": "http://localhost:9011/sse"
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"mitmproxy": {
"url": "http://localhost:9011/sse"
}
}
}Add to .vscode/mcp.json in your project root:
{
"servers": {
"mitmproxy": {
"type": "http",
"url": "http://localhost:9011/sse"
}
}
}Claude Desktop doesn't natively support SSE, so we use supergateway to bridge SSE to STDIO. Requires Node.js.
Add to your config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"mitmproxy": {
"command": "npx",
"args": ["-y", "supergateway", "--sse", "http://127.0.0.1:9011/sse"]
}
}
}Any MCP client that supports SSE transport can connect directly to:
http://localhost:9011/sseIf your client only supports STDIO, use supergateway to bridge:
npx -y supergateway --sse http://127.0.0.1:9011/sseTools
Flow tools (12)
Tool | Description |
| List captured flows with pagination and filtering |
| Get complete flow details |
| Search flows by regex pattern |
| Get request details |
| Get response details |
| Mark a flow (same behavior as UI mark action) |
| Remove mark from a flow |
| Move UI focus to a visible flow by ID |
| Move UI focus by visible list index |
| Clear all captured flows (and UI view when sync includes |
| Count captured flows |
| Export flows to HAR format |
Replay tools (4)
Tool | Description |
| Replay a captured request as-is |
| Send a new HTTP request |
| Modify a captured request and send it |
| Clone a flow for comparison |
Replay tool flows are reflected to mitmproxy's flow list when mcp_view_sync_actions includes replay (default all). replay_request replays the original flow in-place when replay sync is enabled; otherwise it creates a detached replay flow.
Intercept tools (5)
Tool | Description |
| Set filter expression (e.g. |
| List currently intercepted flows |
| Resume a single intercepted flow |
| Resume all intercepted flows |
| Drop an intercepted flow |
Config tools (3)
Tool | Description |
| Get current mitmproxy options |
| Set a mitmproxy option (dangerous ones are blocked) |
| Get proxy status and version info |
Options
Pass via --set flag or set in ~/.mitmproxy/config.yaml:
Option | Default | Description |
|
| Transport: |
|
| Port for SSE/TCP transport |
|
| Max flows to keep in memory (oldest evicted first) |
|
| Redact sensitive data (tokens, keys, passwords) before sending to AI |
| (empty) | Additional redaction patterns as JSON array (requires |
|
| Which MCP actions sync to mitmproxy view: |
Example:
mitmdump -s addon.py --set mcp_transport=sse --set mcp_port=9011 --set mcp_max_flows=5000Privacy
By default, redaction is off -- you see the raw traffic as-is. To enable it, set mcp_redact to true in your config or via flags:
# ~/.mitmproxy/config.yaml
mcp_redact: true# or via flags
mitmdump -s addon.py --set mcp_redact=trueWhen enabled, the following are automatically redacted before reaching the AI:
Bearer tokens, Basic auth credentials
API keys (header and query parameter)
Passwords, secrets
JWTs
Session IDs, auth tokens, session cookies
Request and response bodies are truncated to 10KB to prevent context overflow.
You can also add custom redaction patterns:
mitmdump -s addon.py --set mcp_redact=true --set mcp_redact_patterns='["internal_secret", "x-custom-key"]'Project structure
mitmproxy-mcp/
addon.py thin wrapper for mitmproxy script loading
mitmproxy_mcp/ main package
__init__.py
addon.py mitmproxy addon with MCP server
models.py pydantic models for flow serialization
storage.py thread-safe in-memory flow storage
privacy.py redaction engine
transport.py stdio, sse, tcp transport layer
tools/
flows.py flow query tools
replay.py replay and modification tools
intercept.py interception control tools
config.py proxy configuration tools
tests/ test suiteDevelopment
# install in editable mode (required for imports to work)
uv pip install -e ".[dev]"
# run tests
pytest tests/ -v
# run a specific test file
pytest tests/test_flow_tools.py -v
# with coverage
pytest tests/ --cov=mitmproxy_mcp --cov-report=html
# lint
ruff check .
# type check
mypyLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/moha-abdi/mitmproxy-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server