Claude or ChatGPT can't connect to my localhost MCP server
The error
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
- Claude Desktop: run it as a local server instead
If the server runs on your computer, add it toclaude_desktop_config.jsonas a command (stdio) server rather than as a connector (how). - 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. - Or host it on a public HTTPS URL
Deploy the server somewhere reachable and use itshttps://…/mcpaddress (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
Linear
Linear's official hosted MCP server for finding, creating and updating Linear issues, projects, comments and documents. It uses Streamable HTTP at htt
Vercel
Vercel's official hosted MCP server (OAuth) for searching Vercel docs, managing projects and deployments, reading deployment logs and querying Web Ana
Microsoft Learn Docs
Microsoft's official hosted MCP server for searching and reading Microsoft Learn documentation and code samples (Azure, .NET, Microsoft 365 and more).
Sources
- https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp
- https://developers.openai.com/api/docs/guides/custom-mcp-server
- https://developers.openai.com/plugins/deploy/connect-chatgpt
- https://learn.chatgpt.com/docs/extend/mcp?surface=cli
- Custom OAuth MCP connector: token exchange never fires in Cowork (sandbox can't reach localhost loopback redirect); identical server works in claude.ai web Chat (GitHub issue, 4 comments)