mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 13:04:18 +02:00
feat:updated documentation
This commit is contained in:
parent
7418ad783c
commit
e2d424e1d6
2 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_SUPABASE_AUTH_ROUTE" default="/auth/v1">
|
||||
Your Supabase auth route (e.g., `/auth/v1`)
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="FASTMCP_SERVER_AUTH_SUPABASE_REQUIRED_SCOPES" default="[]">
|
||||
Comma-, space-, or JSON-separated list of required OAuth scopes (e.g., `openid email` or `["openid", "email"]`)
|
||||
</ParamField>
|
||||
|
|
|
|||
|
|
@ -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."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue