Skip to content

fix(oauth): honor discovered CIMD support - #1732

Open
aryasaatvik wants to merge 2 commits into
UsefulSoftwareCo:mainfrom
aryasaatvik:fix/mcp-cimd-discovery-upstream
Open

fix(oauth): honor discovered CIMD support#1732
aryasaatvik wants to merge 2 commits into
UsefulSoftwareCo:mainfrom
aryasaatvik:fix/mcp-cimd-discovery-upstream

Conversation

@aryasaatvik

@aryasaatvik aryasaatvik commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Prefer Client ID Metadata Documents when OAuth discovery advertises CIMD support, including servers that also expose a dynamic-registration endpoint. This keeps automatic MCP OAuth on the server-advertised path instead of incorrectly asking the user to register an app.

Flow

reserve popup -> probe OAuth discovery
  -> CIMD advertised: create/reuse metadata client -> start OAuth
  -> otherwise DCR advertised: register client -> start OAuth
  -> otherwise: show manual client setup

The probe handoff uses the SDK canonical OAuthProbeResult, so new discovery capabilities cannot be dropped by a duplicated UI-only type.

Validation

  • bunx vitest run src/components/add-account-modal.test.ts (45 tests)
  • bun run typecheck
  • bunx oxlint -c ../../.oxlintrc.jsonc src/components/add-account-modal.tsx src/components/add-account-modal.test.ts --deny-warnings
  • ./node_modules/.bin/oxlint -c .oxlintrc.jsonc packages/core/sdk/src/testing/oauth-test-server.ts e2e/selfhost/mcp-oauth-cimd-connect.test.ts --deny-warnings
  • ./node_modules/.bin/oxfmt --check packages/core/sdk/src/testing/oauth-test-server.ts e2e/selfhost/mcp-oauth-cimd-connect.test.ts
  • ./node_modules/.bin/vitest run --project selfhost selfhost/mcp-oauth-cimd-connect.test.ts — browser E2E passed with recording and trace

@aryasaatvik
aryasaatvik marked this pull request as ready for review August 25, 2026 21:51
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