Skip to content

OAuth 2.1 server: support Client ID Metadata Documents (URL client_id) for MCP clients #2850

Open

Description

@alana-datum

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:

  1. Accept an HTTPS URL as client_id at /oauth/authorize and /oauth/token (public clients,
    token_endpoint_auth_method: none).
  2. Fetch and validate the metadata document at that URL:
    • the document's client_id must equal the URL;
    • redirect_uris must include the request's redirect_uri;
    • use client_name / logo_uri for the consent screen.
  3. Cache the document, honouring HTTP cache headers within sensible bounds.
  4. Advertise client_id_metadata_document_supported: true in
    /.well-known/oauth-authorization-server.
  5. 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

Activity

  1. TheoEwzZer commented on Oct 22, 2026

    @TheoEwzZer

    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.

  2. javierBlindStairs commented on Nov 23, 2026

    @javierBlindStairs

    +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.

    • Hosted MCP clients register through DCR on every connection, so each reconnect adds another row to oauth_clients, and nothing cleans them up.
    • Claude's connector offers its published identity (CIMD) first and falls back to DCR when the metadata lacks client_id_metadata_document_supported.
    • ChatGPT registers a per-connection callback (https://chatgpt.com/connector/oauth/<id>) through DCR, so every connection is a distinct client.
    • Users of one platform share egress IPs, so DCR also runs into the registration rate limit. I'll open a separate issue for that.

    What we'd need from #2895 as hosted users:

    • the flag available on hosted projects (a Dashboard toggle or a config API key, not only the GOTRUE_OAUTH_SERVER_ALLOW_CLIENT_ID_METADATA_DOCUMENTS env var);
    • an allow-list of hosts;
    • client_id_metadata_document_supported advertised 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions