Skip to content

fix(mcp): support declared OAuth scopes - #1607

Merged
RhysSullivan merged 3 commits into
UsefulSoftwareCo:mainfrom
timkley:fix/mcp-oauth-declared-scopes
Aug 28, 2026
Merged

fix(mcp): support declared OAuth scopes#1607
RhysSullivan merged 3 commits into
UsefulSoftwareCo:mainfrom
timkley:fix/mcp-oauth-declared-scopes

Conversation

@timkley

@timkley timkley commented Aug 16, 2026

Copy link
Copy Markdown

Summary

  • allow MCP OAuth auth methods to declare a non-empty scope list
  • pass declared scopes into the Core OAuth policy
  • preserve declared scopes through MCP UI round-trips
  • keep metadata discovery unchanged when scopes are omitted

Context

Some MCP servers advertise fixed OAuth scopes but omit a protected-resource identifier from DCR. Executor then tries resource scope discovery and fails with:

Cannot discover OAuth scopes: the client has no resource configured

Declared scopes now take precedence, so scopes: ["mcp"] works without a client resource.

Related to #1330.

Verification

  • bun run format:check
  • bun run lint
  • bun run typecheck
  • cd packages/plugins/mcp && bun run test

The full root test run also reached one unrelated parallel-only timeout in apps/host-selfhost/src/platform-credential.test.ts; that test passes in isolation.

timkley and others added 3 commits August 16, 2026 16:10
scopes is a NonEmptyArray, so a hand-written `scopes: []` row does not
degrade to a scope-less oauth method — it makes the whole integration
config undecodable, and the integration then offers no auth method at
all. The editor codec already omits the key for an empty list; these
tests pin that constraint so it is visible at the place that must
respect it.
@RhysSullivan
RhysSullivan merged commit 75c917f into UsefulSoftwareCo:main Aug 28, 2026
75 of 76 checks passed
This was referenced Aug 28, 2026
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