Skip to main content

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

Project description

proxy-doctor logo

proxy-doctor

PyPI License Platform Python

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:

Layer What How
1. System Proxy Web/HTTPS/SOCKS proxy across all network services networksetup
2. Residual Values Disabled proxies with stale localhost addresses Parse disabled-but-set entries
3. Port Health Whether referenced proxy ports are actually listening socket.connect()
4. Editor Config settings.json, argv.json, recent error logs File read + pattern match
5. GUI Environment http_proxy/https_proxy in GUI app context launchctl getenv

Quick Start

CLI

# 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:

# 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):

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

Your AI agent can then call:

  • diagnose_proxy(editor="cursor") — full 5-layer diagnosis
  • list_fixes(editor="cursor") — just the recommended fixes
  • supported_editors() — list available editors

Menu Bar (SwiftBar)

# 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)

{
  "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.1.0
Editor: cursor | Platform: Darwin

Status: HEALTHY

No proxy contamination detected.

Supported Editors

Editor Config Detection Log Scanning Status
Cursor yes yes supported
VS Code yes yes supported
Windsurf yes yes supported
Claude Desktop planned future
Zed planned planned future

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

Development

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxy_doctor-0.1.1.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

proxy_doctor-0.1.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file proxy_doctor-0.1.1.tar.gz.

File metadata

  • Download URL: proxy_doctor-0.1.1.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for proxy_doctor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 315ce5874042c3ad722e3ac16d5a94ef45ed44b8114c26a3be9bcff21ae2f1d1
MD5 c1886d51148a5bdad5af62a9b6f6c708
BLAKE2b-256 9b9c532dd0cf5dc99b393ec5a55f0ac8af7ef495278dd48cf04ecd553310c7ed

See more details on using hashes here.

File details

Details for the file proxy_doctor-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: proxy_doctor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for proxy_doctor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a37327b06c03d0324c0ac5e711abc7244afa48f5e17b42144b9490fd43ce2d2
MD5 468635ff73fa443217918eaed925c122
BLAKE2b-256 92c73639910d18e5f7a92b9012ce5e0b0dc3b8ed93776f256a6c96abef129d21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page