oauthSupabaseProvider() options, defaults, and errors.
Configure Supabase
In the Supabase Dashboard:- Go to Authentication > Sign In / Providers > OAuth Server.
- Enable the OAuth 2.1 server.
- Enable Allow Dynamic OAuth Apps so MCP clients can register.
- Set the consent screen URL to a route your app implements, such as
http://localhost:3000/auth/consent. - Enable at least one sign-in method for users.
- Copy the Project ID and publishable key.
authorization_id. Your app must implement that route. The consent route signs the user in, loads the authorization details, and submits approve or deny back to Supabase.
Start from the mcp-oauth-supabase-template if you do not already have a consent UI. Do not deploy the MCP server without a working consent route.
Set environment variables
Configure the MCP server
Use Supabase RLS from tools
Create a Supabase client per request with the caller’s access token. This lets Row Level Security evaluate policies as the authenticated user. Install the Supabase client when your tools call Supabase:Verify the setup
Run the server and connect with an OAuth-capable MCP client.- The client discovers Supabase OAuth metadata.
- The user can sign in and approve consent.
- Authenticated tool calls include
ctx.auth.user.userId. - RLS-backed tools only return rows visible to the caller.
Next steps
Supabase OAuth template
Start from a consent UI wired for mcp-use and Supabase.
Supabase MCP Authentication
Review Supabase’s MCP authentication guide.
User Context
Use Supabase user data inside tools.
Supabase provider API reference
Look up exact provider options and defaults.