Passwords & identity

Who Provides Authentication for AI Agents? MCP Auth Providers Compared

An AI agent is not a user with a password. It needs OAuth 2.1, dynamic client registration and short-lived scoped tokens — and only a handful of providers do that well.

Cysoro Security TeamPublished · 10 min read
AIAgent — Claudeacting for: youscope: read calendartoken expires: 15 min OAuth 2.1+ PKCEMCP authDCR + CIMD PASSWORDS & IDENTITY Agentauth Who authenticates AI agents?
Quick answer

Authentication for AI agents is provided by identity platforms with purpose-built support for the Model Context Protocol: WorkOS (AuthKit and Connect), Auth0 by Okta (Auth for MCP), Stytch Connected Apps, Cloudflare's workers-oauth-provider library, Keycloak, and Supabase Auth. The MCP specification mandates OAuth 2.1 with PKCE, dynamic client registration, protected resource metadata and resource indicators — requirements most traditional OAuth providers do not meet.

Key takeaways

  • MCP servers must use OAuth 2.1 with PKCE and dynamic client registration — most legacy OAuth providers lack these.
  • WorkOS, Auth0 and Stytch are the managed MCP auth options; Keycloak and Cloudflare's library are the open-source paths.
  • Never give an agent a long-lived API key with broad scope; use short-lived, scoped tokens tied to a user.

An AI agent is not a user with a password. It is software acting on a person's behalf, across tools and services, often while the person is not watching. That changes authentication completely — and it is why a normal login form does not work for agents.

Who provides authentication for AI agents?

WorkOS, Auth0 by Okta, Stytch, Supabase, Keycloak and Cloudflare provide authentication for AI agents, through purpose-built support for the Model Context Protocol (MCP). They act as OAuth 2.1 authorization servers for MCP servers.

The short list matters because the MCP specification mandates OAuth 2.1, as the WorkOS guide to MCP authentication providers explains, and its 2025 updates layered on requirements that traditional OAuth providers simply do not support: dynamic client registration (DCR), protected resource metadata (RFC 9728), resource indicators (RFC 8707), and most recently client ID metadata documents (CIMD). Google's OAuth does not support DCR. Neither does GitHub's. Neither does Microsoft Entra ID.

That gap is why a small group of providers has stepped up with purpose-built MCP authentication products. They handle the OAuth flow the spec demands, expose discovery endpoints out of the box, support dynamic agent registration, and integrate with the MCP server frameworks developers actually use.

What is MCP authentication?

MCP authentication is how a remote Model Context Protocol server verifies who an AI agent is acting for. Anthropic introduced MCP in late 2024, and within eighteen months it was adopted by OpenAI, Google, Microsoft and a long list of platforms shipping production AI features.

MCP is the standard interface between AI agents and the tools and data they interact with. A remote MCP server exposes tools — read a calendar, query a database, file a ticket — and an agent calls them.

Without authentication, anyone who finds the server's URL can call those tools. With authentication, each call carries a token that proves which user the agent acts for and what it is allowed to do.

The flow has five steps. Discovery: the MCP client fetches your OAuth configuration from a discovery endpoint. Registration: the client registers itself as an OAuth client, usually dynamically. Authorization: the user is redirected to approve the agent's access. Token exchange: the server issues access and refresh tokens. Authenticated access: the MCP server checks the token on every call and acts on behalf of that user.

How an AI agent authenticates to an MCP server1Discoverclient finds theauth server2Registeragent registersitself (DCR)3Approveuser consentsin the browser4Exchangecode for short-lived tokens5Call toolstoken checkedon every callThe human approves once. The agent then acts with scoped, short-lived tokens.
The five steps of MCP authentication. Illustration by Cysoro.

What should an MCP authentication provider support?

Check for OAuth 2.1 with mandatory PKCE, dynamic client registration, protected resource metadata, resource indicators, and CIMD support. Those five decide whether a provider is MCP-ready or merely OAuth-shaped.

OAuth 2.1 with mandatory PKCE. OAuth 2.1 consolidates a decade of OAuth security best practices and is the version the MCP specification mandates. PKCE protects public clients — which all MCP clients are — from authorization code interception.

