[BUG] Sanity MCP server fails to connect — malformed .well-known discovery URL (missing /)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Sep 30, 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?

The Sanity remote MCP server fails to connect with the following error:

InvalidHTTPResponse fetching https://mcp.sanity.io.well-known/oauth-protected-resource
Note the missing / between mcp.sanity.io and .well-known — the correct path should be https://mcp.sanity.io/.well-known/oauth-protected-resource. This looks like a URL-joining bug in the MCP HTTP client: when the base URL has no path component, the client appears to concatenate the base URL and .well-known/... without inserting a separator.

Config (.mcp.json):

"sanity": {
"type": "http",
"url": "https://mcp.sanity.io/"
}
Steps to reproduce:

Configure a remote HTTP MCP server pointing at a bare origin URL (e.g. https://mcp.sanity.io/, no path segment).
Start a session / open the MCP servers panel.
Server shows status Failed with the error above.
Tried so far (none fixed it):

Added a trailing slash to the URL in .mcp.json — no change, same malformed path.
Clicked "Reconnect" in the MCP servers panel — no change.
Clicked "Authenticate" (full re-auth) — no change, same error.
Expected: Server connects normally (other configured servers with a URL that includes a path, e.g. https://mcp.notion.com/mcp, do not show this issue).

Environment:

Claude Code version: [впишите]
OS: Windows 11
Running inside: VS Code extension

What Should Happen?

The Sanity MCP server should connect successfully, like the other configured MCP servers do.

Error Messages/Logs

InvalidHTTPResponse fetching https://mcp.sanity.io.well-known/oauth-protected-resource

Steps to Reproduce

  1. Configure a remote HTTP MCP server pointing at a bare origin URL, e.g. in .mcp.json: "sanity": {"type": "http", "url": "https://mcp.sanity.io/"}
  2. Start a Claude Code session / open the MCP servers panel.
  3. Server status shows "Failed" with: InvalidHTTPResponse fetching https://mcp.sanity.io.well-known/oauth-protected-resource
  4. Click "Reconnect" — same error persists.
  5. Click "Authenticate" (full re-auth) — same error persists.

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

none

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