Skip to content

Fix: Pre-registered Client ID as fallback to DCR #684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 13, 2025

Conversation

2underscores
Copy link
Contributor

@2underscores 2underscores commented Aug 5, 2025

Motivation and Context

The guided auth flow did not support static client fallback after dynamic client registration (DCR) had failed. This doesn't meet the MCP spec.

The MCP spec authorization states:

"Authorization servers and MCP clients SHOULD support the OAuth 2.0 Dynamic Client Registration Protocol (RFC7591).". The lack of fallback here means the auth debug flow doesn't meet MCP spec as it mandates that resource servers MUST support DCR.

This PR adds a static client credentials attempt as a fallback for failed DCR. If DCR is supported and successful, the static client will not be used.

Addresses #683.

How Has This Been Tested?

Tested locally with MCP servers with both DCR and static fallback.

Breaking Changes

No, purely an additive fallback.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Additional context

Potentially static client should take precedence if provided. That's the behaviour i'd personally expect, but that's opinionated. Either way, changes are expected to DCR as MCP spec roadmap already states looking for DCR alternatives

LMK if any changes needed, happy to change this around if another approach works better with the codebase, haven't worked with MCP inspector before.

@2underscores 2underscores changed the title Dcr fallback fix Fix: Pre-registered Client ID as fallback to DCR Aug 5, 2025
@olaservo olaservo requested a review from pcarleton August 11, 2025 04:08
@olaservo
Copy link
Member

Hi @2underscores could you fix this formatting issue that's causing the CI to fail? https://github.com/modelcontextprotocol/inspector/actions/runs/16870668912/job/47784850436?pr=684
Thanks!

@2underscores
Copy link
Contributor Author

Hi @2underscores could you fix this formatting issue that's causing the CI to fail? https://github.com/modelcontextprotocol/inspector/actions/runs/16870668912/job/47784850436?pr=684 Thanks!

@olaservo done!

@olaservo
Copy link
Member

Thanks @2underscores , looks like the CI is passing now (I usually want to check that the build and existing tests are passing before adding more comments etc.)

I think the change makes sense. Since its small but potentially significant I created a thread in the auth channel on the MCP Contributor Discord to get more 👀 on it. If you're interested in following there, you can find the link in these docs: https://modelcontextprotocol.io/community/communication

Copy link
Member

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

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

on board with adding this change! left a suggestion to prefer the pre-filled value if we have it.

@olaservo olaservo requested review from pcarleton and olaservo August 13, 2025 12:34
Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

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

Looks good to me - this is now mirroring the TS SDK behavior. 👍

@olaservo olaservo dismissed pcarleton’s stale review August 13, 2025 12:51

Change was added to match TS SDK

@olaservo olaservo merged commit a30e0d1 into modelcontextprotocol:main Aug 13, 2025
5 checks passed
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