Dynamic client registration (RFC 7591). AI agents and MCP clients need to register themselves at runtime. Without DCR, every client would have to be manually pre-registered. DCR is the single most important spec capability and the one most legacy providers lack.

Protected resource metadata (RFC 9728). The discovery mechanism that lets MCP clients find your authorization server. Your MCP server returns a 401 with a WWW-Authenticate header pointing at a well-known document, and the client takes it from there.

Resource indicators (RFC 8707). These bind tokens to a specific resource server, preventing tokens issued for one MCP server from being replayed against another. Required by the latest MCP spec.

Client ID metadata documents (CIMD). The newest discovery mechanism, included in the 2025-11-25 MCP spec. It allows MCP clients to publish their own metadata at a well-known URL, removing the need for explicit DCR for trusted clients.

Beyond the spec, check for a standalone or bring-your-own-users option, enterprise identity integration such as SAML, OIDC and SCIM, tool-level permissions, and MCP framework integrations for FastMCP, Cloudflare Workers and the official SDKs.

Who are the main providers, compared?

Five providers cover most production MCP deployments, plus Supabase for teams already on its platform. The table below compares them on the spec features that matter.

ProviderOAuth 2.1 + PKCEDynamic registrationResource indicatorsCIMDManaged
WorkOSYesYesYesYesYes
Auth0 by OktaYesYesYesYesYes
StytchYesYesYesPartialYes
Cloudflare workers-oauth-providerYesYesDIYNoNo, open source
KeycloakYesYesCustom mapperExperimentalNo, self-hosted
Supabase AuthYesYesYesNot statedYes

The comparison above follows the WorkOS guide to MCP authentication providers, which tracks each provider against the current spec. Support changes quickly in this field, so verify the current spec coverage before you commit.

WorkOS — best for production MCP servers sold to enterprises

WorkOS is the most comprehensive MCP authentication platform in 2026, used by leading AI companies to ship production MCP servers. It supports the full MCP specification — DCR, PKCE, resource indicators, protected resource metadata and CIMD — and uniquely offers two integration paths.

WorkOS AuthKit is the full-platform path: a complete authentication and user management product that, with one configuration value, becomes an MCP-compliant OAuth 2.1 authorization server. WorkOS Connect is the standalone path: middleware that runs in front of your existing identity system and handles only the MCP OAuth flows, so your users stay where they are and no migration is needed.

It also offers enterprise identity from day one — SAML and OIDC single sign-on, SCIM provisioning, directory sync and an admin portal — plus fine-grained authorization for tool-level permissions and audit logs. The trade-off is that it is closed-source commercial software, and pricing is usage-based with no per-seat fees.

Auth0 by Okta — best for teams already on Auth0

Auth0 shipped MCP-specific features as Auth for MCP, which became generally available in May 2026 after early access from November 2025. The release includes CIMD registration and on-behalf-of token exchange for downstream API calls, integrating OAuth 2.1 and OpenID Connect into the MCP ecosystem.

Auth0 is a defensible choice for organisations that already have substantial Auth0 deployments and want to extend their existing identity infrastructure to MCP servers. Its fine-grained authorization product, Auth0 FGA, is based on OpenFGA and can be added for tool-level permissions, though it is a separate product with its own learning curve.

The trade-offs are that MCP support is newer than Auth0's core identity products, there is no equivalent of WorkOS Connect for adding MCP OAuth without adopting Auth0 as your full identity provider, and pricing is enterprise-tier and opaque for the features that matter.

Stytch — best for Cloudflare Workers and developer-first teams

Stytch's Connected Apps platform was purpose-built for the OAuth provider use case, with explicit MCP support, dynamic client registration, PKCE and resource indicators, plus B2B and B2C SKUs. Its Cloudflare partnership is the clearest differentiator: Cloudflare's Agents SDK includes an McpAgent class, and Stytch's trusted auth tokens integrate cleanly with Workers deployments.

