Use Supabase’s OAuth 2.1 server to sign users into your MCP server. Supabase handles the OAuth flow and issues the tokens; your server verifies them and you host the consent page.Documentation Index
Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before your MCP server will work, configure these in the Supabase Dashboard:Enable the OAuth 2.1 server
Authentication → Sign In / Providers → OAuth Server → toggle on. Also toggle Allow Dynamic OAuth Apps so MCP clients can self-register.
Set the consent screen URL
Point it at the route your MCP server will host, e.g.
http://localhost:3000/auth/consent. Supabase redirects the browser here with ?authorization_id=<uuid> after /authorize.Enable a sign-in method
Users must be signed in before they can consent. Pick one under Authentication → Sign In / Providers:
- Anonymous sign-ins — one-click guest sessions, ideal for demos
- Email + password, magic links, or OAuth providers (Google, GitHub, etc.) — for real apps
Host the consent UI
Supabase redirects the browser to the consent screen URL you configured above. Your route signs the user in, loads the authorization details with the Supabase JS SDK, and submits the approve/deny decision back to Supabase — mcp-use is not involved in this step. Don’t want to build it from scratch? Start from the mcp-oauth-supabase-template — it has sign-in, consent, and approve/deny already wired up. Or follow Supabase’s OAuth Server — Getting Started guide to roll your own.Environment variables
Configure the MCP server
Configuration options
Accessing user info in tools
Resources
- mcp-oauth-supabase-template — starter template with the consent UI already wired up
- Supabase OAuth Server — Getting Started
- Supabase OAuth Server — MCP Authentication
- Row Level Security
Next Steps
- User Context — Access user information in tools