From e2d424e1d6f9faac37c09cb385b3b5eb337e0b4f Mon Sep 17 00:00:00 2001 From: Eloi Zalczer Date: Tue, 16 Dec 2025 13:52:54 +0100 Subject: [PATCH] feat:updated documentation --- docs/integrations/supabase.mdx | 7 ++++++- tests/server/auth/providers/test_supabase.py | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/integrations/supabase.mdx b/docs/integrations/supabase.mdx index cbaa48920..d72f073e8 100644 --- a/docs/integrations/supabase.mdx +++ b/docs/integrations/supabase.mdx @@ -17,7 +17,7 @@ This guide shows you how to secure your FastMCP server using **Supabase Auth**. ### Prerequisites Before you begin, you will need: -1. A **[Supabase Account](https://supabase.com/)** with a project +1. A **[Supabase Account](https://supabase.com/)** with a project or a self-hosted **Supabase Auth** instance 2. Your FastMCP server's URL (can be localhost for development, e.g., `http://localhost:8000`) ### Step 1: Get Supabase Project URL @@ -38,6 +38,7 @@ from fastmcp.server.auth.providers.supabase import SupabaseProvider auth = SupabaseProvider( project_url="https://abc123.supabase.co", base_url="http://localhost:8000" + auth_route="/my/auth/route" # if self-hosting and using custom routes ) mcp = FastMCP("Supabase Protected Server", auth=auth) @@ -117,6 +118,10 @@ Your Supabase project URL (e.g., `https://abc123.supabase.co`) Public URL of your FastMCP server (e.g., `https://your-server.com` or `http://localhost:8000` for development) + +Your Supabase auth route (e.g., `/auth/v1`) + + Comma-, space-, or JSON-separated list of required OAuth scopes (e.g., `openid email` or `["openid", "email"]`) diff --git a/tests/server/auth/providers/test_supabase.py b/tests/server/auth/providers/test_supabase.py index a0c8d91d7..1a0a5b20f 100644 --- a/tests/server/auth/providers/test_supabase.py +++ b/tests/server/auth/providers/test_supabase.py @@ -40,12 +40,14 @@ class TestSupabaseProvider: { "FASTMCP_SERVER_AUTH_SUPABASE_PROJECT_URL": "https://env123.supabase.co", "FASTMCP_SERVER_AUTH_SUPABASE_BASE_URL": "https://envserver.com", + "FASTMCP_SERVER_AUTH_SUPABASE_AUTH_ROUTE": "/custom/auth/route", }, ): provider = SupabaseProvider() assert provider.project_url == "https://env123.supabase.co" assert str(provider.base_url) == "https://envserver.com/" + assert provider.auth_route == "/custom/auth/route" def test_environment_variable_loading(self): """Test that environment variables are loaded correctly."""