Skip to content

fix: validate_scope should allow all scopes when no restriction#2246

Open
goingforstudying-ctrl wants to merge 141 commits intomodelcontextprotocol:mainfrom
goingforstudying-ctrl:fix/validate-scope-none-handling
Open

fix: validate_scope should allow all scopes when no restriction#2246
goingforstudying-ctrl wants to merge 141 commits intomodelcontextprotocol:mainfrom
goingforstudying-ctrl:fix/validate-scope-none-handling

Conversation

@goingforstudying-ctrl
Copy link

Fixes #2216

When client registration has scope=None (no restriction), validate_scope() was incorrectly rejecting all requested scopes by treating None as an empty allowed list.

Changes:

  • When self.scope is None, return all requested scopes immediately
  • Added tests to verify the fix

/attempt #2216

When client registration has scope=None (no restriction),
validate_scope was incorrectly rejecting all requested scopes
by treating None as an empty allowed list.

Now when scope is None, all requested scopes are allowed,
which matches the expected behavior described in the auth flow.

Fixes modelcontextprotocol#2216
@goingforstudying-ctrl goingforstudying-ctrl force-pushed the fix/validate-scope-none-handling branch from e65bd53 to 2a0938a Compare March 8, 2026 06:25
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.

Bug: validate_scope rejects client scopes when required scopes in None

1 participant