π The fast, Pythonic way to build MCP servers and clients.
Update documentation around scopes for google (#1703)
Jeremiah Lowinbc25802a2877
diff --git a/docs/integrations/google.mdx b/docs/integrations/google.mdxindex c3ff3cc7b..ba65406e0 100644--- a/docs/integrations/google.mdx+++ b/docs/integrations/google.mdx@@ -77,7 +77,10 @@ auth_provider = GoogleProvider(client_id="123456789.apps.googleusercontent.com", # Your Google OAuth Client IDclient_secret="GOCSPX-abc123...", # Your Google OAuth Client Secretbase_url="http://localhost:8000", # Must match your OAuth configuration- required_scopes=["openid", "email", "profile"], # Request user information+ required_scopes=[ # Request user information+ "openid",+ "https://www.googleapis.com/auth/userinfo.email",+ ],# redirect_path="/auth/callback" # Default value, customize if needed)@@ -179,7 +182,7 @@ Redirect path configured in your Google OAuth Client</ParamField><ParamField path="FASTMCP_SERVER_AUTH_GOOGLE_REQUIRED_SCOPES" default="[]">-Comma-, space-, or JSON-separated list of required Google scopes (e.g., `openid,profile` or `["openid","profile"]`)+Comma-, space-, or JSON-separated list of required Google scopes (e.g., `"openid,https://www.googleapis.com/auth/userinfo.email"` or `["openid", "https://www.googleapis.com/auth/userinfo.email"]`)</ParamField><ParamField path="FASTMCP_SERVER_AUTH_GOOGLE_TIMEOUT_SECONDS" default="10">@@ -196,7 +199,7 @@ FASTMCP_SERVER_AUTH=GOOGLEFASTMCP_SERVER_AUTH_GOOGLE_CLIENT_ID=123456789.apps.googleusercontent.comFASTMCP_SERVER_AUTH_GOOGLE_CLIENT_SECRET=GOCSPX-abc123...FASTMCP_SERVER_AUTH_GOOGLE_BASE_URL=https://your-server.com-FASTMCP_SERVER_AUTH_GOOGLE_REQUIRED_SCOPES=openid,email,profile+FASTMCP_SERVER_AUTH_GOOGLE_REQUIRED_SCOPES=openid,https://www.googleapis.com/auth/userinfo.email```With environment variables set, your server code simplifies to:diff --git a/src/fastmcp/server/auth/oauth_proxy.py b/src/fastmcp/server/auth/oauth_proxy.pyindex 14a6e9fd0..15a52e7e1 100644--- a/src/fastmcp/server/auth/oauth_proxy.py+++ b/src/fastmcp/server/auth/oauth_proxy.py@@ -259,9 +259,7 @@ class OAuthProxy(OAuthProvider):redirect_path: Redirect path configured in upstream OAuth app (defaults to "/auth/callback")issuer_url: Issuer URL for OAuth metadata (defaults to base_url)service_documentation_url: Optional service documentation URL- resource_server_url: Path of the FastMCP server. If None, FastMCP will- attempt to overwrite this with the correct path to the server- e.g. {base_url}/mcp+ resource_server_url: Path of the FastMCP server.allowed_client_redirect_uris: List of allowed redirect URI patterns for MCP clients.Patterns support wildcards (e.g., "http://localhost:*", "https://*.example.com/*").If None (default), only localhost redirect URIs are allowed.