π The fast, Pythonic way to build MCP servers and clients.
Update AuthKit vocab (#1338)
Jeremiah Lowin5a87a4787daf
diff --git a/docs/docs.json b/docs/docs.jsonindex 7ae4c5fa4..7dd4b3961 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -65,10 +65,7 @@{"group": "Essentials","icon": "cube",- "pages": [- "servers/server",- "deployment/running-server"- ]+ "pages": ["servers/server", "deployment/running-server"]},{"group": "Core Components",@@ -111,10 +108,7 @@{"group": "Essentials","icon": "cube",- "pages": [- "clients/client",- "clients/transports"- ]+ "pages": ["clients/client", "clients/transports"]},{"group": "Core Operations",@@ -140,10 +134,7 @@{"group": "Authentication","icon": "user-shield",- "pages": [- "clients/auth/oauth",- "clients/auth/bearer"- ]+ "pages": ["clients/auth/oauth", "clients/auth/bearer"]}]},@@ -151,6 +142,7 @@"group": "Integrations","pages": ["integrations/anthropic",+ "integrations/authkit","integrations/chatgpt","integrations/claude-code","integrations/claude-desktop",@@ -162,8 +154,7 @@"integrations/openai","integrations/openapi","integrations/permit",- "integrations/starlette",- "integrations/authkit"+ "integrations/starlette"]},{@@ -190,17 +181,12 @@},{"anchor": "What's New",- "pages": [- "updates",- "changelog"- ]+ "pages": ["updates", "changelog"]},{"anchor": "Community","icon": "users",- "pages": [- "community/showcase"- ]+ "pages": ["community/showcase"]}]},diff --git a/docs/integrations/authkit.mdx b/docs/integrations/authkit.mdxindex 36422258c..c04a414e3 100644--- a/docs/integrations/authkit.mdx+++ b/docs/integrations/authkit.mdx@@ -1,7 +1,7 @@----title: WorkOS AuthKit π€ FastMCP-sidebarTitle: WorkOS AuthKit-description: Secure your FastMCP server with WorkOS AuthKit+title: AuthKit π€ FastMCP+sidebarTitle: AuthKit+description: Secure your FastMCP server with AuthKit by WorkOSicon: shield-checktag: NEW---@@ -10,20 +10,20 @@ import { VersionBadge } from "/snippets/version-badge.mdx"<VersionBadge version="2.11.0" />-This guide shows you how to secure your FastMCP server using **WorkOS AuthKit**, a complete authentication and user management solution. This integration uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern, where WorkOS handles user login and your FastMCP server validates the tokens.+This guide shows you how to secure your FastMCP server using WorkOS's **AuthKit**, a complete authentication and user management solution. This integration uses the [**Remote OAuth**](/servers/auth/remote-oauth) pattern, where AuthKit handles user login and your FastMCP server validates the tokens.## Configuration### PrerequisitesBefore you begin, you will need:-1. A **WorkOS Account** and a new **Project**.-2. An **AuthKit** instance configured within your WorkOS project.+1. A **[WorkOS Account](https://workos.com/)** and a new **Project**.+2. An **[AuthKit](https://www.authkit.com/)** instance configured within your WorkOS project.3. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`).### Step 1: AuthKit Configuration-In your WorkOS Dashboard, navigate to your AuthKit instance and configure the following settings:+In your WorkOS Dashboard, enable AuthKit and configure the following settings:<Steps><Step title="Enable Dynamic Client Registration">diff --git a/src/fastmcp/server/auth/providers/workos.py b/src/fastmcp/server/auth/providers/workos.pyindex 7a71e4550..ff38b275c 100644--- a/src/fastmcp/server/auth/providers/workos.py+++ b/src/fastmcp/server/auth/providers/workos.py@@ -32,9 +32,9 @@ class AuthKitProviderSettings(BaseSettings):@register_provider("AUTHKIT")class AuthKitProvider(AuthProvider):- """WorkOS AuthKit metadata provider for DCR (Dynamic Client Registration).+ """AuthKit metadata provider for DCR (Dynamic Client Registration).- This provider implements WorkOS AuthKit integration using metadata forwarding+ This provider implements AuthKit integration using metadata forwardinginstead of OAuth proxying. This is the recommended approach for WorkOS DCRas it allows WorkOS to handle the OAuth flow directly while FastMCP actsas a resource server.@@ -56,7 +56,7 @@ class AuthKitProvider(AuthProvider):```pythonfrom fastmcp.server.auth.providers.workos import AuthKitProvider- # Create WorkOS metadata provider (JWT verifier created automatically)+ # Create AuthKit metadata provider (JWT verifier created automatically)workos_auth = AuthKitProvider(authkit_domain="https://your-workos-domain.authkit.app",base_url="https://your-fastmcp-server.com",@@ -75,13 +75,13 @@ class AuthKitProvider(AuthProvider):required_scopes: list[str] | None | NotSetT = NotSet,token_verifier: TokenVerifier | None = None,):- """Initialize WorkOS metadata provider.+ """Initialize AuthKit metadata provider.Args:- authkit_domain: Your WorkOS AuthKit domain (e.g., "https://your-app.authkit.app")+ authkit_domain: Your AuthKit domain (e.g., "https://your-app.authkit.app")base_url: Public URL of this FastMCP serverrequired_scopes: Optional list of scopes to require for all requests- token_verifier: Optional token verifier. If None, creates JWT verifier for WorkOS+ token_verifier: Optional token verifier. If None, creates JWT verifier for AuthKit"""super().__init__()@@ -112,7 +112,7 @@ class AuthKitProvider(AuthProvider):self.token_verifier = token_verifierasync def verify_token(self, token: str) -> AccessToken | None:- """Verify a WorkOS token using the configured token verifier."""+ """Verify an AuthKit token using the configured token verifier."""return await self.token_verifier.verify_token(token)def customize_auth_routes(self, routes: list[BaseRoute]) -> list[BaseRoute]: