mitmproxy-mcp
A lightweight MCP server built on mitmproxy that lets LLMs capture, inspect, replay, and modify HTTP traffic through a set of focused tools.
README
mitmproxy-mcp
A lightweight Model Context Protocol (MCP) server built on mitmproxy. It lets LLMs capture, inspect, replay and modify HTTP traffic through a small, focused set of tools.
Features
- Two capture modes
- Start a live proxy via
proxy_startand capture traffic in real time. - Load a previously saved
.mitmdump withflows_loadfor offline analysis.
- Start a live proxy via
- Core operations
- View:
flows_list,flow_get - Replay:
flow_replay,request_send— backed by mitmproxy's nativereplay.client - Modify:
flow_update,flow_create
- View:
- Built on mitmproxy's own engine for replay and save, so we don't reinvent the wheel.
- stdio transport for out-of-the-box Claude Desktop compatibility.
- Uses mitmproxy's existing web UI (
mitmweb) if you prefer a visual inspector.
Install
Requires Python 3.13+ and uv.
uv venv
uv pip install -e .
Claude Desktop configuration
Add this to your Claude Desktop config (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows/Linux paths may differ):
{
"mcpServers": {
"mitmproxy": {
"command": "uv",
"args": [
"--directory",
"/path/to/mitmproxy-mcp",
"run",
"mitmproxy-mcp"
]
}
}
}
A sample config is also in examples/mcp-config.json.
Quick start
- Configure your browser or client to use the proxy address shown by
proxy_status(default127.0.0.1:8080). - Ask the LLM to run
proxy_start. - Browse or make API calls.
- Ask the LLM to run
flows_listandflow_getto inspect traffic. - Use
flow_replayto resend a request, orflow_update+flow_replayto modify and resend.
HTTPS traffic
For HTTPS interception you must trust the mitmproxy CA certificate:
# Certificate location
~/.mitmproxy/mitmproxy-ca-cert.cer
Install it in your browser or system keychain. See mitmproxy docs for details.
Tools
| Tool | Description |
|---|---|
proxy_start |
Start the capture proxy (host, port, capture_filter, ssl_insecure, upstream_proxy) |
proxy_stop |
Stop the capture proxy |
proxy_status |
Show proxy state and number of captured flows |
flows_load |
Load flows from a .mitm file |
flows_save |
Save current flows to a .mitm file |
flows_list |
List flows with filtering/pagination |
flow_get |
Get a single flow's full details |
flows_clear |
Clear in-memory flows; optionally stop proxy |
flow_replay |
Replay a flow using mitmproxy's replay.client |
request_send |
Send a new request using mitmproxy's replay.client |
flow_update |
Modify a flow's request/response or metadata |
flow_create |
Create a new request flow without sending |
flow_delete |
Delete a flow from memory |
Playwright / browser automation
You can point Playwright at the mitmproxy-mcp proxy to capture browser traffic:
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(
proxy={"server": "http://127.0.0.1:8080"},
args=["--ignore-certificate-errors"],
)
context = browser.new_context(ignore_https_errors=True)
page = context.new_page()
page.goto("https://example.com")
Then ask the LLM to run flows_list and inspect the captured requests.
A complete integration test is in tests/test_playwright_capture.py. Run it with:
uv pip install -e ".[dev]"
playwright install chromium
python -m pytest tests/test_playwright_capture.py -m integration -v
Development
Run the server manually for testing:
uv run mitmproxy-mcp
Run unit tests (excludes network/browser integration tests):
uv run pytest tests/ -q
Run integration tests:
# Playwright browser capture test
uv run pytest tests/test_playwright_capture.py -m integration -v
# All MCP tools end-to-end test
uv run pytest tests/test_all_tools.py -m integration -v
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.