Skip to content

Auth for MCP - Starlette middleware vs. OAuthAuthorizationServerProvider #702

@Westerby

Description

@Westerby

There has been some discussion in this repo and in the TypeScript MCP repo regarding authentication with MCP servers.

The Python SDK includes an OAuthAuthorizationServerProvider example for implementing authentication.

What was the motivation behind introducing this? It seems that authentication could be implemented more directly—and in my opinion, more simply—using Starlette middleware. Additionally, OAuthAuthorizationServerProvider appears to assume user input as part of the flow, whereas MCP servers will often act as backend resource servers without direct user interaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Significant bug affecting many users, highly requested featureauthIssues and PRs related to Authentication / OAuthdocumentationImprovements or additions to documentationready for workEnough information for someone to start working on

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions