Skip to content

[v1.x] docs(server/auth): document that resourceServerUrl and resourceMetadataUrl are needed for MCP-compliant discovery - #2752

Open
bumhwan wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
bumhwan:docs/auth-rs-metadata-jsdoc-v1x
Open

[v1.x] docs(server/auth): document that resourceServerUrl and resourceMetadataUrl are needed for MCP-compliant discovery#2752
bumhwan wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
bumhwan:docs/auth-rs-metadata-jsdoc-v1x

Conversation

@bumhwan

@bumhwan bumhwan commented Sep 3, 2026

Copy link
Copy Markdown

Motivation and Context

Follow-up to #2751. When an MCP endpoint lives under a path (the usual /mcp), omitting resourceServerUrl on mcpAuthRouter and resourceMetadataUrl on requireBearerAuth silently produces discovery that the MCP authorization spec and RFC 9728 do not allow: PRM at the root well-known with resource: https://host/, and a 401 challenge without resource_metadata. The reference client tolerates this, so the only symptom is that strict clients (Gemini CLI, Antigravity CLI) fail discovery with ResourceMismatchError.

Both options are documented as merely "optional". This PR makes the JSDoc say what each one is for, that the MCP spec requires the resource_metadata challenge parameter, and what happens when they are left out.

How Has This Been Tested?

JSDoc-only change, no behaviour change. prettier --check passes on the touched files. The underlying behaviour (root-only PRM with origin resource, missing resource_metadata) was reproduced against v1.x as described in #2751.

Breaking Changes

None.

Types of changes

  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally (not applicable: comments only)
  • I have added appropriate error handling (not applicable)
  • I have added or updated documentation as needed

🤖 Generated with Claude Code

…eMetadataUrl are needed for MCP-compliant discovery

Both options are optional in the types, but for an MCP server both are effectively
required: without resourceServerUrl the Protected Resource Metadata is served at the
root well-known with resource set to the origin (not the MCP endpoint), and without
resourceMetadataUrl the 401 challenge has no resource_metadata parameter, which the
MCP authorization spec requires. Clients that enforce RFC 9728 §3.3 literally
(Gemini CLI, Antigravity CLI) abort discovery on the resulting documents while the
reference client accepts them, so server authors get no signal. Spell this out in
the JSDoc. No behaviour change.

Refs modelcontextprotocol#2751

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bumhwan
bumhwan requested a review from a team as a code owner September 3, 2026 03:40
@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 692ca2c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@modelcontextprotocol/sdk@2752

commit: 692ca2c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant