Skip to content

MCP OAuthのスコープ省略時に認証が失敗する問題を修正 - #23

Merged
nakasyou merged 1 commit into
mainfrom
codex/fix-mcp-oauth-scopes
Oct 21, 2026
Merged

nakasyou merged 1 commit into
mainfrom
codex/fix-mcp-oauth-scopes

Conversation

@nakasyou

Copy link
Copy Markdown
Member

MCPクライアントが動的登録で scope を省略すると、認可時に read を要求しても invalid_scope: Client was not registered with scope read で失敗していました。

省略時は既存のサーバー既定値 read trade reconcile を登録・返却し、スコープ未保存の既存クライアントも読み込み時に同じ既定値を保存します。明示されたスコープ(空文字列を含む)は変更しません。登録は要求可能なスコープの宣言で、実際のトークンにはユーザーが認可したスコープだけが付与されます。

検証:

  • 修正前に省略登録と既存登録の回帰テストが失敗することを確認。
  • 公式MCP SDKで動的登録 → read認可 → オーナー承認 → PKCEトークン交換 → MCPツール呼び出しを実行。
  • 既存登録の修復、明示スコープの制限、MCP既存テストを合わせて7件成功。
  • bun fmt・bun typecheck 成功。

Copilot AI balanced review requested due to automatic review settings October 21, 2026 12:17

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@nakasyou
nakasyou merged commit f18d03f into main Oct 21, 2026
2 checks passed
@nakasyou
nakasyou deleted the codex/fix-mcp-oauth-scopes branch October 21, 2026 12:20
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants