mitmproxy-mcp

v0.6.1
mitmproxy-mcp Checked 1 day ago Published 6 months ago

MITM proxy manager with MCP integration

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

start_proxy

Start the mitmproxy instance. Args: port: Port to listen on (default 8080) dump_file: Optional file path to save raw mitmproxy .flow data. Prefix with + to append to an existing file.

ParameterTypeDescription
dump_filestring
portinteger

stop_proxy

set_scope

ParameterTypeDescription
allowed_domains *array

set_global_header

ParameterTypeDescription
key *string
value *string

remove_global_header

ParameterTypeDescription
key *string

get_traffic_summary

ParameterTypeDescription
limitinteger

inspect_flow

Get full details of a captured flow. Args: flow_id: The ID of the captured flow full_body: If True, return full request body instead of 2000-char preview

ParameterTypeDescription
flow_id *string
full_bodyboolean

inspect_flows

Batch inspect multiple flows in one call. Reduces context usage vs calling inspect_flow N times. Args: flow_ids: Comma-separated list of flow IDs to inspect fields: Comma-separated list of DB columns to select. e.g. "id,url,method,request_headers,request_body" to skip response data. Default: all columns. full_body: If True, return full request body instead of preview

ParameterTypeDescription
flow_ids *string
fieldsstring
full_bodyboolean

get_flow_schema

Infer a simple schema from a flow's JSON response body.

ParameterTypeDescription
flow_id *string

load_traffic_file

Import flows from a HAR or mitmproxy flow file into the traffic database. After import, all traffic inspection tools work on the imported data. No proxy needs to be running. Args: file_path: Path to .har or .mitm/.flow file append: If True, keep existing traffic. If False (default), clear first. scope: Comma-separated list of domains to filter by during import. Only flows matching these domains are imported.

ParameterTypeDescription
file_path *string
appendboolean
scopestring

extract_from_flow

Extract specific data from a flow's response body using JSONPath or CSS selectors. Args: flow_id: The ID of the captured flow json_path: A JSONPath expression to extract data from a JSON response css_selector: A CSS selector to extract data from an HTML/XML response

ParameterTypeDescription
flow_id *string
css_selectorstring
json_pathstring

search_traffic

Search captured traffic using filters. Args: query: Keywords to search in URL or body domain: Filter by domain name method: Filter by HTTP method (GET, POST, etc.) limit: Max results to return

ParameterTypeDescription
domainstring
limitinteger
methodstring
querystring

set_session_variable

Manually set a session variable to use in replayed flows.

ParameterTypeDescription
name *string
value *string

extract_session_variable

Extract a value from a flow's response body using a regex and store it as a session variable. Args: name: Variable name (referenced as $name in replay_flow) flow_id: The ID of the flow to extract from regex_pattern: The regex pattern with capture groups group_index: Which regex capture group to extract (default: 1)

ParameterTypeDescription
flow_id *string
name *string
regex_pattern *string
group_indexinteger

clear_traffic

Clear all captured traffic from the database.

fuzz_endpoint

Fuzz an endpoint by substituting a target parameter with a category of DAST payloads. Args: flow_id: The flow to replay as the base request. target_param: The name of the parameter to replace. param_type: The location of the parameter: 'query' or 'json_body'. payload_category: The category of payloads ('sqli', 'xss', 'path_traversal').

ParameterTypeDescription
flow_id *string
param_type *string
payload_category *string
target_param *string
timeoutnumber

replay_flow

Replay a captured flow, optionally with modified method, headers, or body. Supports session variable injection (e.g., $token) in headers and body.

ParameterTypeDescription
flow_id *string
bodystring
headers_jsonstring
methodstring
timeoutnumber

add_interception_rule

ParameterTypeDescription
action_type *string
rule_id *string
keystring
methodstring
phasestring
search_patternstring
url_patternstring
valuestring

list_rules

clear_rules

list_tools

List all available tools with their descriptions.

export_openapi_spec

Exports captured API traffic patterns to an OpenAPI v3 JSON specification. Args: domain: Filter traffic by domain limit: Max number of traffic flows to analyze. None = all flows.

ParameterTypeDescription
domainstring
limitinteger

get_api_patterns

Cluster captured traffic into endpoint patterns. Args: domain: Filter traffic by domain limit: Max number of flows to analyze. None = all flows.

ParameterTypeDescription
domainstring
limitinteger

detect_auth_pattern

ParameterTypeDescription
flow_idsstring

generate_scraper_code

Generate executable scraper/automation code from a comma-separated list of flow IDs. Args: flow_ids: Comma-separated list of flow IDs to include in the script. target_framework: The framework to generate code for.

ParameterTypeDescription
flow_ids *string
target_frameworkstring