MCP sign-in an agent can finish.

An agent can reach your MCP server and still not sign in, because the last step opens a browser. Publish the metadata, accept clients by URL, and let a person approve with a code from any device.

The numbers

From the drives of 151 products, 1–24 Oct 2026. Each one links to its definition and evidence.

By AgentDrivesUpdated 24 October 2026Wall MCP sign-inFor agents Markdown

What agents hit

133 of 151 products have an MCP server. At 85 of them our agent couldn't get in on its own.

A client can find your metadata and register, and still stop at the last step: authorization opens a sign-in page in a browser, often behind the same bot check as your sign-up.

The fix, step by step

  1. Publish Protected Resource Metadata.

    The MCP spec requires it.1 Serve it at /.well-known/oauth-protected-resource2 and point to it from your 401 with the resource_metadata parameter of WWW-Authenticate.2

    HTTP/1.1 401 Unauthorized
    WWW-Authenticate: Bearer resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource"
  2. Publish your authorization server's metadata.

    At /.well-known/oauth-authorization-server3, with every endpoint a client needs.

  3. Accept clients by URL (CIMD).

    With a Client ID Metadata Document the client_id is an https URL to the client's own metadata, and you fetch it, so you store nothing. Say so in your metadata with client_id_metadata_document_supported.4 The MCP spec prefers it: clients use CIMD when the server supports it and fall back to registration.5

  4. Keep DCR for older clients.

    Dynamic Client Registration (a POST of the client's metadata to your registration endpoint6) is deprecated in the current MCP spec and kept for servers without CIMD.1 Support both while clients move.

  5. Let a person approve from any device.

    Add the device flow and list device_authorization_endpoint in your metadata.7 The agent shows a code, the person approves it once on their phone, and the agent gets its token. Or accept an API key as a bearer token on the same endpoint, for agents that signed up by API.

  6. Follow OAuth 2.1.

    PKCE on every code grant,8 and the resource parameter, which MCP clients must send.1

DCR or CIMD

  • DCR: each client POSTs its metadata to your registration endpoint and gets a client_id. You store one client per install and clean them up.
  • CIMD: the client_id is a URL to the client's metadata, which you fetch and cache. You store nothing, and you see who the client is.
  • The current MCP spec says clients SHOULD use CIMD and keeps DCR for backwards compatibility.1

Check it yourself

  1. Call your MCP endpoint without a token.

    You want a 401 whose WWW-Authenticate names resource_metadata.

    curl -si -X POST https://mcp.example.com/mcp | grep -i www-authenticate
  2. Read the metadata like a client.

    Each value should be there.

    curl -s https://mcp.example.com/.well-known/oauth-protected-resource | jq .authorization_servers
    curl -s https://auth.example.com/.well-known/oauth-authorization-server \
      | jq '{client_id_metadata_document_supported, registration_endpoint, device_authorization_endpoint}'
  3. Sign in from a server.

    Connect an MCP client from a terminal on a server. If the sign-in needs a browser on that machine, an agent on a server can't finish it.

Written by our agents from our drives and the vendors' own docs. How we write.

Fixed it? Drive it again.

Our agent drives your product again, and you see how far it gets now.

  • Free, after a fix. Tell us what you changed in your account and our agent drives it again, up to twice a year.
  • An Audit Drive, $499. We drive you again after your fixes, within your Audit year. A certificate once an agent can use it fully with no person.

Pages this guide cites.

As linked when it was written. ↩ goes back to where the text cites it.

  1. 1modelcontextprotocol.io · MCP authorizationspecification/2026-07-28/basic/authorization↩
  2. 2rfc-editor.org · RFC 9728, Protected Resource Metadatarfc/rfc9728.txt↩
  3. 3rfc-editor.org · RFC 8414, Authorization Server Metadatarfc/rfc8414.txt↩
  4. 4ietf.org · Client ID Metadata Documentarchive/id/draft-ietf-oauth-client-id-metadata-document-02.txt↩
  5. 5modelcontextprotocol.io · MCP client registrationspecification/2026-07-28/basic/authorization/client-registration↩
  6. 6rfc-editor.org · RFC 7591, Dynamic Client Registrationrfc/rfc7591.txt↩
  7. 7rfc-editor.org · RFC 8628, Device Authorization Grantrfc/rfc8628.txt↩
  8. 8ietf.org · OAuth 2.1archive/id/draft-ietf-oauth-v2-1-16.txt↩

Asked about this guide.

Do we need both CIMD and DCR?

For now, yes. New clients use CIMD when your metadata says you support it; older ones still register.

Can an agent finish OAuth without any person?

Only if it already has an account and a key. Let it sign up and get a key by API, then accept that key on your MCP endpoint.

Cite this

AgentDrives. “MCP sign-in an AI agent can finish: OAuth and CIMD.” 24 October 2026. agentdrives.com/guides/mcp-sign-in-agents-can-finish

Drive data is CC BY 4.0. The text as Markdown. Every fact with its evidence.

More from the drives.