A practical guide to MCP servers and integrations for marketing, design, and content workflows.
MCP SetupLong read

MCP Server Authentication Patterns OAuth vs API Keys

OAuth provides expiry, scopes, and revocation; static keys do not.

· 8 min read
Cover illustration for “MCP Server Authentication Patterns OAuth vs API Keys”
MCP Setup · November 4, 2026 · 8 min read · 1,830 words

MCP server authentication is a deployment decision. The specification draws the first boundary at transport. Local STDIO servers can use environment credentials, while shared remote HTTP servers need the identity, delegation, and access controls that OAuth provides. The practical skill is recognizing which deployment is in front of you and applying the controls that follow.

Why MCP authentication is not a single decision

The MCP specification standardizes communication between LLM applications and external tools through a client-server architecture over JSON-RPC 2.0. Authentication protects that interface, but its requirements depend on how the client reaches the server.

The specification says STDIO implementations SHOULD NOT follow its authorization specification and should retrieve credentials from the environment. HTTP-based implementations SHOULD conform to it, while authorization servers MUST implement OAuth 2.1. HTTP conformance is a SHOULD, but departing from it leaves concrete authorization problems to solve. The structural split is between a local subprocess and a service that accepts requests across a network.

What the STDIO carve-out actually means in practice

A STDIO server runs as a child process of its client on the same machine. The processes remain separate, with isolation provided by the operating system, and the server exposes no network port. That is a distinct security boundary from HTTP. Reading an API key or token from an environment variable is therefore the specification’s intended pattern. A config file is another standard way to supply that local credential.

The reasonable static-key case has a narrow shape. It serves one user and one agent, involves no agent-to-agent handoffs or regulated data, and is not reachable from the internet. Under those conditions, OAuth adds network round-trips, browser redirects, and work for discovery without making the server more secure. The credential belongs to that local workflow. A second agent or shared deployment changes what authorization needs to do, even if some communication still uses STDIO, because the conditions that allow the local exception no longer hold.

The four things a static API key cannot do once a server goes remote

Once a server is shared, remote, multi-agent, or handling regulated data, a static key exposes four functional gaps. The first is expiry. A leaked key still works until someone notices and rotates it, while a short-lived OAuth access token expires on a timer.

The second gap is task-specific authority. If an issue-reading agent and a repository-deleting agent share one key, the credential does not distinguish their jobs. OAuth scopes let the reader receive only read access. The third gap is caller identity. A shared key does not tell the server which user sent a request, so it lacks the identity it needs for row-level security, per-user rate limits, and tenant isolation.

The fourth gap appears during recovery from credential changes. Revoking a static key leaves the agent without a replacement mechanism built into the credential itself. OAuth clients can refresh tokens automatically, while refresh-token replay can become a detectable signal. The local case avoids many of these demands because its user, agent, and execution boundary are already constrained.

What the spec requires of a remote MCP server under OAuth 2.1

The specification defines a remote MCP server as an OAuth 2.1 resource server. The authorization server has a separate role. When developers confuse the two, they combine jobs that the protocol expects them to keep separate. Correct implementation begins with that separation, then applies the discovery and token-binding requirements.

Protected Resource Metadata under RFC 9728 tells clients which authorization server to use, and the resource server MUST publish it. Authorization Server Metadata under RFC 8414 or OpenID Connect Discovery must also be supported. Resource Indicators under RFC 8707 use the resource parameter to bind authorization to a specific resource, a MUST-level control against confused-deputy attacks. Issuer Identification under RFC 9207 supplies the issuer check that defends against authorization-server mix-up attacks.

The 2026-07-28 revision tightened the rules for governance while keeping the same bar for compliance. It added issuer validation, bound client credentials to the authorization server that issued them, and formally deprecated Dynamic Client Registration in favor of Client ID Metadata Documents. Discovery remains central to the client experience. The client fetches metadata from a well-known URL, learns where to send the user, completes a PKCE-protected consent flow, and receives a short-lived access token with automatic refresh. For the user, the sequence becomes “add URL, sign in once.”

The token passthrough trap and the confused deputy problem

An MCP server that receives a client token and forwards it unchanged to another API commits token passthrough. The specification explicitly prohibits this implementation choice. Passthrough breaks the audit trail, bypasses the server’s own authorization checks, and can turn it into a proxy for a stolen token.

When the server calls another API, it instead acts as that API’s OAuth client with a separate token. The distinction becomes especially important in multi-agent workflows, where several services act on a user’s behalf. A confused deputy uses its authority to make requests beyond what the original user intended. Audience and scope restrictions constrain that authority, so a token issued for one server is not accepted as authorization by another. RFC 8707 provides the resource-binding mechanism.

This is an implementation warning.

How real deployments navigate the dual-path pattern

Stripe supports OAuth for interactive MCP clients and agent API keys for autonomous clients, and it lists the API methods agents can reach. Its policy makes the distinction enforceable. With a migration deadline of 30 November 2026, Stripe’s December 2026 policy stops accepting full-access secret keys and restricted keys without the Agent tag.

