
snapspecter/mitmproxy-mcp 是从 https://github.com/snapspecter/mitmproxy-mcp. 导入的 MCP 候选服务器
概览
snapspecter/mitmproxy-mcp 是从 https://github.com/snapspecter/mitmproxy-mcp. 导入的 MCP 候选服务器
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,将中间代理转变为人工智能代理的强大工具集。这使得大型语言模型(如Claude、GPT-4或本地模型)能够实时检查、修改和重放HTTP/HTTPS流量。
这个版本的新成员(有趣的部分)
该项目已超越简单的捕获+重放。你现在可以:
- **通过域/方法/正文文本筛选快速搜索流量。
- **使用 JSONPath 或 CSS 选择器从响应中提取数据。
- 使用会话变量从一个响应中抓取标记,并在后续回放中重复使用。
- **对查询参数或JSON正体字段运行轻量模糊检测,以便快速进行DAST检查。
- 重建API模式并从捕获的流量导出类似OpenAPI的规范。
- 检测认证模式(承载/JWT/API密钥/会话cookie/CSRF/OAuth提示)。
- 从真实捕获的流生成起始抓取器代码。
为什么要用这个?
标准的“网页搜索”或“取”工具是无状态且易于检测的。mitmproxy-mcp 提供:
- 深度调试:代理可以检查完整的请求/响应周期(头部、有效载荷、Cookie),以识别前端失败的原因或API返回
4xx/500错误的原因。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
mitmproxy MCP Server
A Model Context Protocol (MCP) server that transforms mitmproxy into a powerful toolset for AI agents. This allows LLMs (like Claude, GPT-4, or local models) to inspect, modify, and replay HTTP/HTTPS traffic in real-time.
New in this build (the fun stuff)
This project has grown beyond simple capture + replay. You can now:
- Search traffic quickly with filters by domain/method/body text.
- Extract data from responses using JSONPath or CSS selectors.
- Use session variables to grab tokens from one response and reuse them in later replays.
- Run lightweight fuzzing against query params or JSON body fields for quick DAST checks.
- Reconstruct API patterns and export an OpenAPI-style spec from captured traffic.
- Detect auth patterns (Bearer/JWT/API key/session cookie/CSRF/OAuth hints).
- Generate starter scraper code from real captured flows.
Why use this?
Standard “web search” or “fetch” tools are stateless and easily detected. mitmproxy-mcp provides:
- Deep Debugging: The agent can inspect full request/response cycles (headers, payloads, cookies) to identify why a frontend is failing or why an API is returning a
4xx/500error. - API Reverse Engineering: Let the LLM observe undocumented internal APIs, map out JSON schemas, and generate client libraries or documentation automatically.
- Automated Security Testing: Perform DAST (Dynamic Application Security Testing) by allowing the agent to inject payloads into specific parameters and analyze the response.
- Live Interception: Modify traffic on the fly: inject headers, mock responses for testing, or block tracking pixels to reduce noise.
- Stealth Replay: Uses
curl-cffito mimic Chrome/Safari TLS fingerprints, bypassing basic anti-bot measures that standard Python libraries trigger.
Key Features
- Lifecycle Control: Start and stop the mitmproxy instance directly from the LLM.
- Deep Inspection: Capture full request/response cycles, including headers, bodies, and timing.
- Traffic Search & Filtering: Scope by domain, then search flows by query/method so context stays clean.
- Active Interception: Dynamic rules to inject headers, replace body content via regex, or block requests.
- Stealth Replay: Re-execute flows using
curl-cffito impersonate modern browser TLS fingerprints (e.g., Chrome). - Session-Aware Workflows: Extract dynamic values (like CSRF tokens) and re-inject them into replayed traffic.
- Response Data Extraction: Pull structured values from HTML/JSON responses via CSS selectors and JSONPath.
- API Discovery: Group similar endpoints, identify path/query params, and export OpenAPI JSON.
- Security Recon Helpers: Detect common auth patterns and run targeted fuzz payloads.
- Scraper Bootstrapping: Generate executable
curl-cffiautomation code from observed traffic.
Quickstart
Option 1: Using uvx (Recommended)
安装
uvx mitmproxy-mcp配置
{
"mcpServers": {
"mitmproxy-mcp": {
"command": "uvx",
"args": ["mitmproxy-mcp"]
}
}
}