fastmcp.server.auth.providers.discord
Discord OAuth provider for FastMCP.
This module provides a complete Discord OAuth integration that’s ready to use
with just a client ID and client secret. It handles all the complexity of
Discord’s OAuth flow, token validation, and user management.
Example:
Classes
DiscordProviderSettings
Settings for Discord OAuth provider.
DiscordTokenVerifier
Token verifier for Discord OAuth tokens.
Discord OAuth tokens are opaque (not JWTs), so we verify them
by calling Discord’s tokeninfo API to check if they’re valid and get user info.
Methods:
verify_token
DiscordProvider
Complete Discord OAuth provider for FastMCP.
This provider makes it trivial to add Discord OAuth protection to any
FastMCP server. Just provide your Discord OAuth app credentials and
a base URL, and you’re ready to go.
Features:
- Transparent OAuth proxy to Discord
- Automatic token validation via Discord’s API
- User information extraction from Discord APIs
- Minimal configuration required

