Alpha. 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()`). The OAuth Protected Resource surface is alpha — the config shape, the contributed context key, and the metadata route may change in a minor release.
import { withOAuthProtectedResource, fromSupabaseUrl } from '@supabase/server'
withOAuthProtectedResource(
{
resourceServer: (req) => new URL(req.url).origin + '/api/mcp',
authorizationServer: fromSupabaseUrl('https://abc123.supabase.co'),
},
handler,
)