A production MCP integration should not treat an approved session as permanent permission. The useful unit of authorization is the individual tool call: who is acting, which agent is acting, what resource is targeted, which operation is requested, and whether that authority is still valid at this moment.

That sounds stricter than most prototypes need. It is also the minimum design that lets a founder safely offer customer-facing agents. If a user removes access, closes a subscription, or a policy changes, the next MCP call must fail without waiting for a token to expire or a server to restart.

This guide gives you a practical model for MCP delegated permissions, production authorization, resource access control, and agent permission revocation.

Start with the business decision: what may an agent do without a person?

Before choosing an authorization library, write down the outcomes you are willing to delegate. “The agent can use our MCP server” is not a permission policy. It is a product promise waiting to become an incident.

For each workflow, separate:

  • Read operations: searching records, reading a document, listing available resources.
  • Write operations: creating tickets, changing notes, uploading files.
  • Sensitive operations: sending messages, changing permissions, issuing refunds, deleting data.

Then decide which operations require a fresh human confirmation. A support agent might be allowed to read a ticket and draft a reply, while publishing the reply or changing the customer’s billing status remains human-approved.

This step saves implementation time because it prevents a common architecture mistake: exposing a general-purpose tool such as manage_customer to an agent and trying to repair the consequences through prompt instructions. Tool design and authorization should be designed together. If your server offers one broad administrative tool, you usually need more argument-level restrictions and more audit work than if you expose a small set of explicit operations.

If you are still selecting the broader authorization structure, this MCP authorization model decision framework compares static tokens, OAuth scopes, per-user delegation, resource checks, revocation, and audit logs.

The four-part permission model

For a production call, evaluate four things together:

  1. User: the human or tenant on whose behalf the agent acts.
  2. Agent: the specific client, agent identity, or workload making the request.
  3. Resource: the customer, repository, project, document, or other object being accessed.
  4. Operation: the action being requested, including any important attributes such as amount, destination, or scope.

A permission decision should not be inferred from only one of these dimensions.

An authenticated user is not automatically allowed to access every resource belonging to that user. A valid agent is not automatically allowed to act for every user. And access to one resource does not imply permission to perform every operation on it. “Can read project 42” and “can rename project 42” are different decisions.

A simple policy expression can make this explicit:

allow call when
  user.delegation is active
  and agent.delegation permits operation
  and user can access resource
  and operation is allowed on resource
  and policy revision is current

The exact implementation may be a policy engine, application code, or a gateway. The important part is that the server can explain why the call was allowed or denied.

How delegated access should work

A delegated grant should connect three records:

  • The subject: the user or tenant.
  • The delegate: the agent or client permitted to act.
  • The authority: the resources, operations, time window, and conditions allowed.

Do not collapse those records into one opaque token claim if you need user-visible revocation, granular resource checks, or a useful audit trail. A compact token can still carry a grant identifier, but the server should be able to look up current delegation state or use a revocation-aware mechanism.

The user should know what is being delegated, to which agent, and for what actions. Avoid requesting broad access to a third-party account “so the agent can work.” Request the smallest scopes that support the workflow and distinguish reading from mutation.

The MCP authorization model treats the server as the resource server and the client as an OAuth client acting for a user. Token validation proves that the credential is legitimate; it does not answer whether this particular call is allowed.

2. Bind the delegation to an agent identity

The human user may authorize an agent, but the server also needs to know which agent is calling. Otherwise, every agent connected to the same client can potentially reuse the same authority.

Record a stable agent or client identifier, the grant ID, and the grant version. If the client is a local stdio server, keep the equivalent controls in the host process because a remote HTTP gateway may not be able to observe those calls.

3. Bind the delegation to resources and operations

An OAuth scope such as tickets:read is useful, but it may still be too broad if one user can read every ticket and the agent only needs tickets assigned to a particular queue.

Add resource-level checks where the business risk justifies them:

tickets:read + resource.ticket_id belongs to user.tenant
project:update + operation.project_id belongs to delegated_project_set
files:write + resource.folder_id in grant.allowed_folders

Avoid pretending that a scope name alone provides object-level authorization. The server still needs to validate the requested object against the user’s and grant’s allowed resources.

4. Keep a current delegation version

Every grant should have a state such as active, revoked, or expired, plus a version or revision. This makes it possible to answer whether a call presented an old but cryptographically valid credential.

For details on token lifetimes, refresh, and rotation, see the MCP OAuth token lifecycle guide.

Enforce revocation at call time

This is the operational requirement that most often gets postponed: when a user revokes an agent, what happens immediately?

An answer of “the access token will expire eventually” is not sufficient if the token can retain access for hours and the revoked agent can write data or spend money.

Design revocation around the call path, not around a cleanup job.

