8000 Support for .well-known oauth discovery endpoints by seriousben · Pull Request #132 · punkpeye/fastmcp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support for .well-known oauth discovery endpoints #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

seriousben
Copy link
@seriousben seriousben commented Jun 25, 2025

Summary

This allows protecting a fastmcp server behind an oauth server.

This is done by adding support for OAuth 2.1 w A591 ell-known discovery endpoints to FastMCP, enabling MCP servers to serve OAuth metadata for authorization flows as required by MCP Specifications 2025-03-26 and 2025-06-18.

Note that additional features could be built on top of this like token verification, scope checks, and so on. This PR adds the minimum to allow mcp developers to add support for oauth auth.

Configuration

const server = new FastMCP({
  name: "My Server",
  version: "1.0.0",
  oauth: {
    enabled: true,
    authorizationServer: {
      issuer: "https://auth.example.com",
      authorizationEndpoint: "https://auth.example.com/oauth/authorize",
      tokenEndpoint: "https://auth.example.com/oauth/token",
      responseTypesSupported: ["code"],
    },
    protectedResource: {
      resource: "mcp://my-server",
      authorizationServers: ["https://auth.example.com"],
      bearerMethodsSupported: ["header"]
    }
  }
});

@punkpeye
Copy link
Owner

Thank you for your contribution. Please ensure that all checks are passing.

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.

2 participants
0