The direct answer
For a hosted MCP server that touches customer or tenant data, start with OAuth 2.1-style delegated access, then enforce resource-level authorization inside every protected tool. Treat scopes as a coarse first gate, not as proof that a token may access a particular record. Add explicit revocation and an audit trail before the server manages consequential actions.
Use a static token only when the deployment is genuinely local or the token represents one machine-level service identity with no user context. It is rarely a good substitute for customer-specific authorization in a multi-user product.
This is the central founder decision: are you authenticating a client, a user, or an agent acting for a user? Your answer determines what access token you issue, what claims your server trusts, which checks each tool performs, and what evidence you retain when a customer asks who changed what.
Start with the identity you actually need
MCP authorization is optional at the protocol level, but that does not make it optional for a commercial server that exposes private data or administrative actions. The MCP specification describes an HTTP authorization flow in which the MCP server acts as an OAuth resource server, the MCP client acts as an OAuth client, and an authorization server authenticates the resource owner and issues access tokens.
Before choosing a mechanism, write down one sentence for each access case:
- Machine identity: “This trusted worker may perform this narrow background task.”
- User identity: “This signed-in customer may read their own record.”
- Delegated identity: “This agent may act for this customer until access is revoked or expires.”
Those are different security problems. A machine credential should not become a customer credential. A user’s token should not automatically become a universal account token. A delegated agent should retain the customer’s identity and restrictions without inheriting the customer’s entire session.
For stdio-based local servers, the MCP guidance is different: retrieve credentials from the environment or another local credential store rather than implementing the HTTP OAuth flow. Other transports should follow established security practices appropriate to that transport.
Use this decision ladder
1. Is the server only for one trusted local client?
Choose a static token or equivalent local credential when all of the following are true:
- the server runs locally or inside a private trusted boundary;
- one machine or operator owns the deployment;
- the token grants a small, fixed set of capabilities;
- losing the token does not expose another customer’s data;
- you can rotate it without interrupting many users.
Keep static tokens out of prompts, tool arguments, logs, source control, and client-provided configuration files. Rotate them, scope them by operation where possible, and make replacement possible without rebuilding the whole client.
This model is simple, but simplicity comes from a narrow deployment—not from assuming every future user is trusted.
2. Is the agent acting for a human customer?\n
Choose OAuth delegated access. The client obtains an access token for the MCP server after the user authorizes the requested access. The server validates the token rather than issuing it itself.
This fits products where an agent should work with the signed-in customer’s own records. It also gives you a natural point for consent, expiry, and revocation. The MCP authorization model expects the server to advertise protected-resource metadata so clients can discover the relevant authorization server, and clients must send the intended resource parameter so tokens can be bound to the specific MCP server.
Do not confuse “OAuth is enabled” with “authorization is complete.” OAuth authenticates the token holder and carries granted privileges. Your application still has to decide whether that principal may access the requested project, invoice, document, repository, or tenant.
3. Is the client a service acting without a human?
For a service-to-service workload, a client-credentials flow can be more appropriate than an end-user authorization code. The resulting token should identify the workload and carry only its permitted operations. Do not impersonate a customer merely to reuse existing user-facing code.
This separation makes rate limiting, usage attribution, incident response, and offboarding easier. It also prevents one service failure from becoming an unbounded customer-session failure.
Scopes answer only the first question
Think of scopes as the answer to:
“Is this token allowed to attempt this broad category of operation?”
They are not sufficient answers to:
“May this principal access this exact resource now?”
A scope such as documents:read may be useful, but it does not by itself prove that a token may read document_42 in a particular workspace. Keep scopes meaningful and few enough to maintain. Split broad powers when different workflows need materially different permissions—for example, reading a document, changing document metadata, and sharing it externally.
Each protected tool should still evaluate the effective principal against the target resource. Depending on your data model, that check might compare:
- the token subject with the resource owner;
- the tenant in the token with the resource’s tenant;
- the requested object against a stored permission record;
- the agent’s delegated task against the user’s current grant;
- the action against policy requirements such as role, environment, or step-up confirmation.
Perform the check inside the operation that accesses the resource. A check in the MCP client, agent prompt, or tool description is advisory, not a server-side security boundary.
A useful implementation pattern is to resolve all of these values into one authorization context:
subject = who the token represents
client = which MCP client obtained it
tenant = which workspace the request targets
scopes = which broad operations were granted
delegation = which user authorized the agent, if any
resource = which record or object is requested
action = what the tool will do
decision = allow or deny, plus the reason
Keep the context internal if you expose it in logs. It helps make decisions consistent and gives your audit system a stable shape.
Model delegated access explicitly
Per-user delegation is more than placing the user’s access token in the agent’s environment. It means preserving the relationship among the user, the agent, the allowed action, and the delegated lifetime.
A delegated grant should answer:
- Who delegated? The human or service principal responsible for the action.
- Who acts? The agent, application, session, or workload executing it.
- What is allowed? The tool scope plus any resource-level constraints.
- For how long? An expiry and renewal policy.
- On whose behalf? The tenant, workspace, or customer account.
- How does it end? Revocation, logout, account disablement, policy change, or task completion.
If your agent can use a refresh token or other long-lived credential, the blast radius of theft or misconfiguration grows. Keep the delegated capability as narrow as practical, use short-lived access tokens, and follow OAuth security requirements for storage and refresh-token handling. For public clients, the current MCP security guidance calls for refresh-token rotation.
Do not ask the agent to collect passwords or API keys through ordinary form-mode elicitation. Current MCP elicitation guidance requires URL mode for secrets and payment credentials because the sensitive interaction must not pass through the MCP client.
Enforce authorization at the resource boundary
The resource-level check is where most commercial mistakes become expensive. A valid token can still represent the wrong tenant, a revoked member, an inactive subscription, or an agent attempting to exceed its delegation.
For every protected read and write, the server should resolve the target resource and apply policy before returning data or changing state. Avoid loading an object only because its identifier appeared in the request and then checking ownership later; that ordering can leak data through errors, timing, logs, or side effects.
A robust sequence is:
- Validate the token cryptographically and its issuer, expiry, and intended audience.
- Resolve the target tenant and resource.
- Verify the required scope.
- Verify the effective principal’s permission for that resource and action.
- Apply additional constraints, such as an active delegation or allowed environment.
- Execute the operation.
- Record the decision and outcome.
Reject by default. If policy cannot be resolved, deny the request rather than treating missing evidence as permission.
The MCP security guidance also requires clients and servers to secure token storage, avoid unsafe token passthrough, and validate that a token was issued for the server receiving it. Audience validation matters because a token minted for one protected resource must not become a key for another.
Make revocation an explicit product feature
Revocation is often treated as a security backstop, but for a founder it is also an operational feature. Customers will expect to disconnect an agent, end a trial, remove a team member, or change permissions without waiting for a long-lived token to expire.
Design at least three revocation paths:
- User-level: the customer disconnects the integration or revokes the agent’s delegated grant.
- Tenant-level: an administrator disables all delegated agents for the workspace.
- Credential-level: an individual refresh token, session, or registration is invalidated.
There is no universal requirement that a resource server maintain every kind of OAuth revocation list. Choose a mechanism that matches your token architecture, such as short token lifetimes plus server-side grant state, a denylist, or a session registry. Whatever the mechanism, test the user-visible behavior: after revocation, can the agent still perform an operation with a previously valid access token?
Do not promise immediate termination if your architecture allows a valid access token to remain usable until expiry. Make that window known, keep it short, and ensure sensitive operations can consult current grant state when necessary.
Revocation also needs propagation boundaries. Disconnecting a customer from your MCP server does not automatically revoke that customer’s separate grant in a third-party system. Make such dependencies explicit.
Build an audit trail around effective access, not just requests
A useful audit log answers five questions:
- Which principal requested the action?
- Which agent or client acted?
- Which resource was affected?
- Which permission or delegation allowed it?
- What was the result?
Capture both successful and denied consequential operations. A denial can reveal a misconfigured agent, an attempted privilege escalation, or a stale scope. Keep secrets and sensitive payload fields out of the log; record identifiers, decision reasons, timestamps, request or correlation identifiers, and relevant scope or delegation references.
Use a structured event such as:
occurred_at
subject_id
actor_client_id
agent_session_id
tenant_id
resource_type
resource_id
action
granted_scopes
delegation_id
decision
reason_code
correlation_id
Make logs tamper-resistant or access-controlled enough for their purpose, and define a retention policy. If customers need tenant-level visibility, expose a scoped audit view rather than dumping your internal operational log into the product.
Auditability also requires reliable correlation across the request. If the MCP client, your gateway, the tool invocation, and a downstream API call use different identifiers, an incident becomes a stitching exercise. Propagate a correlation identifier through the authorization decision and operation.
A practical implementation order
For a solo founder, this sequence minimizes rework:
Phase 1: Establish the boundary
- List every MCP tool and classify it as public, user-specific, tenant-wide, or administrative.
- Mark every read, write, and external side effect.
- Define the subject, tenant, resource, action, and delegation model.
- Decide whether each deployment is local, single-tenant, or multi-tenant.
Phase 2: Add identity and coarse permissions
- Select a local credential, client credentials, or delegated OAuth flow based on the identity model.
- Validate issuer, signature, expiry, and audience.
- Implement discovery for HTTP clients that need to locate the authorization server.
- Require minimum scopes for protected tools.
Phase 3: Enforce resource policy
- Resolve the target resource inside the tool.
- Verify tenant ownership and effective permission.
- Apply delegation and action-specific constraints.
- Return a generic denial where detailed policy information would leak information.
Phase 4: Add lifecycle controls
- Implement user, tenant, and credential revocation paths.
- Define expiration and renewal behavior.
- Test whether stale access tokens remain usable after the intended revocation event.
- Build an emergency kill switch for a risky tool or agent integration.
Phase 5: Make actions explainable
- Emit structured audit events for allowed and denied operations.
- Correlate authorization, tool, and downstream actions.
- Give users or administrators a way to inspect and revoke grants.
- Rehearse incidents such as a leaked token, malicious tool arguments, and revoked agent access.
Test the failures that matter
Test authorization with more than valid and invalid tokens. Include:
- a valid token for the wrong tenant;
- a token intended for a different MCP server;
- a valid scope but no permission on the specific resource;
- an expired delegation;
- a revoked refresh token with a still-valid access token;
- a disabled team member;
- an agent trying to change a resource identifier after user approval;
- a tool invoked with missing or malformed resource identifiers;
- an administrative action attempted through a general-purpose tool.
Assert both the outcome and the audit record. A denied request that produces no useful event may conceal an incident; an allowed request without a resource-level audit trail may be impossible to investigate later.
Frequently asked questions
Are OAuth scopes enough for MCP security?
No. Scopes express broad granted privileges. They do not replace server-side checks against the actual resource, tenant, action, and current delegation state.
Should every MCP server use OAuth?
No. Authorization is optional in MCP. Local stdio servers commonly obtain credentials from the environment. OAuth becomes much more important when a hosted server serves multiple customers, agents act on behalf of users, or access must be independently revoked and audited.
Is per-tool authorization preferable to per-server authorization?
Per-tool authorization can simplify public tools and trigger consent only when protected functionality is used. Per-server authorization is simpler when all exposed tools are sensitive. The important point is that protected tools still enforce resource-level policy after authentication.
What should happen when the authorization server is unavailable?
Do not silently convert an unknown principal into an authorized one. Apply a deliberate fail-closed policy to protected operations, except for carefully bounded local use cases where the credential model does not rely on a remote authorization server. Preserve cached short-lived access according to your security policy, but avoid inventing a broad emergency bypass.
The founder’s bottom line
Authorization is not one feature you add before launch. It is a chain of decisions that determines what your agent can do, what you must be able to prove afterward, and how quickly you can contain a mistake.
For most commercial MCP servers, the defensible baseline is:
- static credentials only for genuinely local or machine-level access;
- OAuth delegated access for agents acting for customers;
- narrow scopes for coarse operation permissions;
- resource-level checks inside every protected tool;
- explicit user, tenant, and credential revocation;
- structured audit events for effective access and outcomes.
That baseline adds more work than accepting a single shared token, but it removes a larger and more expensive category of failure: the agent appearing legitimate while accessing something it should never have reached.
For a broader inventory of permissions already exposed through MCP tools, use the MCP Server Permission Scope Audit Checklist for Founders. If you are also hardening production boundaries, review the MCP Production Security Checklist for Indie Developers.
Sources
- https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/index
- https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/security-considerations
- https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/authorization-server-discovery
- https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/authorization
- https://modelcontextprotocol.io/specification/2026-07-28/client/elicitation
- https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization







