Proxy Doctor

平台与服务

by jiansen

诊断会导致 Cursor、VS Code、Windsurf 等 AI 编码工具失效的 proxy 配置错误。

什么是 Proxy Doctor

诊断会导致 Cursor、VS Code、Windsurf 等 AI 编码工具失效的 proxy 配置错误。

README

<p align="center"> <img src="assets/logo.svg" width="120" alt="proxy-doctor logo"> </p> <h1 align="center">proxy-doctor</h1> <p align="center"> <a href="https://pypi.org/project/proxy-doctor/"><img src="https://img.shields.io/pypi/v/proxy-doctor" alt="PyPI"></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/Jiansen/proxy-doctor" alt="License"></a> <img src="https://img.shields.io/badge/platform-macOS-blue" alt="Platform"> <img src="https://img.shields.io/badge/python-%3E%3D3.9-blue" alt="Python"> <a href="https://github.com/Jiansen/proxy-doctor/stargazers"><img src="https://img.shields.io/github/stars/Jiansen/proxy-doctor?style=social" alt="GitHub Stars"></a> </p>

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
# Install
pip 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 fixes
proxy-doctor fix

# Check a different editor
proxy-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 support
pip install proxy-doctor[mcp]

# Run MCP server
python -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. Install
pip install proxy-doctor[mcp]

# 2. Find the Python path
python3 -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 output
proxy-doctor check --human  # human-readable
proxy-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 status
proxy-doctor daemon status

# Stop daemon
proxy-doctor daemon stop

# Check for updates
proxy-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 installed
cp 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

code
proxy-doctor v0.2.0
Editor: cursor | Platform: Darwin

Status: HEALTHY

No proxy contamination detected.

Supported Editors

EditorConfig DetectionLog ScanningStatus
Cursoryesyessupported
VS Codeyesyessupported
Windsurfyesyessupported
Claude Desktopplannedfuture
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.git
cd proxy-doctor

# Install in development mode
pip install -e ".[dev,mcp]"

# Run tests
make test

# Run linter
make 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

<!-- mcp-name: io.github.Jiansen/proxy-doctor -->

常见问题

Proxy Doctor 是什么?

诊断会导致 Cursor、VS Code、Windsurf 等 AI 编码工具失效的 proxy 配置错误。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描123.0k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描123.0k

邮件模板

by alirezarezvani

Universal
热门

快速搭建生产可用的事务邮件系统:生成 React Email/MJML 模板,接入 Resend、Postmark、SendGrid 或 AWS SES,并支持本地预览、i18n、暗色模式、反垃圾优化与追踪埋点。

面向营销与服务场景,快速搭建高质量邮件模板,省去反复设计与切图成本,成熟度和社区认可都很高。

平台与服务
未扫描12.5k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
84.2k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.5k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
38.1k

评论