Skip to content

auth: scope MCP tokens by server name - #439

Closed
Paul (pwang347) wants to merge 2 commits into
mainfrom
pwang/server-scoped-mcp-authentication
Closed

Paul (pwang347) wants to merge 2 commits into
mainfrom
pwang/server-scoped-mcp-authentication

Conversation

@pwang347

Copy link
Copy Markdown
Contributor

Summary

  • add an optional, exact serverName to authenticate requests for MCP-owned challenges
  • require hosts to apply named tokens only to that MCP server, even when sibling servers share the same OAuth resource and scopes
  • update the authentication specification, JSON schema, all generated client mirrors, and the security changelog fragment

Validation

  • protocol type-check
  • TypeScript protocol, generator, and changelog tests
  • change-fragment validation
  • generated schema and client diffs checked against the repository generator
  • full npm test (local npm ci is blocked by an ENOTCONN registry error; CI should run the canonical dependency/toolchain matrix)

Compatibility

The field is optional. Existing provider-level authentication and older clients continue to key tokens by resource and scopes; clients resolving a specific MCP challenge can opt into server-scoped routing.

Paul (pwang347) and others added 2 commits October 20, 2026 11:04
Add an optional MCP server identity to authenticate requests and regenerate every client/schema mirror so hosts can route same-resource credentials independently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace `AuthenticateParams.serverName` with an optional, extensible `target`
discriminated union. The `mcpServer` variant identifies the consumer by session
URI and `McpServerCustomization.id`, which clients echo from host-published
state. A bare server name is not unique across sessions or manifests, and
`authenticate` is a root-channel command.

With a target, hosts MUST apply the token only to that MCP server in that
session. Without one, resource/scope matching is unchanged. `kind` is
@nonexhaustive so host-owned authentication (#404) can add variants.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@connor4312

Copy link
Copy Markdown
Member

reopening so we don't have to wait for the CLA, that's an edge case 😅

@connor4312

Copy link
Copy Markdown
Member

Superseded by #535, which replaces serverName with an extensible target that identifies the MCP server by session URI and customization ID (server names aren't unique across sessions or manifests). Thanks for the original change; your commit is preserved in #535.

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.

2 participants