MCP OAuth: 'Server not found' when re-adding remote MCP server after deploy

Resolved 💬 3 comments Opened Apr 9, 2026 by fernandezpablo85 Closed Apr 12, 2026

Summary

After redeploying a remote MCP server (ECS Fargate), existing Claude.ai MCP sessions are invalidated (in-memory sessions lost). When attempting to re-authenticate via Claude.ai settings, the OAuth flow fails with "Server not found" — the error comes from Claude.ai's own API before reaching the MCP server.

The MCP server itself is working correctly — other users can connect through Claude.ai, and the mcp-remote stdio bridge works perfectly. The issue is specific to re-adding/re-authenticating a previously registered server.

Steps to reproduce

  1. Add a remote MCP server with OAuth to Claude.ai (e.g. https://mcp.invertironline.com/)
  2. Deploy a new version of the server (ECS task restart → in-memory sessions lost)
  3. Existing connection breaks with "Session not found"
  4. Remove the MCP server from Claude.ai settings
  5. Re-add the same URL
  6. Click Authenticate → browser opens to claude.ai/api/organizations/<org>/mcp/start-auth/mcpsrv_<id>?product_surface=cli
  7. Response: {"type":"error","error":{"type":"not_found_error","message":"Server not found","details":{"error_visibility":"user_facing"}}}

Repeated 10+ times with the same result. Tried different server names, incognito window, etc.

Error details

  • Error ref: ofid_68715e5bb05af235
  • Request ID: req_011CZsGZa8BoTJqh4894ggq4
  • Server URL: https://mcp.invertironline.com/
  • Browser URL: claude.ai/settings/mcp/auth_error → "An unknown error occurred during authentication"

What works

  • The MCP server responds correctly to all OAuth endpoints (/.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server, /register, /authorize, /token)
  • Other Claude.ai users can connect to the same server through the Claude.ai proxy
  • mcp-remote (stdio bridge) handles OAuth locally and works perfectly as a workaround
  • E2E tests pass (full OAuth flow + MCP tool calls)

Workaround

Using mcp-remote as a stdio bridge bypasses Claude.ai's OAuth proxy entirely:

{
  "mcpServers": {
    "my-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["mcp-remote", "https://my-mcp-server.example.com/"]
    }
  }
}

Environment

  • Claude Code CLI v2.1.96
  • macOS Darwin 25.3.0
  • MCP server: FastMCP on ECS Fargate, OAuth 2.1 with PKCE

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