proxypin-mcp

proxypin-mcp

Enables AI to analyze real-time HTTP(S) traffic captured by ProxyPin, with tools to browse, search, and inspect requests and responses, as well as access saved history sessions.

Category
访问服务器

README

proxypin-mcp

MCP server for ProxyPin — let AI analyze your HTTP(S) traffic in real-time.

English | 中文


How it works

┌─────────────────────────────────────────────────────────────┐
│                        ProxyPin App                         │
│                                                             │
│  MITM Proxy ──▶ EventListener ──▶ WsTrafficServer :12080   │
│                                         │   ▲              │
│                                    push │   │ commands     │
│                                         │   │ (history)    │
└─────────────────────────────────────────┼───┼──────────────┘
                                          │   │
                                     WS   │   │  WS
                                          ▼   │
┌─────────────────────────────────────────────────────────────┐
│                       proxypin-mcp                          │
│                                                             │
│  Ring Buffer (real-time)    ◀── request / response msgs     │
│  sendCommand() / pendingCmds ──▶ cmd_reply (history)        │
│                                                             │
│  MCP Tools ──▶ Claude Code / AI                             │
└─────────────────────────────────────────────────────────────┘

Real-time traffic: ProxyPin pushes every request and response through WebSocket. The MCP server buffers them in a ring buffer (default 1000 entries) and exposes them via list_requests / get_request / search_requests.

History: The MCP sends commands (list_histories, get_history, search_history, get_history_detail) over the same WebSocket. ProxyPin reads the HAR files on its end and returns only the fields needed — summaries for list/search, full HAR only for get_history_detail. This keeps AI context size bounded regardless of how many times history tools are called.

Config sync: ProxyPin sends a config message to the MCP on connect and whenever settings change (e.g. history access toggled), keeping the two sides in sync without polling.

Quick Start

1. Enable WebSocket Push in ProxyPin

Settings → WebSocket Push → Enable (default port: 12080)

2. Configure MCP

Add to your .mcp.json:

{
  "mcpServers": {
    "proxypin": {
      "command": "npx",
      "args": ["@k186/proxypin-mcp@latest", "--port", "12080"]
    }
  }
}

3. Use with AI

AI can now call these tools to analyze your traffic:

Real-time tools

  • list_requests — Browse recent captured requests
  • get_request — Get full request/response details (headers, body, timing)
  • search_requests — Filter by URL keyword, HTTP method, or status code
  • get_stats — Overview: connection status, status code distribution, top domains
  • clear_buffer — Clear the buffer before a new capture session

History tools (requires History Access enabled in ProxyPin settings)

  • list_histories — List all saved history sessions
  • get_history_requests — Browse requests in a session (summary only)
  • search_history — Search across all sessions by URL/method/status
  • get_history_detail — Get full HAR entry for a specific request

Options

Flag Env Variable Default Description
--port, -p PROXYPIN_PORT 12080 ProxyPin WebSocket push port
--buffer-size PROXYPIN_BUFFER_SIZE 1000 Max requests to keep in memory
PROXYPIN_WS_URL ws://127.0.0.1:{port} Full WebSocket URL (overrides port)

Examples

// Custom port
{ "args": ["@k186/proxypin-mcp@latest", "--port", "9999"] }

// Larger buffer
{ "args": ["@k186/proxypin-mcp@latest", "--port", "12080", "--buffer-size", "5000"] }

// Via environment variables
{
  "args": ["@k186/proxypin-mcp@latest"],
  "env": { "PROXYPIN_PORT": "12080", "PROXYPIN_BUFFER_SIZE": "2000" }
}

工作原理

┌─────────────────────────────────────────────────────────────┐
│                      ProxyPin 应用                          │
│                                                             │
│  MITM 代理 ──▶ EventListener ──▶ WsTrafficServer :12080    │
│                                        │   ▲               │
│                                   推送 │   │ 命令          │
│                                        │   │(历史记录)    │
└────────────────────────────────────────┼───┼───────────────┘
                                         │   │
                                    WS   │   │  WS
                                         ▼   │
┌─────────────────────────────────────────────────────────────┐
│                       proxypin-mcp                          │
│                                                             │
│  环形缓冲区(实时)     ◀── request / response 消息         │
│  sendCommand() / pendingCmds ──▶ cmd_reply(历史)          │
│                                                             │
│  MCP 工具 ──▶ Claude Code / AI                              │
└─────────────────────────────────────────────────────────────┘

实时流量:ProxyPin 将每条请求和响应通过 WebSocket 推送过来,MCP 缓存到环形缓冲区(默认 1000 条),通过 list_requests / get_request / search_requests 暴露给 AI。

历史记录:MCP 通过同一个 WebSocket 发送命令(list_histories / get_history / search_history / get_history_detail),ProxyPin 在自己这边读取 HAR 文件,只返回所需字段——列表/搜索只返回摘要,完整 HAR 仅在 get_history_detail 时返回。无论调用多少次历史工具,AI 上下文大小都在可控范围内。

配置同步:ProxyPin 在客户端连接时以及设置变更时(如切换历史访问开关)向 MCP 推送 config 消息,两端状态保持同步,无需轮询。

快速开始

1. 在 ProxyPin 中开启 WebSocket 推送

设置 → WebSocket推送 → 启用(默认端口:12080)

2. 配置 MCP

.mcp.json 中添加:

{
  "mcpServers": {
    "proxypin": {
      "command": "npx",
      "args": ["@k186/proxypin-mcp@latest", "--port", "12080"]
    }
  }
}

3. 让 AI 分析流量

AI 可以调用以下工具分析你的抓包数据:

实时工具

  • list_requests — 浏览最近捕获的请求列表
  • get_request — 查看完整的请求/响应详情(请求头、响应体、耗时)
  • search_requests — 按 URL 关键字、HTTP 方法或状态码过滤
  • get_stats — 总览:连接状态、状态码分布、Top 域名
  • clear_buffer — 清空缓冲区,开始新的抓包会话

历史工具(需在 ProxyPin 设置中开启"历史访问")

  • list_histories — 列出所有历史会话
  • get_history_requests — 浏览某个会话的请求(仅摘要)
  • search_history — 跨所有会话按 URL/方法/状态码搜索
  • get_history_detail — 获取某条请求的完整 HAR 数据

配置参数

参数 环境变量 默认值 说明
--port, -p PROXYPIN_PORT 12080 ProxyPin WebSocket 推送端口
--buffer-size PROXYPIN_BUFFER_SIZE 1000 内存中最大缓存请求数
PROXYPIN_WS_URL ws://127.0.0.1:{port} 完整 WebSocket 地址(覆盖 port)

配置示例

// 自定义端口
{ "args": ["@k186/proxypin-mcp@latest", "--port", "9999"] }

// 增大缓冲区
{ "args": ["@k186/proxypin-mcp@latest", "--port", "12080", "--buffer-size", "5000"] }

// 通过环境变量配置
{
  "args": ["@k186/proxypin-mcp@latest"],
  "env": { "PROXYPIN_PORT": "12080", "PROXYPIN_BUFFER_SIZE": "2000" }
}

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选