Skip to content

context_server: Handle bad WWW-Authenticate resource_metadata URLs#53502

Merged
tomhoule merged 1 commit into
mainfrom
tomhoule-owruotnxnsqw
May 18, 2026
Merged

context_server: Handle bad WWW-Authenticate resource_metadata URLs#53502
tomhoule merged 1 commit into
mainfrom
tomhoule-owruotnxnsqw

Conversation

@tomhoule

@tomhoule tomhoule commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

In MCP OAuth, when the resource_metadata URL from the WWW-Authenticate header from the MCP server is on the same origin, but points to a broken endpoint (for example Pydantic Logfire doubles the path component, producing /mcp/mcp), fall back to the RFC 9728 well-known URIs instead of failing outright. The header URL is still tried first, as per the MCP spec.

Release Notes:

  • MCP OAuth: Handle bad URLs in WWW-Authenticate by falling back to the well known authorization server metadata URLs.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 9, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Apr 9, 2026
@tomhoule tomhoule marked this pull request as ready for review April 9, 2026 10:52
@tomhoule tomhoule force-pushed the tomhoule-owruotnxnsqw branch 2 times, most recently from 7f124ff to ef5503b Compare April 16, 2026 11:47
@tomhoule tomhoule force-pushed the tomhoule-owruotnxnsqw branch from ef5503b to ad6d321 Compare April 21, 2026 12:21
@tomhoule tomhoule force-pushed the tomhoule-owruotnxnsqw branch from ad6d321 to 8c1d074 Compare May 18, 2026 11:49
…a URLs

When the resource_metadata URL from the WWW-Authenticate header is same-origin but points to a broken endpoint (for example Pydantic Logfire doubles the path component, producing /mcp/mcp), fall back to the RFC 9728 well-known URIs instead of failing outright. The header URL is still tried first per the MCP spec requirement.
@tomhoule tomhoule force-pushed the tomhoule-owruotnxnsqw branch from 8c1d074 to 9c5d615 Compare May 18, 2026 12:03
@tomhoule tomhoule added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit 770e20c May 18, 2026
32 checks passed
@tomhoule tomhoule deleted the tomhoule-owruotnxnsqw branch May 18, 2026 12:51
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request May 20, 2026
…ed-industries#53502)

In MCP OAuth, when the resource_metadata URL from the WWW-Authenticate
header from the MCP server is on the same origin, but points to a broken
endpoint (for example Pydantic Logfire doubles the path component,
producing /mcp/mcp), fall back to the RFC 9728 well-known URIs instead
of failing outright. The header URL is still tried first, as per the MCP
spec.

Release Notes:

- MCP OAuth: Handle bad URLs in WWW-Authenticate by falling back to the
well known authorization server metadata URLs.
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
…ed-industries#53502)

In MCP OAuth, when the resource_metadata URL from the WWW-Authenticate
header from the MCP server is on the same origin, but points to a broken
endpoint (for example Pydantic Logfire doubles the path component,
producing /mcp/mcp), fall back to the RFC 9728 well-known URIs instead
of failing outright. The header URL is still tried first, as per the MCP
spec.

Release Notes:

- MCP OAuth: Handle bad URLs in WWW-Authenticate by falling back to the
well known authorization server metadata URLs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants