Skip to main content
Use oauthSupabaseProvider when Supabase Auth is the authorization server. Supabase handles login, consent, client registration, and token issuance; mcp-use verifies the resulting access token.

Configure Supabase

In the Supabase Dashboard:
  1. Enable the OAuth 2.1 server and Dynamic OAuth Apps.
  2. Configure a consent-screen route implemented by your application.
  3. Enable at least one user sign-in method.
  4. Copy the project ID and publishable key.
The maintained example includes a consent route and is the best starting point for a complete application.

Configure the server

Pass either projectId for hosted Supabase or supabaseUrl for local or self-hosted Supabase. Environment names belong to your application; the provider does not read them.
By default the provider expects audience authenticated. Modern Supabase tokens use ES256 and are verified through the project JWKS. For a legacy HS256 project, pass its secret explicitly:
jwtSecret selects HS256 verification and must be at least 32 bytes. Without it, the provider selects ES256/JWKS verification.

Use mapped identity

Supabase maps the subject to id and can map email, name, fullName, username, avatarUrl, role, aal, amr, and sessionId. It maps the assurance level to top-level permission aal:<level>.

Use Row Level Security

Create the Supabase client per request with the verified access token:
Use this token-forwarding pattern only for user-scoped operations. Server-owned operations should use a separate credential and explicit authorization.

Runnable Supabase example

Start from the maintained server and consent UI.

Supabase MCP Authentication

Configure Supabase OAuth for MCP.

User Context

Use mapped Supabase identity and token metadata.