For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.
Points authorizationServer at a Supabase project's Auth issuer.
Use this off Supabase Edge Functions, where the app's own origin is unrelated to the Supabase project's, so the issuer cannot be derived from the request.
The project URL, e.g. `https://.supabase.co` (the same value passed to `createClient()`).
import { withOAuthProtectedResource, fromSupabaseUrl } from '@supabase/server'
withOAuthProtectedResource(
{
resourceServer: (req) => new URL(req.url).origin + '/api/mcp',
authorizationServer: fromSupabaseUrl('https://abc123.supabase.co'),
},
handler,
)