Skip to content

Support an end-user friendly OAuthAuthorizationCodeAuthenticator #2

Open

Description

@erwinkramer

In a perfect world, this library allows some kind of OAuthAuthorizationCodeAuthenticator, which not only should read from the OpenAPI OAuth 2.0 security segment to get the required values, such as these, but also allows for interactive authentication through prompting with the MCP server, allowing for each end-user to use their own credentials. This is equivalent to using a swagger ui or scalar ui, where you can interactively generate your oauth tokens and use them (in the browser front-end generated by the UI tooling).

I also requested this in a similar project, see gunpal5/QuickMCP#9

Activity

  1. abdebek commented on Dec 7, 2025

    @abdebek
    Owner

    Hi @erwinkramer ,

    Quick update: PKCE and client-credentials support are in (as of version 0.0.5-preview), and external OpenAPI specs (like your bank API) can be registered with the right token/authorize endpoints and subscription key.

    Currently authentication is still triggered out-of-band (browser/device flow) with a shared token store, so it doesn’t yet offer a Swagger-UI-style interactive login per MCP user. We could add an MCP ‘login’ tool that returns a device-flow verification URL + user code (with per-session token storage), or an auth-code/PKCE URL handoff. Do you have a preference or any suggestions? We can try one approach and adjust based on feedbacks.

  2. erwinkramer commented on Dec 7, 2025

    @erwinkramer
    ContributorAuthor

    @abdebek looks like some good progress, nice!

    For device flow vs authorization code - I feel like authorization code flow is more commonly used. Device flow has been supported just recently in the OpenAPI spec: https://github.com/OAI/OpenAPI-Specification/releases/tag/3.2.0, this means there is little support for OpenAPI spec generators. I don't even think it's technically possible in asp.net APIs currently, since .net 10 only supports up to openapi 3.1.1 spec - unless you use a custom setup with the Microsoft.OpenAPI library.

  3. erwinkramer commented on Dec 23, 2025

    @erwinkramer
    ContributorAuthor

    @abdebek just an update from my side, please see https://github.com/erwinkramer/bank-api?tab=readme-ov-file#run-the-mcp-server, i successfully implemented the library in a way that currently works for me, based on your last changes on 0.0.7-preview and your provided samples in the repo (much thanks for that!).

    There is still potential to have it even further simplified (like support for multiple auth providers in 1 API without duplicating tools, and not having to specify the provider details but getting them from the definition instead), but I'm already very happy with what I can do with it. 💯

  4. erwinkramer commented on Oct 29, 2026

    @erwinkramer
    ContributorAuthor

    @abdebek I decided to go ahead and create my own MCP project based on OpenAPI specs, see https://github.com/erwinkramer/enframe

    This is exactly what I was looking for, took a few days but it's serving me well.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions