Skip to content

Conversation

cliffhall
Copy link
Member

@cliffhall cliffhall commented Oct 11, 2025

Description

  • In auth.ts
    • add getter for redirect_uris which returns redirectUrl and debugRedirectUrl but de-duped
    • included comments that explains the problem and link to issue
    • in clientMetadata getter,
      • replace hardcoded array value with this..redirect_uris, so it will never contain duplicate uris

Motivation and Context

  • The InspectorOAuthClientProvider has getters for redirectUrl and debugRedirectUrl which contain distinctly different URLs.
  • The clientMetadata getter returns an object with redirectUris set to an array that contains references to both those getters. Seems fine execpt...
  • The DebugInspectorOAuthClientProvider subclass has an overridden redirectUrl getter that returns this.debugRedirectUrl.
  • As a result when using the subclass, you get two copies of the debugRedirectUrl in an array, leading to an error "Duplicate redirectURIs" as reported in Duplicate redirect URIs generated by DebugInspectorOAuthClientProvider cause DCR failure #825
  • This PR addresses that situation by adding a redirect_uris getter to InspectorOAuthClientProvider which returns an array of redirectUrl and debugRedirectUrl but de-duped. So if you are using the subclass, you will only have the debugRedirectUrl in that array, otherwise both.

How Has This Been Tested?

Against https://example-server.modelcontextprotocol.io/mcp using the OAuth debugger

Before

Screenshot 2025-10-11 at 2 57 28 PM

After

Screenshot 2025-10-11 at 2 55 08 PM

Breaking Changes

Nope.

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

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Fixes #825

* In auth.ts
  - add getter for redirect_uris which returns redirectUrl and debugRedirectUrl but de-duped
  - included comments that explains the problem and link to issue
  - in clientMetadata getter,
    - replace hardcoded array value with this..redirect_uris, so it will never contain duplicate uris

Fixes modelcontextprotocol#825
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.

Duplicate redirect URIs generated by DebugInspectorOAuthClientProvider cause DCR failure

1 participant