Skip to content

MCP Authorisation for Remote Servers

How remote MCP servers authenticate users with OAuth, and good practice for tokens and scopes.

Editorial team 1 min read

Remote MCP servers expose data and actions over the network, so they need proper authorisation.

OAuth-Based Flow

The MCP specification builds authorisation for HTTP transports on OAuth 2.1 conventions. In outline:

  1. The client connects and the server indicates that authorisation is required.
  2. The client discovers the authorisation server from published metadata.
  3. The user signs in and consents in a browser.
  4. The client receives an access token and sends it with each request.

The exact discovery and registration mechanisms have evolved between protocol versions; follow the version your SDK implements.

Good Practice

  • Least privilege: request narrow scopes that match the tools offered.
  • Short-lived tokens with refresh, stored securely by the client.
  • Validate tokens on every request, including the intended audience, so tokens issued for another service aren't accepted.
  • Don't pass tokens through: a server calling other APIs should obtain its own credentials rather than forwarding the client's token.
  • Per-user authorisation: apply the signed-in user's permissions to every tool call.

Local Servers

stdio servers usually rely on local credentials such as environment variables or config files. Keep these out of source control and give them minimal permissions.

Audit

Log who called which tool with what outcome.

More in MCP

All MCP guides →
MCP Guide · 1 min

MCP Architecture: Hosts, Clients and Servers

How the Model Context Protocol is structured: the host application, the clients it creates and the servers that expose capabilities.

MCP 1 min read 2 Sep 2025

MCP Guide · 2 min

MCP Tools, Resources and Prompts

The three main things an MCP server can offer, who controls each, and when to use which.

MCP 2 min read 1 Sep 2025

MCP Guide · 1 min

MCP Transports: stdio and HTTP

How MCP messages travel: standard input and output for local servers, HTTP for remote ones, and how to choose.

MCP 1 min read 31 Aug 2025

MCP Guide · 1 min

Building Your First MCP Server

A walkthrough of the steps to create a simple MCP server that exposes a tool, and how to test it.

MCP 1 min read 30 Aug 2025