Secure your FastMCP server with GitHub OAuth
New in version:Â 2.12.0
This guide shows you how to secure your FastMCP server using GitHub OAuth. Since GitHub doesnât support Dynamic Client Registration, this integration uses the OAuth Proxy pattern to bridge GitHubâs traditional OAuth with MCPâs authentication requirements.
http://localhost:8000
)Navigate to OAuth Apps
Configure Your OAuth App
/auth/callback
(e.g., http://localhost:8000/auth/callback
)/auth/callback
, but you can customize it using the redirect_path
parameter. For local development, GitHub allows http://localhost
URLs. For production, you must use HTTPS./auth/github/callback
), make sure to set the same path in both your GitHub OAuth App settings and the redirect_path
parameter when configuring the GitHubProvider.Save Your Credentials
Ov23liAbcDefGhiJkLmN
GitHubProvider
, which handles GitHubâs OAuth quirks automatically:
FASTMCP_SERVER_AUTH=GITHUB
. Learn more about registered providers.GITHUB
to use the registered GitHubProvider with default configuration.Ov23liAbcDefGhiJkLmN
)user,repo
).env
file: