proxy-mcp

proxy-mcp

Runs a local HTTPS MITM proxy to intercept and mock network traffic from Android devices at the network level, enabling AI agents to register JSON transform rules and static responses without modifying app source code.

Category
访问服务器

README

proxy-mcp

MCP server for AI agents to run a local HTTPS MITM proxy and mock headend/backend responses on real Android devices — at the network level, with zero app source changes.

  • Intercepts HTTP/HTTPS traffic from physical devices and emulators
  • Registers mock responses and JSON transform rules via MCP tools
  • Probes transforms before registering (one-shot dry-run patch)
  • Persists/restores transform rules across proxy restarts
  • Tracks per-request transform outcomes — distinguish patched, no_match, error
  • Gzip-safe — transparently decompresses, patches, and recompresses
  • CLI fallback when MCP is unavailable

Charles-only CA

This proxy must use the same CA certificate that the target app's network_security_config.xml trusts. The only supported path is the Charles Proxy CA — no auto-generation, no Frida, no alternative CAs.

Requirements

  • Node >= 24
  • adb on PATH (for device proxy setup)
  • Charles Proxy CA (cert + key exported from Charles)

Setup

No clone needed. Install via npm:

npx @shahfazliz/proxy-mcp

1. Extract your Charles Proxy CA

Charles stores its CA at ~/Library/Application Support/Charles/ca/. Extract the cert and key into your project's .proxy-ca/ directory:

# From Charles's .p12 export
mkdir -p .proxy-ca
openssl pkcs12 -in ~/Library/Application\ Support/Charles/ca/charles-ssl-proxying.p12 \
  -nocerts -nodes -out .proxy-ca/key.pem
openssl pkcs12 -in ~/Library/Application\ Support/Charles/ca/charles-ssl-proxying.p12 \
  -clcerts -nokeys -out .proxy-ca/cert.pem

# Or use the built-in CLI
npx proxy-mcp-cli ca:import --p12 ~/Library/Application\ Support/Charles/ca/charles-ssl-proxying.p12

Both files must be clean PEM (no Bag Attributes, no PKCS12 wrapping).

2. Register with Cursor / any MCP client

{
  "mcpServers": {
    "shah-proxy": {
      "command": "npx",
      "args": [
        "-y",
        "git+https://github.com/shahfazliz/proxy-mcp",
        "--ca-dir",
        "/absolute/path/to/.proxy-ca"
      ],
      "enabled": true
    }
  }
}

The --ca-dir must point to a directory containing cert.pem and key.pem (see step 1). This is typically your Charles CA directory at ~/Library/Application Support/Charles/ca/ or an extracted .proxy-ca/ folder in your project.

Quick start

# 1. Start proxy (port 8889, Metro dev server passthrough)
proxy_start --passthroughHosts '["localhost:8081"]'

# 2. Point device at the proxy
adb -e shell settings put global http_proxy 10.0.2.2:8889    # emulator
adb -s <ip> shell settings put global http_proxy <lan>:8889   # physical

# 3. Probe a transform before registering (dry-run)
proxy_probe_transform --url https://api.example.com/items \
  --patches '[{ "path": "items[]", "set": { "endTime": "__NOW_PLUS_2M__" } }]'

# 4. Register the transform
proxy_update_transform --method GET --url viewMultiviews \
  --patches '[{ "path": "items[]", "where": { "isMultiview": true }, "set": { "endTime": "__NOW_PLUS_2M__" } }]'

# 5. Traffic observability — check transform outcomes per request
proxy_list_traffic --filter viewMultiviews

# 6. Clean up
adb -e shell settings put global http_proxy :0
proxy_stop

MCP tools (~15)

Tool Purpose
proxy_start / proxy_stop Start/stop the MITM proxy
proxy_health Running state, rule counts, captured traffic, warnings
proxy_mock_response Static mock response for a URL pattern
proxy_mock_transform JSON transform rule for a URL pattern
proxy_update_transform Idempotent upsert of a transform rule
proxy_list_mocks / proxy_clear_mocks Manage mock responses
proxy_list_transforms / proxy_clear_transforms Manage transform rules
proxy_list_traffic Captured requests with transform outcomes
proxy_probe_transform One-shot fetch + dry-run patch, returns before/after
proxy_save_transforms / proxy_load_transforms Persist/restore to JSON file
proxy_ca_info SHA-256 fingerprint, setup instructions

See the wiki for full parameter docs.

App dependency

Your debug APK must trust the proxy's CA. For an Android TV app:

  • Set enableSystemProxy=true in apps/tv/android/gradle.properties
  • This bakes the CA cert into the APK via res/raw/cacert
  • Verify the fingerprint from proxy_ca_info matches the app's bundled cert

No device-side CA installation, no root, no Magisk needed — trust is app-bundled.

CLI fallback

npx proxy-mcp-cli start --port 8889
npx proxy-mcp-cli status
npx proxy-mcp-cli ca-info
npx proxy-mcp-cli ca:import --p12 /path/to/charles-ssl-proxying.p12
npx proxy-mcp-cli transform add GET "https://..." patches.json
npx proxy-mcp-cli traffic --filter example

Metro passthrough

The proxy automatically forwards Metro bundler requests (:8081) to the local dev server. Headers like newrelic, traceparent, tracestate, and accept-encoding are stripped from forwarded Metro requests to avoid breaking the bundler.

Git-ignored (keep local)

  • .proxy-ca/ — CA private key + cert
  • transforms.json — auto-saved on proxy stop
  • traffic-*.json / *.har — exported traffic logs
  • *.p12, cacert.pem — raw Charles exports

License

UNLICENSED — internal tool. Not distributed publicly.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选