The revocation-aware call sequence

For every remote tools/call, the server should:

  1. Validate the access token and intended audience.
  2. Resolve the delegation grant referenced by the request or token.
  3. Confirm that the grant is active, unexpired, and not superseded.
  4. Confirm that the agent may invoke this operation.
  5. Validate the requested resource and operation arguments.
  6. Execute the action using server-controlled credentials.
  7. Write an audit record for the decision and outcome.

If step 2 or 3 cannot be completed reliably, fail closed. A temporary authorization-store outage should not silently convert a restricted grant into broad access.

Revocation should affect existing sessions

A session identifier is a container for conversation and transport state. It is not proof that authority still exists. Revoking a grant should invalidate or downgrade the session’s delegated access immediately, even if the session itself remains open.

For local stdio servers, the practical equivalent is to stop the process, disable the delegated credential in the host environment, or have the server consult a revocation-aware local authorization store. Do not assume a network policy layer can intercept traffic that never crosses it.

Choose revocation consistency deliberately

There is a useful engineering trade-off here:

  • Immediate online revocation: the server checks current grant state on every call. It offers the clearest behavior and is usually appropriate for customer-facing or financial actions, at the cost of an additional state lookup or policy dependency.
  • Short-lived capability with a revocation list: the server checks a signed, frequently refreshed revocation state. This can reduce online lookups, but the maximum revocation delay depends on the refresh and caching design.
  • Session teardown only: revoking means invalidating a session or token. This is simple, but it may leave other sessions or credentials active.

For an indie developer, the practical recommendation is simpler than the taxonomy suggests: start with online grant-state checks for sensitive operations. Optimize only after you understand the latency and availability cost. A revocation feature that merely changes a database row is not revocation until the request path uses that row.

Resource access control: authorize the object, not only the tool

Tool-level permission answers “may this agent call this kind of operation?” Resource access control answers “may it perform that operation on this particular object?”

You need both. Consider an agent with issues:update. Without resource checks, it may update any issue returned by the backend. With resource checks, it may update only issues inside the delegated workspace, assigned queue, or explicitly selected project.

A robust server-side check has this order:

  1. Validate the shape and type of resource identifiers.
  2. Load authorization context from trusted server state, not from agent-generated claims.
  3. Confirm tenant and user relationships.
  4. Confirm the grant covers the operation and resource.
  5. Apply operation-specific limits, such as allowed fields or maximum amount.
  6. Deny by default when any lookup is missing or inconsistent.

Do not rely on the model to remove unauthorized IDs from the arguments. The model is choosing actions; the server is responsible for deciding whether they are allowed.

The minimum viable audit trail

An audit trail should let you reconstruct an authorization decision, not merely prove that an endpoint was hit. For each call, record enough information to answer:

  • Which user, tenant, agent, and grant were involved?
  • Which tool and operation were requested?
  • Which resource was targeted?
  • Was the decision allowed or denied?
  • Which rule or policy revision produced the result?
  • What changed, and did the downstream operation succeed?
  • Was the request rejected because authorization state was unavailable?

A useful event might look conceptually like this:

{
  "event_id": "evt_01...",
  "request_id": "req_01...",
  "tenant_id": "tenant_123",
  "user_id": "user_456",
  "agent_id": "support_agent_v2",
  "grant_id": "grant_789",
  "grant_version": 4,
  "tool": "update_ticket",
  "operation": "tickets:update",
  "resource": {"type": "ticket", "id": "ticket_42"},
  "decision": "allow",
  "policy_revision": "mcp-auth-v7",
  "outcome": "success",
  "timestamp": "2026-04-10T14:32:18Z"
}

Do not put access tokens, refresh tokens, sensitive document contents, or unnecessary personal data into the audit event. Hash identifiers when correlation is enough. Restrict access to the audit trail, define retention rules, and make sure logging cannot silently change the authorization outcome.

For sensitive writes, record the important changed fields or a protected representation of the change. For example, a refund event should show the amount and target without copying the entire customer record into logs.

A practical implementation sequence

Here is a sequence that remains manageable for a small team.

Step 1: Inventory the exposed surface

List every MCP tool, the downstream service it reaches, the credential it uses, and whether it reads, mutates, or can cause an irreversible external action.

Mark tools that cannot be safely narrowed by arguments. Replace them with smaller tools when practical. A server that supports only send_email and delete_file may still be safe if each tool has an explicit grant, but broad tools such as execute_admin_action often create unacceptable argument-level complexity.

Step 2: Define permissions as data

Create a permission catalog with stable operation names such as:

project:read
project:update
project:member:invite
invoice:read
invoice:refund

Map every tool and resource-level action to one or more operations. Give every operation an owner and a reason. Undocumented permissions should not exist.

