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 inside
mitmproxy, mitmweb, or mitmdump with the addon enabled. It is not a standalone
MCP process on its own.
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
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 filterslist_marked_flows: show flows that currently have a mitmproxy markerget_intercepted_flows: show flows that are currently intercepted
mark_flow: add a colored mitmproxy marker to a flowunmark_flow: remove the current markercomment_flow: attach or replace a mitmproxy comment
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
list_options: discover mitmproxy runtime optionsget_option: inspect one option with its current value and metadataset_option: update one allowed mitmproxy runtime option
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
Requirements:
- Python
>= 3.12 uv
Install:
uv syncOptional virtualenv activation:
source .venv/bin/activateTo 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=8000You 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=8000Headless:
.venv/bin/mitmdump -s addon.py --set mcp_transport=streamable-http --set mcp_port=8000Default 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
Supported transports:
streamable-http(recommended)sse
Not supported:
- standalone
stdio
{
"$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 mcp add --transport http mitmproxy-mcp http://127.0.0.1:8000/mcpFor SSE:
claude mcp add --transport sse mitmproxy-mcp http://127.0.0.1:8000/ssecodex mcp add mitmproxy-mcp --url http://127.0.0.1:8000/mcpVerify:
codex mcp listCreate .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"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 listFor SSE, use:
{
"mcpServers": {
"mitmproxy-mcp": {
"transport": "sse",
"url": "http://127.0.0.1:8000/sse"
}
}
}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.
The MCP read model is redacted by default.
Current redaction includes:
- sensitive headers
- sensitive query parameters
- secret-like fields in body previews
set_option intentionally currently blocks these higher-risk options:
modelisten_hostlisten_portssl_insecuressl_verify_upstream_trusted_cassl_verify_upstream_trusted_confdirclient_certscertscert_passphraseconfdirallow_hostsignore_hosts