Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Short answer: MCP does not require authentication for every deployment. Its defined authorization flow applies to HTTP-based transports that protect a remote server. A local STDIO server should obtain credentials from the environment instead of running the HTTP OAuth flow. For a protected HTTP server, implement OAuth discovery, authorization-code exchange, bearer-token requests, and strict validation that each token was issued for your MCP server.

Authentication and authorization are different

Authentication establishes who a caller is. Authorization decides what that identity may access. MCP’s specification section is titled Authorization because it defines how a client obtains permission to call a protected server; it does not make login mandatory.

The 2026-07-28 MCP specification states that authorization is optional. You can run an open server, protect every request, or expose public tools and challenge only sensitive tools. The correct design depends on the transport, deployment boundary, and sensitivity of the tools.

Choose the transport before choosing an auth flow

Deployment MCP guidance Credential approach
HTTP-based remote server Use the MCP authorization specification when the server is protected. OAuth resource-server flow with discovery, consent, code exchange, bearer tokens, and server-side validation.
STDIO or local process Do not copy the HTTP OAuth flow into STDIO. Read credentials from the process environment and apply the local program’s permission model.
Another transport Use established security practices for that protocol. Follow that protocol’s credential and channel-binding guidance.

For STDIO, keep secrets out of command-line arguments, source files, and checked-in configuration. Inject them through the environment supplied by the launcher, operating-system service, container, or secret manager. Restrict process and file permissions so another local user cannot read the values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the protected HTTP OAuth flow works

A protected MCP server is an OAuth resource server. The MCP client is the OAuth client acting for a resource owner, usually a user. An authorization server authenticates the user, obtains consent when required, and issues tokens. MCP does not prescribe how an authorization server stores users or implements its login screens.

  1. Initial request: The client requests an MCP resource or tool from the HTTP server without a usable access token.
  2. Authorization challenge: The server returns HTTP 401 and an authorization challenge indicating that access is required. The response should identify the protected resource metadata location when supported.
  3. Metadata discovery: The client obtains Protected Resource Metadata, commonly exposed at /.well-known/oauth-protected-resource, and then discovers the authorization server. Authorization-server metadata is commonly exposed at /.well-known/oauth-authorization-server.
  4. Consent and redirect: The client sends the user to the authorization server. The user authenticates, reviews consent, and is redirected to the registered client redirect URI with an authorization code.
  5. Code exchange: The client sends the code, redirect URI, and its client authentication or proof to the token endpoint. It receives an access token and, when configured, a refresh token.
  6. Bearer request: The client retries the MCP request with an Authorization: Bearer … header.
  7. Resource-server decision: The MCP server verifies the token for its own resource, checks permissions, and only then invokes the requested tool.

Do not treat the redirect or token endpoint as proof that a request is authorized. The MCP server remains responsible for validating every protected request and enforcing its own tool permissions.

Pick an authorization boundary

Per-server authorization

Require a valid bearer token before accepting any MCP request. This is the simpler policy when every tool exposes sensitive data or actions. Public metadata and health endpoints can remain separate from the protected MCP endpoint.

Per-tool authorization

Allow public tools to execute without OAuth and challenge only calls that target protected tools. This reduces friction for mixed servers, but your dispatcher must make the decision before executing a tool. A client must receive HTTP 401 for a protected call, complete discovery and OAuth, then retry that call.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Document the boundary explicitly. A tool that looks harmless may still reveal tenant data, trigger an external side effect, or be usable as a stepping stone to a privileged operation.

Validate tokens at the MCP server

The most important security rule is audience validation. MCP security guidance says: “MCP servers MUST NOT accept any tokens that were not explicitly issued for the MCP server.” A token that is validly signed can still be wrong for your resource.

Rank #2
Sale
Thetis Nano-A FIDO2 Security Key Hardware Passkey Device with USB Type A, TOTP/HOTP, FIDO2.0 Two Factor Authentication 2FA MFA, Works with Windows/mac/iOS/Android/Linux/Gmail/Facebook/GitHub/Coinbase
  • Ultra-Compact FIDO2 Security Key - Plug-and-stay or carry on a keychain. This USB-A hardware security key offers portable, always-on protection for desktop and mobile use. (Item Size: 0.75 X 0.74 IN x 0.25 IN)
  • USB-A Hardware Key for All Devices - Works with USB-A ports on PC, Mac, Android, and other laptop/notebook device. Enables secure, cross-platform login with FIDO2.0 passkey support.
  • FIDO Certified Security Key - Meets FIDO and FIDO2 standards. Works with Google, Microsoft, GitHub, Dropbox, and more. Please check service compatibility before purchase.
  • Passwordless Login with Passkey - Supports passkey login via WebAuthn and CTAP2. Enjoy password-free sign-ins where supported. Not all websites or services currently support passkeys.
  • Advanced Multi-Factor Authentication - Offers 200 FIDO2 passkey slots and 50 OATH-TOTP slots. Strong, flexible 2FA/MFA support across various apps and authentication platforms.