Linear uses Streamable HTTP as its main transport. Its documented interactive setup uses OAuth 2.1 with dynamic client registration, while headless clients can authenticate with a bearer token or Linear API key. A separate read-only endpoint exposes only read tools, and clients can request the read OAuth scope so the underlying token cannot reach write APIs. Its documented registration flow also shows why the way a provider handles registration must be kept separate from the specification’s newer guidance.

Figma introduced native MCP server integration in June 2025, connecting its tools to agents and code editors including VS Code with GitHub Copilot and Cursor. Stripe and Linear provide the clearer dual-path examples. Their authentication choices depend on client type, while credential restrictions and tool exposure determine what each client can do.

Enterprise-Managed Authorization and the org-scale deployment shift

OAuth’s strongest operational objection is the work required to deploy it. Authorization-server discovery, client registration, and per-server consent screens add work for the engineers who build internal tooling. That cost is real for smaller deployments. When setup must be repeated across dozens of MCP servers, that work can grow from a small task into what stops an organization from adopting MCP.

Enterprise-Managed Authorization, or EMA, lets the organization handle authorization so consent need not be repeated for each server. With the ID-JAG grant, it gives enterprises a way to deploy across many servers. The registration changes in the same revision reduce another source of overhead.

For service-to-service communication where the team controls both backends, a pre-shared bearer token rotated through a secrets manager can still be simpler than full OAuth discovery and just as secure if it is managed well. That is a bounded exception. A service described as “internal” qualifies for this exception only when the team controls both sides.

Scope discipline and the OAuth mistake that recreates the API key problem

An OAuth deployment can be correct at the protocol level and still grant excessive authority. An agent with mcp:* instead of mcp:read has the same permission blast radius as a full-access API key. Expiry does not correct excessive permission breadth. An agent that only reads files should receive only mcp:read, with mcp:write and mcp:execute excluded, and tools should enforce those scopes in their handlers as well as in middleware.

Linear’s read-only endpoint limits exposed tools, while its read scope constrains the underlying token. Stripe’s Agent-tag requirement places a restriction at credential issuance and acceptance. Neither control depends only on what a client claims it intends to do. Authorization should also be checked on each tool invocation against the agent’s current permissions, which may vary with user identity, context, and session state.

Local keys still need care in how they are handled and stored. The recommended discipline includes prefixes such as sk_prod_ and sk_dev_ for leak detection, scheduled rotation, and hashing keys at rest rather than retaining plaintext in credential-verification stores.

A decision framework for matching patterns to deployments

The decision begins with four questions in order. Is the transport STDIO or HTTP, is the deployment single-user or multi-user, is it internal or externally reachable, and does it act for individual users or run autonomously? Each answer narrows the applicable pattern.

If the server is local STDIO, single-user, and internal, environment credentials are the appropriate starting point, with a .env file or OS keychain supplying the key or token. Process isolation sets the local boundary without the extra work of network authorization. Scope and rotation discipline still apply. This path still depends on the single-agent conditions described earlier.

If the server uses HTTP for controlled internal service-to-service communication, either a pre-shared bearer token rotated through a secrets manager or an OAuth 2.1 client credentials flow can fit. Rotation helps with some of the static-key gaps, while full discovery may add work that is not needed. The exception has a clear exit condition. A second team, a second agent, or regulated data calls for OAuth.

If the HTTP server is multi-tenant or acts for individual users, OAuth 2.1 supplies the identity-aware authorization the service needs. Interactive clients use authorization code flow with PKCE and browser consent, together with resource metadata, audience binding, short-lived tokens, and refresh. Autonomous clients instead use machine-to-machine client credentials or explicitly supported scoped and tagged keys.

If the deployment spans many organizational servers, OAuth with EMA and the ID-JAG grant addresses repeated consent overhead. Multi-agent service-to-service connections add another security consideration. The Cloud Security Alliance’s Agentic MCP Security Best Practices Guide recommends mutual authentication through client certificates or signed JWTs. That recommendation is distinct from the specification’s standardized client credentials flow. Audience binding is still needed, and servers must never forward the client tokens they receive downstream.

How shared brand context fits into the auth decision

Authentication governs which agents can receive shared context, including brand identity. A local agent can read that context using environment-scoped credentials, but the same arrangement does not provide independent access control for a shared deployment. Distribution changes the security requirements. A remote MCP server serving Claude, ChatGPT, Cursor, Codex, and other MCP-compatible clients needs OAuth 2.1 so each agent’s access can be scoped, revoked, and audited independently.

Every connected agent should receive the new version, but versioned propagation depends on correctly identifying which agents are authorized to receive it. Treating brand context as infrastructure therefore leads to the same deployment-specific choice as other MCP tools, with environment credentials for local use, OAuth for shared remote access, and the enterprise extension for organization-wide deployment.

Sources

  1. Agentic MCP Security Best Practices Guide
Filed underMCP Setup

More in MCP Setup