[BUG] Re-authenticate button shows JSON parse error for non-OAuth MCP servers

Resolved 💬 2 comments Opened Apr 2, 2026 by adam-stone-zocdoc Closed Apr 2, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary

Clicking "Re-authenticate" in the /mcp dialog for a streamable-http MCP server that doesn't implement OAuth surfaces a confusing JSON parse error instead of a helpful message.

Error shown

Error: SDK auth failed: HTTP 404: Invalid OAuth error response:
SyntaxError: JSON Parse error: Unexpected identifier "Not".

What happens

The button triggers MCP OAuth discovery, probing .well-known endpoints:

GET /.well-known/oauth-protected-resource/mcp   → 404
GET /.well-known/oauth-protected-resource        → 404
GET /.well-known/oauth-authorization-server      → 404
GET /.well-known/openid-configuration            → 404
... (7+ endpoints, repeats multiple times)
POST /register                                   → 404

The server returns plain-text "Not Found". The SDK tries to JSON-parse it as an OAuth error response → SyntaxError.

Context

  • Server: Snowflake MCP (FastMCP/uvicorn) on 127.0.0.1:9100 via streamable-http
  • Auth: Snowflake PATs in ~/.snowflake/connections.toml — no OAuth
  • Server is healthy and queries work fine — error is cosmetic but confusing

What Should Happen?

If all .well-known endpoints 404, show something like "This server does not support OAuth re-authentication" instead of a raw parse error.

Error Messages/Logs

Error: SDK auth failed: HTTP 404: Invalid OAuth error response: SyntaxError: JSON Parse error: Unexpected identifier "Not".  
Raw body: Not Found 

Steps to Reproduce

  1. Start any streamable-http MCP server without OAuth endpoints
  2. /mcp → select server → "Re-authenticate"
  3. Observe JSON parse error

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.90 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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