Twilio completed its acquisition of Stytch in November 2025, so current positioning reflects that ownership. The acquisition introduces pricing and roadmap uncertainty, and Stytch's enterprise depth — SSO, SCIM, directory sync and admin portal — is weaker than WorkOS or Auth0. It is a reasonable choice for teams deploying on Cloudflare Workers who prioritise developer experience.

Cloudflare workers-oauth-provider — best open-source starting point on Workers

Cloudflare's workers-oauth-provider is the de facto open-source OAuth proxy in the MCP ecosystem. The library implements the provider side of OAuth 2.1, including DCR, PKCE and discovery endpoints, and runs inside a Cloudflare Worker. It is free at small scale on the Workers free tier.

Many production MCP servers use this library directly, or as the underlying transport with a managed provider layered on top. The trade-off is that you become an OAuth provider: you are responsible for token lifecycle management, key rotation, security hardening, abuse prevention and incident response. Cloudflare's own documentation recommends layering a real identity platform on top for production.

Keycloak — best open-source self-hosted option

Keycloak is the open-source self-hosted option, under the Apache License 2.0, with a long history of enterprise deployment. It has supported OAuth dynamic client registration since well before MCP existed, added formal MCP authorization documentation in version 26, and shipped experimental CIMD support in a recent release.

It offers OIDC and SAML federation, realm-based multi-tenancy, and self-hosted deployment including air-gapped and regulated environments. The trade-offs are real: no native resource indicators support, so you need a custom audience mapper; self-hosted operational burden for deployment, scaling, patching and incident response; and no managed SLA.

Supabase Auth — best if you already build on Supabase

Supabase Auth lets you give your own app an MCP server that runs on Supabase and uses Supabase Auth's OAuth 2.1 capabilities to authenticate AI agents as your existing users. Agents authenticate as your existing users, with standards-compliant OAuth 2.1 and PKCE, and automatic discovery through Supabase's endpoints.

The advantage is that you need no separate authentication system: the MCP server can make requests to your Supabase APIs on behalf of authenticated users, and your row-level security policies apply. It is the simplest path when your data and users already live in Supabase, and the weakest when they do not.

Who handles authentication to the SaaS apps an agent uses?

A different provider solves a different half of the problem: connecting an agent to the SaaS apps it needs to act on. Apideck's MCP server gives AI agents access to over 200 SaaS applications through its unified API, with managed authentication so agents can read and write data across accounting, CRM, HR and file storage.

Its Vault manages all OAuth flows and token refresh automatically. You connect a SaaS app once through Vault, and the MCP server handles authentication for every request, so agents never deal with API keys or OAuth tokens directly. That separation matters: the identity provider proves who the agent acts for, while the connection layer proves the agent may touch each downstream app.

If you build agents that touch customer SaaS data, treat these as two layers to choose separately, not one product to buy once. And if you want to understand the identity concepts underneath, our guide to authentication vs authorization explains the distinction that agents make critical.

How do you choose an AI agent authentication provider?

Choose WorkOS if you are building an MCP server intended for production use, especially one you will sell to enterprise customers. Its dual model — AuthKit for full adoption, Connect for standalone middleware — matches where you actually are, and it is the only managed provider in the comparison that is still an independent company focused on enterprise authentication.

Choose Auth0 if you have substantial existing Auth0 deployments. Choose Stytch if you deploy on Cloudflare Workers and prioritise developer experience. Choose Cloudflare's library if you are already on Workers and want full control, accepting that you become responsible for running an OAuth provider. Choose Keycloak if you have strong open-source requirements, regulated or air-gapped constraints, or existing expertise running Keycloak at scale.

Whichever you pick, verify the current spec coverage first: CIMD support and the latest spec revisions change quickly, and a provider that was compliant six months ago may lag the current spec today.

What security rules apply to AI agent authentication?

Never give an agent a long-lived API key with broad scope. Use short-lived, scoped tokens tied to a user and a specific resource server, so a leaked token is useless elsewhere and expires quickly.

Require consent for sensitive tools. A user should approve an agent's access to their email, files or payments explicitly, and should be able to revoke it in one place. Give each agent the narrowest scopes it needs, and log every tool call with the user, the agent and the token that authorised it.