Checks to perform

  • Signature: Verify the signature using a trusted key set or introspection response. Decoding a JWT is not validation.
  • Issuer: Require the expected issuer and reject tokens from an untrusted authorization server.
  • Audience or resource: Confirm that the token names this MCP server as its intended resource. Use the exact audience convention defined by your authorization server.
  • Time: Enforce expiration and, where supplied, not-before and issued-at constraints with a small, explicit clock-skew allowance.
  • Scopes and claims: Map scopes, roles, tenant identifiers, and other claims to the requested MCP operation.
  • Token type and transport: Accept the authorization scheme and token format your deployment specifies; never log bearer values.

Do not use token passthrough

Token passthrough means accepting a client token without verifying that it was issued to the MCP server and forwarding it to a downstream API. This creates a confused trust boundary: a token intended for another service may be accepted by your server and replayed elsewhere.

When a tool calls a downstream API, obtain a credential for that API or implement a deliberate delegated-authorization exchange. Do not forward the MCP access token merely because it is a bearer token. If the downstream service requires a separate audience, the MCP server must acquire or receive a token for that audience under an approved design.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Discovery, redirects, and proxy defenses

Validate metadata destinations

A client may follow URLs supplied through protected-resource or authorization-server metadata. Treat those URLs as untrusted input. Apply an allowlist or equivalent policy, validate DNS and redirect behavior, and prevent requests to private, link-local, loopback, and cloud-metadata address ranges where your architecture does not require them. This is an SSRF control, not an optional optimization.

Design proxies against confused deputies

A proxy that represents multiple MCP clients can become a confused deputy when it combines a static OAuth client ID, dynamic registration, consent cookies, and no per-client consent record. Bind authorization state to the initiating client and redirect transaction. Keep consent records distinct so one client cannot cause another client’s authorization to be reused.

Protect client identity

Consent screens are only useful when the user can identify the client. A malicious application that claims to be a familiar desktop client can persuade a user to approve access under a false identity. Use trustworthy client metadata, exact redirect-URI matching, PKCE where required by your OAuth profile, and a registration process that distinguishes installed applications from web clients.

What changed in the 2026-07-28 specification

The MCP maintainers released the 2026-07-28 specification on July 28, 2026. Its authorization changes affect both clients and servers:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
FIDO2 U2F Security Key Passkey Two-Factor Authentication (2FA) USB Key PIN+Touch (Non-Biometric) USB-A Type TrustKey T110
  • Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
  • Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
  • Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
  • Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
  • For the driver download and user guide, please visit TrustKey Solutions Home support page.
Area Current direction Implementation implication
Authorization response Responses use the iss parameter. The client must validate the issuer before redeeming an authorization code.
Client registration Client registrations identify application type. Desktop and CLI localhost redirects can be handled without treating every client as a web application.
Client credentials Credentials are bound to the issuer that minted them. Do not reuse a credential with a different issuer or silently accept issuer substitution.
Dynamic Client Registration DCR is deprecated in favor of Client ID Metadata Documents (CIMD), while remaining for backward compatibility. Plan a CIMD-capable path, but verify what each authorization server and SDK actually supports.

This is a broader protocol revision, not only an OAuth patch. It introduces a stateless protocol core, routable HTTP headers, a formal extensions framework, and a deprecation policy. The release also retires the initialize/initialized exchange and the Mcp-Session-Id header; protocol version, client identity, and capabilities move into _meta. Pin your implementation to a named specification and SDK version, then test the client, authorization server, and resource server as one compatibility set.

Enterprise-Managed Authorization

For centrally governed environments, Enterprise-Managed Authorization became a stable MCP extension on June 18, 2026. It lets an organization apply identity-provider policy based on group membership, role, and conditional access instead of collecting separate user consent at every server.

The documented flow uses an Identity Assertion JWT Authorization Grant. An identity provider issues an assertion, which is exchanged for an access token by the MCP server’s authorization server. The resource server still validates that access token and enforces its own scopes and tool policy; an identity provider does not remove those responsibilities.