Step 3: Build the delegation store

Store the subject, delegate, allowed operations, allowed resources, constraints, expiry, state, and version. If you already have OAuth and a database, this may be a small set of tables rather than a separate authorization platform.

Step 4: Centralize call-time checks

Place authorization in the MCP server or a trusted gateway that sits directly in front of it. Avoid scattering ad hoc checks across tool handlers; inconsistent checks become hidden privilege paths.

A shared checker should return a structured result:

{
  "allowed": true,
  "grant_id": "grant_789",
  "policy_revision": "mcp-auth-v7",
  "reason": "operation and resource are within active delegation"
}

For a denial, return a generic authorization error to the caller while retaining the detailed reason internally. That limits information leakage without destroying your ability to investigate.

Step 5: Add revocation paths in the product

Users need a visible place to inspect and revoke agent access. Support removal of one agent without deleting the account or every other integration. Also provide an administrative kill path for compromised agents and a way to suspend a tenant globally.

A useful product flow is:

  1. User opens connected agents.
  2. User selects an agent.
  3. The interface shows granted operations, resources, expiry, and last activity.
  4. User revokes access.
  5. The server changes the grant state immediately.
  6. The next call receives a denial.

Step 6: Test negative paths

Your test suite should prove that a valid token cannot bypass current policy. Include cases for:

  • a revoked grant with a still-valid token;
  • an agent from the same customer using another agent’s grant;
  • a cross-tenant resource identifier;
  • an operation outside the grant’s scope;
  • a superseded grant version;
  • missing or stale authorization state;
  • repeated calls during the revocation transition;
  • local stdio behavior where no HTTP gateway is present.

Do not test only the happy path. Revocation bugs appear at boundaries and during failures.

Common design mistakes

“The token is valid, so the call is allowed.”

No. Token validity proves identity and credential integrity. It does not prove that the delegated grant is still active or that the requested operation and resource are permitted.

“Scopes are enough.”

Scopes are coarse boundaries. Resource and argument checks are still necessary when one tenant contains multiple customers, projects, accounts, or objects with different sensitivity.

“Revoking means deleting the session.”

That may leave another token, session, or agent credential active. Revoke the delegation grant and make all call paths consult its current state.

“The agent can pass our downstream access token.””

Avoid token passthrough. It weakens audience binding, obscures which principal authorized an action, and complicates revocation and audit. The MCP server should use a server-controlled credential for downstream access and preserve the user delegation as authorization context.

“Tool descriptions are safe, so let the model decide.”

Tool descriptions and tool outputs are untrusted inputs. They can influence the model, but they cannot grant authority. The policy engine must make the final decision independently.

“If authorization is unavailable, allow the read operation.”

This is a common shortcut that defeats fail-closed behavior. Choose availability trade-offs deliberately by operation sensitivity. For sensitive operations, deny when authorization state cannot be verified. Reads may sometimes use a narrower degraded mode, but it must be an explicit policy rather than an accidental fallback.

What to build first

For a customer-facing MCP product, the minimum viable production stack is:

  1. Per-user, per-agent delegation records.
  2. Explicit operation scopes.
  3. Server-side resource checks.
  4. Call-time revocation checks.
  5. Structured decision logs.
  6. A user-facing revocation flow.
  7. Negative tests for stale and cross-boundary access.

You do not need a complicated policy language on day one. A clear database-backed decision function can outperform an elaborate rules engine that your team cannot explain or debug. Start with default deny, keep operation names narrow, and make every decision return a reason.

The business payoff is straightforward: users can delegate useful work without handing over permanent account-wide control, founders can sell automation without accepting unbounded operational risk, and support teams can answer what happened, who authorized it, and whether access was still valid when the agent acted.

FAQ

Is OAuth enough for MCP delegated permissions?\n

OAuth provides the authentication and token framework, but it is not the complete authorization policy. Your server still needs to decide which agent, operation, and resource are permitted and whether the delegation remains active.

Should every MCP call check a database?\n

Not necessarily. You can use short-lived credentials plus a revocation-aware cache, but the design must define how quickly revocations take effect and what happens when the cache or policy service is unavailable. For sensitive operations, an online check is the clearer starting point.

How should revocation affect an active conversation?\n

The conversation may continue, but delegated tool access should stop according to the revocation policy. Do not treat an open session as a durable authorization grant.

Does this work the same way for stdio and remote MCP servers?\n

The authorization model can be the same, but the enforcement point differs. Remote HTTP servers can authorize each request centrally. Local stdio servers must enforce access inside the server or host process because they do not pass through a remote gateway.

What should be logged?\n

Log the principal, delegate, grant, tool, operation, resource, decision, policy revision, outcome, and timestamp. Exclude credentials and unnecessary sensitive payloads.

Sources