# MCP sign-in an AI agent can finish: OAuth and CIMD

76 of 124 products with an MCP server stopped our agent at the door. Make MCP sign-in an agent can finish: OAuth metadata, CIMD or DCR, device flow.

Source: https://agentdrives.com/fixes/mcp-sign-in-agents-can-finish · Updated 2026-10-12 · Wall: MCP sign-in

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 140 products, 1–16 Oct 2026 (https://agentdrives.com/data/facts?via=md):

- Products with an MCP server our agent couldn't get into on its own: 76 of 124
- Products with an MCP server it got into on its own: 48 of 124

## What agents hit

124 of 140 products have an MCP server. At 76 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 our drives gave owners, in their words:

- [ActiveCampaign](https://agentdrives.com/tools/activecampaign?via=md): Add OAuth with PRM to the MCP server.
- [AgentMail](https://agentdrives.com/tools/agentmail?via=md): Give DCR clients the device grant.
- [Akiflow](https://agentdrives.com/tools/akiflow?via=md): Support CIMD and pre-auth server/discover.
- [Amplitude](https://agentdrives.com/tools/amplitude?via=md): Support MCP (the 28 Jul 2026 spec) and CIMD.

## The fix, step by step

1. **Publish Protected Resource Metadata.** The MCP spec requires it. [1] Serve it at `/.well-known/oauth-protected-resource` [2] 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-server` [3], 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 endpoint [6]) 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.

## After the fix

Fixed something? Order a Drive ($49) any time, or the Monthly drive ($29/month).

## Questions

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

## Sources

1. [MCP authorization](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization)
2. [RFC 9728, Protected Resource Metadata](https://www.rfc-editor.org/rfc/rfc9728.txt)
3. [RFC 8414, Authorization Server Metadata](https://www.rfc-editor.org/rfc/rfc8414.txt)
4. [Client ID Metadata Document](https://www.ietf.org/archive/id/draft-ietf-oauth-client-id-metadata-document-02.txt)
5. [MCP client registration](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration)
6. [RFC 7591, Dynamic Client Registration](https://www.rfc-editor.org/rfc/rfc7591.txt)
7. [RFC 8628, Device Authorization Grant](https://www.rfc-editor.org/rfc/rfc8628.txt)
8. [OAuth 2.1](https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-16.txt)

## More fixes

- [Let signed AI agents past your bot check](https://agentdrives.com/fixes/let-signed-agents-past-your-bot-check.md): The setting for Cloudflare, Vercel, Akamai, DataDome and HUMAN, and what to do about a check on the form.
- [Let AI agents sign up and get an API key](https://agentdrives.com/fixes/let-agents-sign-up-and-get-a-key.md): An API call that signs up and returns a limited key, and a claim step for the person.
- [Let AI agents start without a credit card](https://agentdrives.com/fixes/card-free-starts.md): A free plan or a trial without a card, an API key that works on it, and limits instead of a card.
- [Let AI agents pay you per call: x402 and MPP](https://agentdrives.com/fixes/let-agents-pay-per-call.md): x402 or MPP on a paid endpoint, your prices where agents read them, and plans an agent can buy by API or MCP.
- [Docs AI agents can read: llms.txt, Markdown, OpenAPI](https://agentdrives.com/fixes/docs-agents-can-read.md): An llms.txt, Markdown twins of your pages, an OpenAPI spec and an MCP server card.
