Andrea Griffiths · MIT

CIMD MCP reference server

A remote MCP server on Cloudflare Workers that accepts OAuth clients identified by a Client ID Metadata Document. No developer portal, no client_secret, no POST /register.

Live on Cloudflare Workers

Open the live server

MCP endpoint

https://cimd-mcp-reference.andrea-oauth-demos.workers.dev/mcp

Try it with MCP Inspector

npx @modelcontextprotocol/inspector --server-url https://cimd-mcp-reference.andrea-oauth-demos.workers.dev/mcp --transport http --client-metadata-url https://cimd-mcp-reference.andrea-oauth-demos.workers.dev/examples/inspector-web.json

The hosted demo has an open consent screen with no password on purpose, so anyone can try the full CIMD flow. Tokens only reach the demo tools (whoami, current_time, add_note, list_notes) and demo notes. On a copy you deploy, CONSENT_PASSWORD is an optional Worker secret that gates the consent screen. A real server should use real user login.

What this is

MCP clients talk to servers they have never seen. Classic OAuth assumes the server already knows the app. That is why MCP used Dynamic Client Registration (DCR, RFC 7591): the client posted to /register and the server minted a client_id.

MCP 2026-07-28 deprecates DCR and recommends CIMD instead. The client_id is an HTTPS URL. That URL hosts a small JSON file the authorization server fetches at login. Nothing about the client is stored ahead of time.

{
  "client_id": "https://app.example.com/client.json",
  "client_name": "Example MCP Client",
  "redirect_uris": ["http://127.0.0.1:3000/callback"],
  "token_endpoint_auth_method": "none"
}

(Example for a local client. The hosted demo's inspector-web.json uses http://localhost:6274/oauth/callback for MCP Inspector, so copy that one to try the live server.)

This is a working server-side example of that path: discovery, CIMD fetch with SSRF guards, consent, PKCE tokens, and a Streamable HTTP MCP endpoint.

Why CIMD replaces DCR

DCR lets any caller create a client on your authorization server. That is convenient for first contact and expensive as a trust model: the server learns nothing durable about who the client is, and /register becomes an open write endpoint.

With CIMD the client already has an identity (the HTTPS URL of its metadata). The server checks that the document's client_id equals that URL and that the request redirect_uri is on the document's list. The client hosts the file. The server does not keep a developer-portal registry.

As of 9 October 2026, most MCP servers that use OAuth still don't advertise CIMD: 23 of 151 vendor servers (15%) on McpMetrics' official list, and 29% of OAuth servers in a 3,000-host sample of the MCP registry. This project exists so the server side of that spec is copyable.

The flow

sequenceDiagram
    participant C as MCP client
    participant W as This Worker
    participant D as client.json
    C->>W: POST /mcp (no token)
    W-->>C: 401 + resource_metadata
    C->>W: GET protected resource metadata
    C->>W: GET authorization server metadata
    C->>W: GET /authorize?client_id=https://.../client.json
    W->>D: GET client.json
    W-->>C: consent, then redirect with code
    C->>W: POST /token (code + PKCE + resource)
    W-->>C: access_token
    C->>W: POST /mcp with Bearer token
        

Specs

MCP authorization 2026-07-28 · Client registration · CIMD draft-01 · RFC 8414 · RFC 8707 · RFC 9207 · RFC 9728