MCP Server Security and Authorization, Explained
An MCP server can expose tools that read company records, modify tickets, or call other services, so its security boundary matters as much as the protocol messages it exchanges. Developers and platform teams designing MCP server security and authorization need to decide which identity a request represents, which resources and actions that identity may use, and how a host handles user consent. This explainer focuses on those controls rather than the general mechanics of how the Model Context Protocol works.
Why MCP Server Security Is Being Discussed
MCP gives AI hosts a consistent way to connect with tools and data, but a common interface does not make every connected server trustworthy. A server can sit between an AI host and a sensitive business API, and may receive model-proposed tool calls that were influenced by untrusted prompts or retrieved content. That makes identity, permission checks, and the scope of delegated authority practical deployment questions, not optional hardening.
The MCP project defines a protocol for connecting AI applications to external systems. Its authorization specification describes OAuth-based authorization for HTTP transports, while its security best practices discuss implementation threats such as token passthrough, confused-deputy behavior, and server-side request forgery. These details matter whenever an MCP server protects data or actions rather than exposing a harmless local demonstration.
What Is MCP Server Security and Authorization?
MCP server security is the set of controls that protects the server, its users, and the systems it can reach. Authorization is the decision about whether an authenticated principal may perform a specific operation on a specific resource. Authentication answers who or what is making a request; authorization determines what that identity can do.
For remote servers using HTTP, MCP defines an OAuth-based authorization flow. The client discovers authorization information for the protected MCP resource, obtains an access token from an authorization server, and presents that token to the MCP server. The server must validate that the token is intended for that resource, then apply its own authorization policy to the requested operation.
This protocol flow does not decide the application’s business permissions. A valid token may establish identity and broad delegated scopes, but the server still needs to check ownership, tenant boundaries, tool-specific policy, and whether an operation needs explicit approval. The OAuth 2.0 Protected Resource Metadata standard, RFC 9728, defines metadata a client can use to discover how to interact with a protected resource.
The Problem: A Tool Description Is Not a Permission
An MCP tool’s name, description, and input schema tell a client what the server offers; they do not prove that a user is allowed to invoke it. A model may propose a tool call based on ambiguous requests or instructions embedded in data. If the server treats that proposal as authorization, a model error or prompt injection can turn a narrow read task into an unintended write or disclosure.
Shared credentials create another risk. Suppose a server uses one powerful service token for every connected user. Unless it checks the authenticated user’s access before each operation, the server can become a confused deputy: it uses its own authority to perform an action the caller could not perform directly. Passing a token through to another service without checking its intended audience can also let a credential be replayed at a different resource.
These risks are not unique to MCP, but protocol integration can obscure where they belong. The host may present tools and ask for consent; the server holds or delegates authority; and downstream services may own the final resource-level rules. All three boundaries need deliberate policy.
How MCP Authorization Works
For a remote HTTP server, a typical authorization path is:
- The MCP client identifies the server’s protected resource and discovers its authorization metadata, often using the resource metadata URI supplied in an HTTP authentication challenge.
- The client discovers or selects an authorization server and obtains an access token through an appropriate OAuth flow.
- The client sends the token to the MCP server over HTTPS. The token is intended for that server, not an unrelated API.
- The server validates the token’s signature or introspection result, issuer, audience, expiry, and required scopes.
- The server applies operation-level policy, checks the requested resource and caller’s permissions, and executes only the authorized action.
- The host presents sensitive side effects for user approval when appropriate, and the server records a useful audit event.
The precise OAuth configuration depends on the deployment, but the resource audience is a critical boundary. MCP’s authorization rules require servers to validate that access tokens were issued specifically for them. The OAuth security best current practice, RFC 9700, also recommends restricting token privileges. An MCP server should not accept a token issued for a different API and forward it downstream as if that made the request safe.
Local servers using stdio have a different trust model. The current MCP authorization specification is for HTTP-based transports; stdio implementations generally obtain credentials from their environment or an embedded credential provider instead. A host launching a local process should treat its executable, arguments, environment variables, filesystem access, and network access as security-sensitive. Running locally is not equivalent to running with no risk.
| Boundary | Local stdio server | Remote Streamable HTTP server |
|---|---|---|
| How it is reached | A host launches a local process and exchanges protocol messages over standard input and output | A client sends MCP requests to a network endpoint |
| Typical credential source | Carefully scoped environment or host-provided credentials | OAuth access token obtained for the protected resource |
| Main identity question | Which host, user, and local process may access the credentials and files? | Which principal does the token represent, and is its audience this server? |
| Important controls | Trusted executable source, restricted process permissions, minimal environment and filesystem access | HTTPS, OAuth metadata and token validation, audience checks, per-operation authorization |
| Common mistaken assumption | A local process is automatically safe because it is not public | A valid bearer token automatically permits every tool and resource |
Key Security Components
Resource identity and token validation. Give the MCP server a stable resource identifier and configure the authorization server to issue tokens for that audience. Validate issuer, audience, expiry, signature or introspection status, and scopes on every request. Reject tokens intended for another service; do not solve downstream access by blindly relaying a caller’s token.
Authorization at the tool and data layer. Map the authenticated identity to explicit permissions, then check those permissions for each tool invocation and resource. A documents:read scope should not imply permission to read every tenant’s documents. A write scope should not automatically cover deletion, external communication, or administrative actions. Enforce ownership and tenant isolation in the server or downstream service, not only in the model-facing tool list.
Least privilege and approval. Expose narrow tools that perform one bounded task, and grant each identity only the scopes it needs. Read operations may be suitable for automatic execution; actions that change records or send information outside the organization may need confirmation. Approval should identify the exact action and target, expire, and be checked by trusted server-side code. For broader patterns around tool allowlists, argument validation, and approval, see safety patterns for tool-using LLMs.
Transport and network controls. Use HTTPS for remote deployments, validate host and origin information where required, and avoid exposing development or administrative endpoints to untrusted networks. Servers that fetch URLs or call authorization metadata endpoints need defenses against SSRF, DNS rebinding, and unsafe redirect chains. Apply the official MCP security guidance to the actual server and proxy design rather than assuming OAuth alone closes these paths.
Audit and lifecycle management. Record the authenticated principal, requested tool, authorization decision, approval state, outcome, and a correlation identifier. Avoid logging bearer tokens or unnecessary sensitive arguments. Define token expiry, revocation, consent changes, and server credential rotation as operational procedures. When tracing requests across a model, server, and downstream API, include authorization decisions without putting secrets in telemetry.
Real-World Use Cases
- Internal knowledge search: Authenticate each employee, enforce document-level access in the server, and return only documents the caller may read. A shared search backend does not justify a shared all-access result set.
- Ticket or CRM updates: Separate read and write permissions, validate record ownership, and request approval before sending customer-visible changes.
- Developer tools: Limit repository operations to approved projects and branches. Keep deployment credentials out of the model context and require a separate trusted workflow for production changes.
- Third-party API connectors: Treat the MCP server as a resource server with its own audience. If it calls another API, use a separately authorized credential for that service instead of assuming the incoming MCP token can be reused.
These designs preserve the host’s role in the interaction while ensuring the server and downstream systems still enforce the permissions that protect their data.
Getting Started: Define and Test a Policy
Start by listing the data and side effects each tool can reach. The following YAML is an illustrative application policy, not a standard MCP configuration format. It makes the audience, scopes, approval requirement, and rate limit explicit so an implementation can translate them into checks.
resource_uri: https://mcp.example.com/mcp
required_audience: https://mcp.example.com/mcp
tools:
search_documents:
required_scopes: [documents:read]
access: read
approval: none
update_ticket:
required_scopes: [tickets:write]
access: write
approval: each-call
max_calls_per_minute: 10
Use a separate, non-production test identity and verify the metadata URL advertised in the server’s WWW-Authenticate challenge. Set RESOURCE_METADATA_URL to that exact URL, then inspect the returned document:
curl --fail-with-body --silent --show-error \
--dump-header - "$RESOURCE_METADATA_URL"
Then exercise the server through a compatible MCP client or inspector. Confirm that a request without a token is rejected with an authorization challenge; a token for another audience is rejected; a read-only identity cannot update a ticket; and a valid write request is limited to the caller’s authorized records. Repeat write tests with missing approval, changed arguments after approval, expired credentials, and a revoked identity. Verify that denied requests do not reach the downstream API and that audit records contain the decision but no bearer token. For OAuth role and token background, see the OAuth 2.0 and OpenID Connect implementation guide; use API security testing techniques to extend the negative-test cases.
Common Misconceptions
“The host already authenticated the user, so the server can trust every call.” The server needs a verifiable identity and must authorize the requested resource and operation. A model’s request or a client-supplied user ID is not proof of either.
“A valid token means every advertised tool is allowed.” A token has a defined resource audience and delegated privileges. The server still needs to enforce tool-specific rules, tenant isolation, ownership, and approval requirements.
“Local stdio servers do not need security controls.” A launched process may inherit secrets, read local files, or make network requests. Limit the process’s provenance, permissions, environment, and reachable resources.
Related Articles
- Model Context Protocol (MCP) explained covers MCP roles, transports, and protocol behavior.
- Safety patterns for tool-using LLMs covers model-facing execution policy and side-effect controls.
- OAuth 2.0 and OpenID Connect implementation explains OAuth actors, flows, and tokens.
- API security testing techniques describes practical authorization and input-validation checks.
Changelog and Last Updated
- Published: 2026-10-03

