Skip to content

Remote MCP servers and sign-in: OAuth, CIMD and enterprise login

Level 4: Build. About 10 min. Checked on 19 November 2026 against MCP spec 2026-07-28, Enterprise-Managed Authorization (stable).
Stage 4 of 4: Build

In this lesson you'll design sign-in for a remote MCP server that apps can complete, that accepts only its own tokens, and that companies can manage centrally.

Your server works on localhost. Now it has to live at https://mcp.yourcompany.com, act for real users on their real accounts, and be added from Claude, ChatGPT and VS Code by people you've never met. Sign-in is where most remote servers go wrong, and where the 2026-07-28 spec changed the most.

The shape of it

Your MCP server is a resource server. When an app calls it without a valid token, it answers with an authorization challenge; the app then sends the user through an OAuth flow with your authorization server, gets a token issued for your MCP server, and retries. Apps such as Claude call remote servers from their own cloud, so your server and its sign-in must be reachable on the public internet.

What changed in 2026-07-28

  1. Client registration: CIMD, not DCR. Dynamic Client Registration is deprecated in favour of Client ID Metadata Documents, where the client's ID is a URL to a document describing it. Support CIMD now; keep DCR during the window if existing clients rely on it.
  2. Issuer validation. Clients must check the issuer (iss) before redeeming an authorization code, which blocks mix-up attacks between authorization servers. Make sure your authorization server sends it.
  3. Localhost redirects for desktop and CLI apps. application_type in registration lets them use localhost redirect URIs.
  4. Issuer-bound credentials. Client credentials can't be reused across authorization servers.

Rules from the security best practices

  • Accept only tokens issued for your server (check the audience). Never forward a client's token to another API ("token passthrough" is forbidden by the authorization spec).
  • If you proxy a third-party API with one fixed client ID, ask each client for consent before sending the user to the third party, or an attacker can ride an earlier consent cookie.
  • Start with minimal scopes and ask for more when a privileged tool is first used.
  • Verify every request, and never treat a state handle (a cart or job ID) as authentication.
  • If your authorization server fetches client metadata URLs (CIMD), apply SSRF protections: https only, no private or link-local addresses.

Company-managed access

Enterprise-Managed Authorization, stable since 18 June 2026, lets a company grant your server to its people through its identity provider: the client exchanges an identity assertion from the IdP for an access token from your authorization server, and users skip per-server consent. The MCP blog lists Asana, Atlassian, Canva, Figma, Granola, Linear and Supabase among servers that support it. If you sell to companies, it's worth planning for.

Test it like a user

In short

  • Your server is a resource server: challenge, OAuth, token issued for you.
  • 2026-07-28: CIMD over DCR, issuer validation, localhost redirects for native apps.
  • Check token audience, never pass tokens through, start with small scopes.

What to try next

Share this lesson

Lesson 5 of 6 in this path

Words used in this lesson

Sources

Official documentation, checked on 19 November 2026. Products change: if a step differs, the source has the current version.

Get the next lesson

New Academy lessons are announced in the weekly AI-Powered email.