The announcement listed Okta as the first supported identity provider, Anthropic and Visual Studio Code as supporting clients, and Asana, Atlassian, Canva, Figma, Granola, Linear, and Supabase as supporting servers at publication time on June 18, 2026. Treat that list as time-sensitive. Confirm current support across your identity provider, MCP client, authorization server, and target server before designing a rollout.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Implementation checklist

  1. Classify the deployment as HTTP, STDIO, or another transport.
  2. For HTTP, decide whether authorization protects every request or only selected tools.
  3. Publish and test protected-resource and authorization-server metadata.
  4. Return a standards-compatible 401 challenge for protected requests.
  5. Register redirect URIs exactly and select a client-registration method supported by all participants.
  6. Validate authorization-response iss, token issuer, signature, audience/resource, expiry, scopes, and tenant claims.
  7. Keep downstream credentials separate from MCP bearer tokens.
  8. Restrict metadata and redirect destinations to prevent SSRF.
  9. Bind consent and authorization state to the initiating client in proxies.
  10. Keep secrets in environment variables or a secret manager for STDIO and server-side components.
  11. Test denied consent, missing scopes, expired tokens, wrong audiences, issuer changes, revoked access, and reauthorization.
  12. Record failures without logging access tokens, authorization codes, cookies, or assertion JWTs.

Troubleshooting common failures

Symptom Likely cause Fix
HTTP 401 with no usable login path Missing or malformed challenge or discovery metadata. Check the 401 response, protected-resource metadata, authorization-server metadata, and redirect URI configuration.
Token is signed correctly but rejected Issuer, audience, expiry, scope, or tenant claim does not match the MCP resource. Inspect validated claims, not just decoded payloads; request a token for the MCP server’s resource.
Authorization code redemption fails after redirect The client did not validate iss, the redirect URI differs, the code expired, or the wrong issuer endpoint was used. Bind state and redirect URI exactly, validate iss, and redeem the code once at the issuing server.
Desktop or CLI login loops on localhost Registration treats a native client as a web client or uses an imprecise redirect. Use the application type and redirect-registration behavior required by the 2026-07-28 revision and your authorization server.
STDIO server expects an OAuth callback The HTTP flow was applied to a local transport. Remove the callback flow and inject credentials through the environment or local secret manager.
Proxy authorizes the wrong user or client Shared consent cookies or static client identity were not bound to an initiating client. Store per-client authorization state and require explicit consent for each security principal.
Metadata lookup reaches an internal address The client followed an untrusted discovery URL without network restrictions. Validate URLs, follow redirects cautiously, and block private, link-local, loopback, and metadata-service ranges when inappropriate.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Capture consent screens while testing (optional)

Visual regression checks can help when you maintain OAuth consent pages or document an authorization flow. If you use a browser automation stack, capture only test accounts and redact tokens, codes, cookies, and personal data from stored images.

Or skip the browser setup

ScreenshotNeo can capture a URL through one HTTP request, which is useful for non-secret test pages. It removes cookie-consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to AI agents such as Claude and Cursor.

Use a test URL, never an OAuth callback containing a code or token:

Rank #4
HORUSDY Tamper Proof Star Key Set (Folding) Security Torx Key Set Sizes Include T-6 to T-30
  • Tamper Resistant Star Key Set Crafted with premium chrome vanadium steel, and each star tool folds neatly into the handle for quick, easy access.
  • Details - The handle is engraved with size for quick identification with drilled tips to allow use.
  • Portable - Keys fold compact for easy storage, Drilled tips allow use on tamper resistant security screws.
  • Size:Full Size T-6, T-7, T-8, T-9, T-10, T-15 T-20, T-25, T-27 and T-30.
  • And with 10 total star sizes able to match nearly all standard tamper resistant security screws on the market.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Other clients can use the same endpoint. See the ScreenshotNeo API documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Frequently Asked Questions

Should an access token be logged when diagnosing a 401?

No. Log the issuer, audience-result, scope decision, expiry state, request correlation ID, and server-side error category, but never the bearer token, authorization code, refresh token, cookies, or assertion JWT.

Can a reverse proxy perform all token checks for an MCP server?

A proxy may enforce an outer policy, but the MCP resource server must still make an authorization decision for its own resource and tools. Define which component validates each claim and prevent gaps between them.

What should be pinned for a production rollout?

Pin the MCP specification revision and SDK versions, record the authorization-server registration mode, and verify that the selected client, identity provider, authorization server, and resource server support the same discovery and issuer behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.