mitmproxy-MCP
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 12 GitHub stars
Code Pass
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Addon-first MCP server that turns mitmproxy into a live interface for AI agents
mitmproxy MCP
mitmproxy-mcp is an MCP server embedded inside mitmproxy.
The goal is simple:
make
mitmproxyavailable to agents the waymitmwebmakes it available to humans
Architecture and rationale live in docs/design.md.
mitmproxy is installed as a project dependency, but this MCP still must run insidemitmproxy, mitmweb, or mitmdump with the addon enabled. It is not a standalone
MCP process on its own.
What It Offers
This MCP gives an agent a live interface over a running mitmproxy instance.
Core capabilities:
- inspect captured HTTP flows
- filter, count, and fetch detailed flow data
- mark and comment flows
- intercept, resume, kill, replay, duplicate, revert, delete, and clear flows
- import and export HAR / mitmproxy dump files
- inspect and update mitmproxy runtime options
Important product constraint:
mitmproxyis the source of truth- this project is addon-first
- it is not a standalone
stdioMCP server
Tool Overview (20 Tools)
Read / inspect
list_captured_flows: browse redacted flow summaries with filtering and paginationget_captured_flow: inspect one flow in detailget_flow_count: count flows matching the main filtersdiff_flows: compare two redacted captured flows field by fieldlist_marked_flows: show flows that currently have a mitmproxy markerget_intercepted_flows: show flows that are currently intercepted
Mark / annotate
mark_flow: add a colored mitmproxy marker to a flowunmark_flow: remove the current markercomment_flow: attach or replace a mitmproxy comment
Intercept / control
set_intercept: enable or disable interception with a mitmproxy filter expressionresume_flow: resume one intercepted flowresume_all: resume all intercepted flowskill_flow: kill one live/intercepted flow
Options
list_options: discover mitmproxy runtime optionsget_option: inspect one option with its current value and metadataset_option: update one allowed mitmproxy runtime option
Transfer / mutate
import_flows: load HAR files or mitmproxy dump files into the real mitmproxy viewexport_flows: save flows to HAR or mitmproxy dump filesduplicate_flow: create a second real flow without sending trafficreplay_flow: replay the current real flow through mitmproxyrevert_flow: revert a modified flow to its backup statedelete_flow: remove one flow from mitmproxyclear_captured_flows: remove all flows from mitmproxy
Quick Start
Requirements:
- Python
>= 3.12 uv
Install:
uv sync
Optional virtualenv activation:
source .venv/bin/activate
To use this MCP, run it through mitmproxy, mitmweb, or mitmdump.
This repository does not provide a standalone MCP process outside the mitmproxy runtime.
Run with mitmweb:
.venv/bin/mitmweb -s addon.py --set mcp_transport=streamable-http --set mcp_port=8000
You can also use:
mitmproxyfor the interactive terminal UImitmdumpfor headless mode
Example:
.venv/bin/mitmproxy -s addon.py --set mcp_transport=streamable-http --set mcp_port=8000
Headless:
.venv/bin/mitmdump -s addon.py --set mcp_transport=streamable-http --set mcp_port=8000
mitmdump doesn't keep flows in memory by itself, so under mitmdump the addon keeps the
newest MITMPROXY_MCP_MAX_FLOWS flows (default 1000) and drops older ones. Memory stays
flat even if mitmdump runs for a long time. To keep the full history, also pass-w traffic.mitm and load the part you need with import_flows.
Default endpoints:
- proxy:
127.0.0.1:8080 - mitmweb:
http://127.0.0.1:8081 - MCP streamable HTTP:
http://127.0.0.1:8000/mcp - MCP SSE:
http://127.0.0.1:8000/sse
Connect A Client
Supported transports:
streamable-http(recommended)sse
Not supported:
- standalone
stdio
OpenCode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mitmproxy-mcp": {
"type": "remote",
"url": "http://127.0.0.1:8000/mcp",
"enabled": true
}
}
}
For SSE, replace the URL with http://127.0.0.1:8000/sse.
Claude Code
claude mcp add --transport http mitmproxy-mcp http://127.0.0.1:8000/mcp
For SSE:
claude mcp add --transport sse mitmproxy-mcp http://127.0.0.1:8000/sse
Codex
codex mcp add mitmproxy-mcp --url http://127.0.0.1:8000/mcp
Verify:
codex mcp list
VS Code (Copilot)
Create .vscode/mcp.json in your workspace:
{
"servers": {
"mitmproxyMcp": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp"
}
}
}
Then in VS Code:
- run
MCP: List Serversfrom the Command Palette to confirm the server is detected - open Copilot Chat / Agent mode and use the
mitmproxyMcptools
For SSE, change:
"type": "sse",
"url": "http://127.0.0.1:8000/sse"
Cursor
Create .cursor/mcp.json in the project, or ~/.cursor/mcp.json for a global setup:
{
"mcpServers": {
"mitmproxy-mcp": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}
Then verify from Cursor's CLI:
cursor-agent mcp list
For SSE, use:
{
"mcpServers": {
"mitmproxy-mcp": {
"transport": "sse",
"url": "http://127.0.0.1:8000/sse"
}
}
}
Configuration
Environment variables are supported through .env.
Main settings:
MITMPROXY_MCP_PROXY_HOSTMITMPROXY_MCP_PROXY_PORTMITMPROXY_MCP_MCP_HOSTMITMPROXY_MCP_MCP_PORTMITMPROXY_MCP_MCP_TRANSPORTMITMPROXY_MCP_MAX_FLOWSMITMPROXY_MCP_BODY_PREVIEW_LIMIT
Redaction settings:
MITMPROXY_MCP_REDACTION_ENABLEDMITMPROXY_MCP_REDACT_HEADERSMITMPROXY_MCP_REDACT_QUERY_PARAMSMITMPROXY_MCP_REDACT_BODY_PREVIEWS
See .env.example for actual values.
Privacy
The MCP read model is redacted by default.
Current redaction includes:
- sensitive headers
- sensitive query parameters
- secret-like fields in body previews
Option Safety
set_option intentionally currently blocks these higher-risk options:
modelisten_hostlisten_portssl_insecuressl_verify_upstream_trusted_cassl_verify_upstream_trusted_confdirclient_certscertscert_passphraseconfdirallow_hostsignore_hostsscripts(it would load and run arbitrary Python files)
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found