Fixes › Claude Desktop, ChatGPT

Claude or ChatGPT can't connect to my localhost MCP server

Claude DesktopChatGPT

The error

Custom connector or ChatGPT plugin fails to connect to http://localhost:… or a server on your private network, even though it works in your browser

Why it happens

Claude's custom connectors connect to remote MCP servers from Anthropic's cloud, not from your computer, on every Claude app (web, Desktop and mobile). ChatGPT plugins likewise connect from OpenAI. A server on localhost, behind a VPN or behind a firewall can't be reached that way.

How to fix it

  1. Claude Desktop: run it as a local server instead
    If the server runs on your computer, add it to claude_desktop_config.json as a command (stdio) server rather than as a connector (how).
  2. ChatGPT: use the desktop app or a Secure MCP Tunnel
    The ChatGPT desktop app can run local command servers (Settings → MCP servers → Add server → STDIO). It shares Codex's MCP configuration in ~/.codex/config.toml (how). For ChatGPT on the web, OpenAI's Secure MCP Tunnel connects a private server without exposing it to the public internet: when adding the server, choose Tunnel instead of a URL.
  3. Or host it on a public HTTPS URL
    Deploy the server somewhere reachable and use its https://…/mcp address (where to host). For a server on a private network that must stay there, Anthropic's docs say to allowlist Anthropic's IP ranges.

Related servers

Sources