Repository navigation
Description
Is your feature request related to a problem?
We use the Supabase OAuth 2.1 server as the authorization server for a remote MCP server. MCP
clients such as Claude, ChatGPT, Microsoft Copilot Studio and Gemini CLI register through Dynamic
Client Registration (/oauth/clients/register).
Because DCR gives every registration a new random client_id, each reconnect creates another
client. One user who reconnected an assistant a few times now has many separate "Claude"
registrations, and the user's list of connected apps shows near-identical duplicates that can't
be told apart. Old registrations are never cleaned up, and the authorization server can't tell
that two registrations are the same application.
Describe the solution you'd like
Support Client ID Metadata Documents (IETF draft draft-ietf-oauth-client-id-metadata-document).
This is the registration approach the MCP authorization spec now recommends, alongside DCR as a
fallback:
- Accept an HTTPS URL as
client_idat/oauth/authorizeand/oauth/token(public clients,
token_endpoint_auth_method: none). - Fetch and validate the metadata document at that URL:
- the document's
client_idmust equal the URL; redirect_urismust include the request'sredirect_uri;- use
client_name/logo_urifor the consent screen.
- the document's
- Cache the document, honouring HTTP cache headers within sensible bounds.
- Advertise
client_id_metadata_document_supported: truein
/.well-known/oauth-authorization-server. - Persist consents and grants against the URL
client_id, so a reconnect from the same
application reuses the same identity: one entry per app, not one per reconnect.
Security considerations we'd expect:
- SSRF protection on the fetch (HTTPS only, no private, loopback or link-local addresses, size and
time limits); - strict redirect-URI matching against the fetched document;
- a project-level setting to allow or deny CIMD clients (or a domain allowlist);
- clear display of the client's host on the consent screen.
Describe alternatives you've considered
- Pre-registering each major MCP client manually. This needs coordination with every vendor
and a fixed client id per environment, which most hosted MCP clients don't expose. - Periodically deleting stale DCR registrations. This cleans up the clutter but not the
cause, and a reconnect still looks like a new app. - Grouping registrations by name in our own UI. This is unsafe, because DCR names are chosen
by the client, so a look-alike app could pose as a well-known one.
Additional context
- Claude's custom-connector setup now offers "Use Claude's published identity (CIMD)" as the
recommended OAuth option and falls back to DCR. Today it has to fall back for Supabase-backed
servers. - Related: OAuth 2.1 server: authorize rejects RFC 8252 loopback ephemeral-port redirect_uri (exact-match, no port exemption) #2703 (loopback ephemeral-port redirect URIs for native MCP clients such as Gemini CLI)
affects the same MCP-client population.
Activity
test: run the OAuth client steps on the MCP client SDK (#446)
TheoEwzZer commentedon Oct 22, 2026
We run Supabase's OAuth 2.1 server as the authorization server for a production remote MCP server (French invoicing SaaS, connected from Claude, ChatGPT, Le Chat and Claude Code). DCR works today, but it's our main scaling risk: the per-IP DCR rate limit (10/h) is shared by every user connecting from claude.ai or chatgpt.com, and each connection creates a new client row. CIMD would remove both issues and give us verified client identity instead of redirect-URI checks on the consent screen. Happy to test a preview behind a flag.
javierBlindStairs commentedon Nov 23, 2026
+1 to CIMD and to #2895. Our use case: Supabase Auth's OAuth 2.1 server is the authorization server for a remote MCP server (an Edge Function), used from claude.ai and ChatGPT.
oauth_clients, and nothing cleans them up.client_id_metadata_document_supported.https://chatgpt.com/connector/oauth/<id>) through DCR, so every connection is a distinct client.What we'd need from #2895 as hosted users:
GOTRUE_OAUTH_SERVER_ALLOW_CLIENT_ID_METADATA_DOCUMENTSenv var);client_id_metadata_document_supportedadvertised in/.well-known/oauth-authorization-server.Is there a plan to review #2895, and will it reach hosted projects? We're happy to test a preview.