Skip to content

401 unauthorized on simple-auth example #731

Closed

Description

@luarss

Describe the bug
Unable to get access to MCP server

To Reproduce
Followed all instructions in https://github.com/modelcontextprotocol/python-sdk/tree/main/examples/servers/simple-auth

Expected behavior
Using mcp-inspector, gotten 401 error when connecting via http://localhost:8000/sse

SSE transport: url=http://localhost:8000/sse, headers=Accept
Received 401 Unauthorized from MCP server: SSE error: Non-200 status code (401)
Image

Please let me know if any information is needed

Activity

  1. self-assigned this
    on May 17, 2025
  2. ihrpr commented on May 17, 2025

    @ihrpr
    Contributor

    @luarss please can you share server logs?

  3. luarss commented on May 19, 2025

    @luarss
    Author

    Hi @ihrpr, logs as follows.

    Image

    Here is my oauth app config

    Image

    MCP inspector config

    Image
  4. luarss commented on May 19, 2025

    @luarss
    Author

    Hi @ihrpr found the regression lies actually in mcp-inspector client, not the code.

    Code example works with npx @modelcontextprotocol/inspector@0.11.0. Perhaps we could add that blurb while they fix the issue?

    modelcontextprotocol/inspector#390

  5. ihrpr commented on May 19, 2025

    @ihrpr
    Contributor

    Thank you, looking into it!

  6. bttopfer commented on May 20, 2025

    @bttopfer

    I ran into the same issue - using inspector@0.11.0 does not help. Using /mcp - so streamable http transport.
    Authentication works fine when I run with custom test script (initialize, initialized.....), but fails with 401 in inspector and I do not even get to my implementation of OAuthAuthorizationServerProvider ( no logs for e.g. load_access_token). If I disable auth it works fine.

  7. zackify commented on May 20, 2025

    @zackify

    Yeah it’s really really annoying they don’t release the new update.

    But you can work around it like I have.

    Use v11 and select SSE. Then hit connect.

    Oauth.

    Now once oauth is successful. You start v12 and switch to streamable http because only v12 sends the header there 😆😆

    Or everyone is just using provider specific cloudflare tooling right now.

  8. felixweinberger commented on Oct 3, 2025

    @felixweinberger
    Contributor

    Closing as an inspector issue.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions