Proxy Doctor

io.github.Jiansen由 GitHub 帳號 Jiansen 發布v0.2.1更新於 Oct 24, 2026

Diagnose proxy misconfigurations that break AI coding tools (Cursor, VS Code, Windsurf)

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

本機 MCP 伺服器,用來診斷導致 Cursor、VS Code、Windsurf 等 AI 程式編輯器無法連線的 macOS 代理設定錯誤。

可以做什麼
針對指定編輯器執行五層代理診斷,涵蓋系統代理設定、殘留值、連接埠健康、編輯器設定與 GUI 環境變數,並提供證據與根本原因。列出建議的修正項目及其指令與風險等級,並列出支援的編輯器。預設為唯讀,只顯示修正而不執行。
適用情境
當瀏覽器可正常上網,但 Cursor、VS Code 或 Windsurf 的 AI 功能失敗、逾時或卡住,且懷疑是失效或會緩衝的代理、已關閉的 VPN 應用程式或殘留的代理環境變數時使用。
執行需求
以本機 Python 程序執行;需安裝含 MCP 附加元件的套件,並在 MCP 設定中指向安裝該套件的 Python 解譯器。完整檢查需要 macOS;Linux 僅部分支援,Windows 不支援。未宣告需要帳號、API 金鑰或環境變數。
安裝前請注意
會讀取系統代理設定、編輯器設定檔、launchctl 環境變數與本機連接埠狀態,僅寫入自身快取目錄。會連線 pypi.org 檢查版本。套用修正是另一個需主動啟用的命令列步驟,會變更系統代理設定並逐項要求確認;MCP 工具只回報修正建議。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Proxy Doctor,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[proxy-doctor logo]

proxy-doctor

[PyPI] [License] [Platform] [Python] [GitHub Stars]

Diagnose proxy misconfigurations that break AI coding tools.

When your browser works fine but Cursor / VS Code / Windsurf AI features don't — proxy-doctor tells you exactly why and how to fix it.

The Problem

AI coding tools (Cursor, VS Code with Copilot, Windsurf) rely on long-lived streaming connections (SSE/HTTP2) that break when:

  • Your system proxy points to a localhost port where nothing is listening
  • A VPN/proxy app was closed but its settings linger in macOS system preferences
  • Your editor inherited stale proxy environment variables from launchctl
  • The proxy is running but buffers streaming responses, breaking AI completions

The result: "browser works, AI editor doesn't" — the most common and frustrating developer experience.

What It Checks

proxy-doctor inspects 5 layers of your macOS proxy configuration:

LayerWhatHow
1. System ProxyWeb/HTTPS/SOCKS proxy across all network servicesnetworksetup
2. Residual ValuesDisabled proxies with stale localhost addressesParse disabled-but-set entries
3. Port HealthWhether referenced proxy ports are actually listeningsocket.connect()
4. Editor Configsettings.json, argv.json, recent error logsFile read + pattern match
5. GUI Environmenthttp_proxy/https_proxy in GUI app contextlaunchctl getenv

Quick Start

CLI

bash
# Installpip install proxy-doctor
# Run diagnosis (JSON output — default, optimized for AI agents)proxy-doctor check
# Run diagnosis (human-readable output)proxy-doctor check --human
# Show recommended fixesproxy-doctor fix
# Check a different editorproxy-doctor check --editor vscode

As an MCP Tool (for AI agents)

proxy-doctor ships as an MCP server that AI agents can call directly:

bash
# Install with MCP supportpip install proxy-doctor[mcp]
# Run MCP serverpython -m proxy_doctor.mcp_server

Add to your MCP configuration (e.g., Cursor ~/.cursor/mcp.json):

json
{  "mcpServers": {    "proxy-doctor": {      "command": "python3",      "args": ["-m", "proxy_doctor.mcp_server"]    }  }}

Note: "command" must point to the Python where proxy-doctor[mcp] is installed. If python3 doesn't work, use the full path (run which python3 or python3 -c "import sys; print(sys.executable)" to find it).

Your AI agent can then call:

  • diagnose_proxy(editor="cursor") — full 5-layer diagnosis with evidence
  • list_fixes(editor="cursor") — recommended fixes with executable commands
  • supported_editors() — list available editors

For AI Agents: Quick Install

One-liner (paste this to your AI agent):

Install proxy-doctor (pip install proxy-doctor[mcp]) and add it to your MCP config with command python -m proxy_doctor.mcp_server. Then use the diagnose_proxy tool to check proxy health.

If you are an AI agent setting up proxy-doctor for your user:

bash
# 1. Installpip install proxy-doctor[mcp]
# 2. Find the Python pathpython3 -c "import sys; print(sys.executable)"
# 3. Add to ~/.cursor/mcp.json (use the path from step 2)# {#   "mcpServers": {#     "proxy-doctor": {#       "command": "<python-path-from-step-2>",#       "args": ["-m", "proxy_doctor.mcp_server"]#     }#   }# }
# 4. If MCP is not available, use CLI directly (zero dependencies):proxy-doctor check          # JSON outputproxy-doctor check --human  # human-readableproxy-doctor fix            # show fixes (read-only)proxy-doctor fix --apply    # apply fixes (asks for confirmation)

Daemon Mode (v0.2+)

Run proxy-doctor as a persistent background service with automatic health monitoring:

bash
# Start daemon (installs as macOS launchd service)proxy-doctor daemon start
# Check daemon statusproxy-doctor daemon status
# Stop daemonproxy-doctor daemon stop
# Check for updatesproxy-doctor update

The daemon runs every 5 minutes, compares results with the previous check, and sends a macOS notification when status changes (e.g. healthy → unhealthy).

Menu Bar (SwiftBar)

bash
# If SwiftBar is installedcp plugins/swiftbar/proxy-doctor.5m.sh ~/Library/Application\ Support/SwiftBar/Plugins/chmod +x ~/Library/Application\ Support/SwiftBar/Plugins/proxy-doctor.5m.sh

Shows a green/red/orange indicator in your menu bar with one-click diagnosis.

Example Output

Unhealthy (Case A: dead proxy port)

json
{  "status": "unhealthy",  "diagnosis": {    "case": "A",    "root_cause": "Editor is configured to use proxy at 127.0.0.1:10903, but no process is listening on that port.",    "confidence": "high",    "source": "system proxy (Wi-Fi (http))",    "browser_explanation": "Browser may use a different proxy path (e.g. browser-only mode) or fall back to a direct connection."  },  "fixes": [    {      "fix_id": "clear-system-http-wi-fi",      "description": "Disable http proxy on Wi-Fi",      "command": "networksetup -setwebproxystate \"Wi-Fi\" off",      "risk": "low"    }  ]}

Healthy

proxy-doctor v0.2.0Editor: cursor | Platform: Darwin
Status: HEALTHY
No proxy contamination detected.

Supported Editors

EditorConfig DetectionLog ScanningStatus
Cursoryesyessupported
VS Codeyesyessupported
Windsurfyesyessupported
Claude Desktopplanned—future
Zedplannedplannedfuture

How It Works

proxy-doctor identifies three failure patterns:

Case A — Dead proxy port (high confidence): Your system or editor points to 127.0.0.1:port but nothing is listening. This happens when a VPN/proxy app is closed but its settings remain.

Case B — Streaming broken (medium confidence): A proxy is running, but it buffers SSE/streaming connections that AI editors depend on. Common with browser-only proxy modes.

Case C — Path mismatch (medium confidence): Browser and editor use different proxy paths. Browser works via a dedicated proxy route; editor inherits a stale or incompatible one.

Platform Support

  • macOS: Full support (system proxy, launchctl, networksetup)
  • Linux: Partial (editor config + environment variables; no networksetup)
  • Windows: Not yet supported

Trust & Permissions

proxy-doctor follows a read-only by default design. No system changes are made unless you explicitly opt in.

Default Behavior (read-only)

AccessWhatWhy
ReadsSystem proxy settings, editor config files, launchctl env vars, local port statusCore diagnostic functionality
Writes~/.proxy-doctor/ only (cache, logs, update state)Daemon state persistence
Networkpypi.org (version check only)Auto-update feature
Does NOTModify proxy settings, change editor config, send telemetry, access credentialsBy design

Opt-in Fix Application

proxy-doctor fix shows the recommended commands but does not execute them.

To apply fixes, use proxy-doctor fix --apply:

  • Each fix is shown with its command and risk level
  • You are prompted individually for each fix ([y/N])
  • Default is No — nothing runs unless you type y
  • You can abort at any time with Ctrl+C

This two-step model lets AI agents safely call list_fixes() via MCP to see what needs fixing, then present the commands to users for approval.

Feedback

Found a bug? Have a suggestion? Diagnosis didn't help?

For AI agents providing feedback programmatically (zero dependencies):

bash
# Create a GitHub issue via CLI (requires gh)proxy-doctor check | gh issue create --repo Jiansen/proxy-doctor \  --title "Diagnosis report: [describe issue]" --body-file -
# Or simply: copy the JSON output into a new issue at# https://github.com/Jiansen/proxy-doctor/issues/new

Development

bash
git clone https://github.com/Jiansen/proxy-doctor.gitcd proxy-doctor
# Install in development modepip install -e ".[dev,mcp]"
# Run testsmake test
# Run lintermake lint

If proxy-doctor helped you fix a proxy issue, consider giving it a star on GitHub — it helps others discover the tool.

[Star on GitHub]

License

MIT

來源:README.md,提交 0b3d386

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分