Skip to content

Preserve OAuth resource indicator strings#2518

Draft
pradeep-ramola wants to merge 2 commits into
modelcontextprotocol:mainfrom
pradeep-ramola:fix-oauth-resource-indicator-preserve-string
Draft

Preserve OAuth resource indicator strings#2518
pradeep-ramola wants to merge 2 commits into
modelcontextprotocol:mainfrom
pradeep-ramola:fix-oauth-resource-indicator-preserve-string

Conversation

@pradeep-ramola

Copy link
Copy Markdown

Fixes #1968

Summary

Preserves the exact OAuth resource indicator string published by protected resource metadata instead of normalizing it through URL.href.

Previously, pathless metadata resources such as https://example.com were converted into https://example.com/ when the SDK added the resource parameter to authorization and token requests.

Testing

  • corepack pnpm --filter @modelcontextprotocol/client exec vitest run test/client/auth.test.ts
  • corepack pnpm --filter @modelcontextprotocol/client typecheck
  • corepack pnpm --filter @modelcontextprotocol/client build
  • corepack pnpm --filter @modelcontextprotocol/client exec prettier --ignore-path ../../.prettierignore --check src/client/auth.ts test/client/auth.test.ts
  • corepack pnpm --filter @modelcontextprotocol/client exec eslint src/client/auth.ts

@changeset-bot

changeset-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 574649c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/client Patch
@modelcontextprotocol/core Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/codemod Patch
@modelcontextprotocol/core-internal Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2518

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2518

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2518

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2518

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2518

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2518

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2518

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2518

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2518

commit: 574649c

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.

OAuth resource indicator from protected resource metadata is normalized with a trailing slash

1 participant