Skip to content

HTTP 405 trying to load well-known OAuth metadata #634

Closed

Description

@jpmcb

Describe the bug

When attempting to walk through the auth flow for my server, I get the following:

Image
HTTP 405 trying to load well-known OAuth metadata

This seems to be directly related to: modelcontextprotocol/typescript-sdk#744

To Reproduce

Steps to reproduce the behavior:

  1. Have an OAuth server in the protected metadata at a trailing path like so: my-org.okta.com/oauth/abc123
  2. Attempt to walk through OAuth
  3. Notice error
  4. Open console and see the following:
OAuth flow error: Error: HTTP 405 trying to load well-known OAuth metadata
    discoverOAuthMetadata http://localhost:6274/assets/index-CPgI0-gs.js:16611

Expected behavior

OAuth flow to work with any auth server provider

Activity

  1. added
    authIssues and PRs related to authorization
    on Aug 3, 2025
  2. tomekchime commented on Aug 9, 2025

    @tomekchime

    Hmm, it looks like modelcontextprotocol/typescript-sdk#652 added OIDC Discovery support and version 0.16.2 pulled in that update, but this bug still exists in inspector.

  3. sbbeez commented on Oct 4, 2025

    @sbbeez

    I see the PR is already up to fix it.

    Faced this issue when using okta as authorization server, for temporary fix,

    • I cloned the inspector repo
    • Opened the node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
    • Updated the order of urlsToTry in buildDiscoveryUrls function, updated last one to first
    • ran npm run dev from the repo instead of inspector command

    Adding this, just in case someone is facing this issue

  4. olaservo commented on Oct 13, 2025

    @olaservo
    Member

    Hi @sbbeez, I see you mentioned a PR here, could you link to which PR you're referring to related to resolving this issue? Thanks!

  5. olaservo commented on Jan 18, 2026

    @olaservo
    Member

    This should be fixed by PR #702. Closing - please reopen if you're still experiencing this issue.


    This comment was posted by Claude during issue triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues and PRs related to authorizationbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions