mitmproxy-mcp

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.

Category
Visit Server

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_start and capture traffic in real time.
    • Load a previously saved .mitm dump with flows_load for offline analysis.
  • Core operations
    • View: flows_list, flow_get
    • Replay: flow_replay, request_send — backed by mitmproxy's native replay.client
    • Modify: flow_update, flow_create
  • 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

  1. Configure your browser or client to use the proxy address shown by proxy_status (default 127.0.0.1:8080).
  2. Ask the LLM to run proxy_start.
  3. Browse or make API calls.
  4. Ask the LLM to run flows_list and flow_get to inspect traffic.
  5. Use flow_replay to resend a request, or flow_update + flow_replay to 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured