Skip to content
Index / Guides / MCP & ChatGPT apps / MCP server authentication: an OAuth 2.1 guide for SaaS teams

MCP & ChatGPT apps guide

MCP server authentication: an OAuth 2.1 guide for SaaS teams

Updated 2026-10-26

Short answer: A remote MCP server is an OAuth resource server. It advertises its authorization server via protected resource metadata, returns 401 with a WWW-Authenticate header, and validates access tokens issued for it. The client handles the PKCE flow.

The flow

Protected resource metadata

GET /.well-known/oauth-protected-resource
{
  "resource": "https://mcp.acme.com/mcp",
  "authorization_servers": ["https://auth.acme.com"],
  "scopes_supported": ["invoices:read", "invoices:write"]
}

# Unauthenticated request to /mcp returns:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://mcp.acme.com/.well-known/oauth-protected-resource"

Practical choices

For a pilot

Use stdio and an API key in an env variable. It is fine for a developer audience and lets you validate tools before investing in OAuth.

Agencies in our index that mention MCP work

Listed in their normal directory order. Our own build service is not part of this list or the rankings.

Questions

Do I need dynamic client registration?

Clients need some way to register. Depending on the spec version, that is a client ID metadata document, dynamic client registration, or a pre-registered client. Check what your target clients support.

Can I use API keys for a remote server?

Technically yes, but users then paste secrets into an AI client. OAuth is the expected pattern for multi-user remote servers.

What is the most common bug?

Not checking the token audience, which lets tokens issued for another service work on yours.

More MCP guides

Cost and effort figures on this page are rough estimates, not quotes.

CompareOpen shortlist