Skip to content

Let users grant every scope to self-registered OAuth clients - #2721

Merged
ejsmith merged 2 commits into
mainfrom
fix/mcp-server-hotfix
Nov 5, 2026
Merged

ejsmith merged 2 commits into
mainfrom
fix/mcp-server-hotfix

Conversation

@ejsmith

@ejsmith ejsmith commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

MCP clients can't connect: approving access fails with "Unable to load application details" and Approve stays disabled. The real response is invalid_scope. Refs #2615.

Cause

flowchart LR
  A[Discovery advertises 6 scopes] --> B[Client requests all 6]
  C[Registration stores 5, no stacks:write] --> D{Consent check}
  B --> D
  D -->|before| E[invalid_scope, cannot approve]
  D -->|after| F[User approves, grant limited by consent]
Loading

#2638 made the error readable but left enforcement unchanged, so main still blocks approval.

Behavior

Client Before After
Self-registered, not edited by an admin Limited to its registered scopes; rejected otherwise Any supported scope; the user's consent limits the grant
Scopes saved by an admin Rejected if it asks for more Consent offers only the allowed scopes; the final request is still strict
Registers without a scope Read-only defaults All supported scopes
  • Applies at lookup, so existing clients need no migration and refresh tokens keep stacks:write.
  • A self-registered client could already register with every scope, so its stored list protected nothing.
  • A metadata refresh now skips applications an administrator has saved, so it can't lift a restriction. Those applications no longer pick up later metadata changes.

Review notes

Verification

Check Result
OAuth and MCP backend test classes 271 of 271 pass
Same fix on v8.10.0 (hotfix base) 230 backend and 976 frontend tests pass
Live browser e2e and full backend suite Left to CI

MCP clients request every scope discovery advertises, but a dynamically
registered client was stored without stacks:write. Consent rejected the
whole request with invalid_scope, so the client could never be approved.

A self-registered client chooses its own scopes and could register again
with all of them, so that list restricts nothing. Those clients may now
request any supported scope, and the user's consent limits the grant.
Scopes an administrator saved stay enforced: consent offers only the
allowed ones and the final authorization request is still strict.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T16:36:31.805133Z 6690fdb New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 190f6d7528

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A metadata refresh overwrote an administrator's saved settings and reset
UpdatedByUserId, which made the application count as self-registered and
lifted its scope restriction. Skip the refresh once an administrator has
saved the application.
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.AppHost 23% 22% 130 ❌
Exceptionless.Core 78% 70% 10993 ✔
Exceptionless.Insulation 51% 43% 370 ➖
Exceptionless.Web 86% 72% 9427 ✔
Summary 81% (28631 / 35506) 70% (14337 / 20514) 20920 ✔

@ejsmith
ejsmith merged commit b9f8669 into main Nov 5, 2026
23 checks passed
@ejsmith
ejsmith deleted the fix/mcp-server-hotfix branch November 5, 2026 19:31
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