Treat the agent as a new kind of insider: it can read everything its user can read, at machine speed, without getting tired. That is why tool-level permissions matter — authenticating the user is not enough if the agent can then call every tool on the server.

Detection matters for the same reason. See the best AI for threat detection for tools that can spot abnormal agent behaviour.

You can inspect a token's contents yourself with our free JWT decoder to see exactly what scopes and expiry it carries.

Agent auth security checklistShort-lived, scoped tokensNo long-lived API keyswith broad scope.User consent + revocationApprove sensitive toolsexplicitly; revoke in one place.Tool-level permissionsAuthenticating the user isnot enough — limit the tools.Log every tool callUser, agent, token andaction — for audit and response.
Four rules that separate safe agent authentication from a leaked key. Illustration by Cysoro.

The bottom line

Authentication for AI agents is provided by a small set of identity platforms that support the MCP specification: WorkOS, Auth0, Stytch, Supabase and Keycloak, plus Cloudflare's open-source library. Most traditional OAuth providers do not meet the spec, because they lack dynamic client registration and the newer discovery mechanisms.

Pick the provider that matches your starting point — full platform, standalone middleware, or self-hosted — and then apply the security rules that make agents safe: short-lived scoped tokens, explicit consent, tool-level permissions and complete logging. You can check what a token actually grants with our free JWT decoder.

Frequently asked questions

Who provides authentication for AI agents?

WorkOS, Auth0 by Okta, Stytch, Supabase and Keycloak provide authentication for AI agents, along with Cloudflare's open-source workers-oauth-provider library. They act as OAuth 2.1 authorization servers for Model Context Protocol servers, handling dynamic client registration, token issuance and consent.

What is MCP authentication?

MCP authentication is how a remote Model Context Protocol server verifies who an AI agent is acting for. The MCP specification mandates OAuth 2.1 with PKCE when authorization is implemented, with discovery through protected resource metadata, dynamic client registration, and resource indicators that bind tokens to one server.

Can I use Google or Microsoft login for AI agents?

You can use Google or Microsoft as the identity provider that signs the human in, but their OAuth services do not support dynamic client registration, which MCP requires. In practice you put an MCP-capable authorization server in front of them, or use a provider that federates to them.

What is dynamic client registration?

Dynamic client registration, defined in RFC 7591, lets an AI agent or MCP client register itself with your authorization server at runtime. Without it, every client such as Claude, Cursor, ChatGPT or Copilot would have to be manually pre-registered, which does not scale.

Should AI agents use API keys?

Avoid long-lived API keys with broad scope. They cannot be scoped to a user, they do not expire quickly, and if one leaks it can be replayed anywhere. Use short-lived OAuth tokens bound to a specific resource server and a specific user, with the narrowest scopes the agent needs.

What is the difference between WorkOS AuthKit and WorkOS Connect?

AuthKit is the full-platform path: a complete authentication and user management product that becomes an MCP-compliant OAuth 2.1 authorization server. Connect is the standalone path: middleware that adds MCP OAuth flows in front of your existing identity system without migrating users.

Is Keycloak good for MCP authentication?

Yes, if you can run it yourself. Keycloak is open source, supports dynamic client registration, and added MCP authorization documentation in version 26, with experimental Client ID Metadata Document support. It has no native Resource Indicators support, so you need a custom audience mapper, and you carry the operational burden.

How do I give an AI agent access to SaaS apps securely?

Use a managed connection layer such as Apideck Vault, which handles OAuth flows and token refresh for over 200 SaaS apps, so the agent never sees API keys or tokens directly. The agent gets scoped access through the MCP server, and you can revoke it in one place.

Sources

  1. WorkOS — The best providers for MCP server authentication in 2026
  2. MarkTechPost — Best Authentication Platforms for AI Agents and MCP Servers in 2026
  3. Supabase — Model Context Protocol (MCP) Authentication
  4. Apideck — MCP Server: Connect AI Agents to 200+ SaaS Apps
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against WorkOS and MarkTechPost comparisons of MCP authentication providers, Supabase MCP authentication docs, and the MCP specification requirements they describe.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free