Est.
MCP 101Long read

Role-Based Access Control Implementation for MCP

Ungoverned MCP servers expose AI agents to unauthorized access and code execution at scale.

Staff Writer · · 13 min read
Cover illustration for “Role-Based Access Control Implementation for MCP”
MCP 101 · August 2, 2026 · 13 min read · 2,952 words

In late 2024, Anthropic released the Model Context Protocol as an open standard for connecting AI applications to external tools and data. The architecture is straightforward: a host application runs an MCP client, which connects to MCP servers that expose tools the agent can invoke. The design philosophy followed naturally from that simplicity. Maximize what agents can do. Get the protocol adopted broadly and fast.

Enterprise security was not a first principle of that original specification. No mandatory authentication framework. Servers were implicitly trusted. Early web protocols made the same tradeoff: underspecify the security model, enable rapid adoption, let the ecosystem figure out the rest. It worked out eventually, after decades of painful iteration. The difference now is the pace. By 2025, the MCP SDK was pulling over 97 million monthly downloads. More than 10,000 active public servers existed. First-class client support had landed in ChatGPT, Claude, Cursor, Gemini, Microsoft Copilot, and VS Code. In December 2025, Anthropic donated the protocol to the Agentic AI Foundation under the Linux Foundation, with OpenAI and Block as co-founding members. The protocol matured quickly. The security posture did not.

So what does ungoverned access look like when you zoom in? Trend Micro found 492 MCP servers exposed to the open internet with zero authentication. Censys counted 12,520 internet-accessible MCP services, the majority unauthenticated. Research from Adversa AI in June 2026 found roughly 40% of remote servers exposing their tools with no authentication at all. Among officially registered MCP servers, between 38 and 41% offered no meaningful authentication.

That's the access problem. Underneath it sits a vulnerability problem that compounds things considerably.

Security assessments found that 43% of open-source MCP servers carry command injection flaws. A third allow unrestricted URL fetches. More than a fifth leak files outside intended directories. CVE-2025-6514, scored at a critical 9.6, was a remote code execution flaw in the mcp-remote package, downloaded over 437,000 times before public disclosure. The root cause: the package failed to sanitize the authorization_endpoint URL received from a remote MCP server during OAuth flow initialization. Exploiting it required no bypass of user authentication. Connecting to a malicious server was sufficient.

These aren't abstract threat scenarios. In June 2025, a production Supabase agent configured to process user-supplied support tickets was manipulated via prompt injection into leaking integration tokens. Invariant Labs demonstrated a malicious MCP server silently exfiltrating an entire WhatsApp message history. The VIPER-MCP project scanned roughly 40,000 server repositories and surfaced 106 zero-day vulnerabilities, generating 67 CVEs.

Gartner projected that through 2029, more than half of successful attacks on AI agents will exploit access-control issues. That's a directional claim about where the industry is headed if the current trajectory holds, not a historical observation.

What connects every one of these incidents is the same absence: no record of what the agent was permitted to access, which meant no reliable mechanism to detect that something had gone wrong, let alone contain it. If an organization can't account for what an agent was allowed to touch, it cannot scope the damage after a breach. That's the more consequential problem, because breaches are not hypothetical.

Diagram: The MCP Authentication Gap: By the Numbers. Visualizes: Visualize the scale of the unauthenticated MCP server problem using four concrete statistics from the article: 492 MCP servers exposed to the open internet with zero authentication…

Why server-level access control isn't granular enough for MCP

Traditional application security treats access control as a mostly binary, mostly static decision. A service is allowed or it isn't, based on a predefined role or static credential. That model was built for predictable, human-driven workflows. An MCP agent doesn't operate that way.

A single MCP server exposes dozens of tools with radically different risk profiles. Consider two tools living on the same database server: one queries records, one deletes them. The consequences of unauthorized access to those two tools are orders of magnitude apart. But if you grant server-level access to handle the first, the agent inherits access to the second. That's overexposure by design, not by accident, and no amount of careful server configuration resolves it.

RBAC for MCP has to operate at the tool level. In mature implementations, it needs to reach the parameter level as well. "Can this agent call this tool?" is a meaningfully different question from "can this agent call this tool against this specific resource?" Reading any file is different from reading this file. Querying any database row is different from querying this row in this table. The granularity isn't pedantry; it is the actual unit of risk.

There's also a structural problem that server-level controls simply cannot address. If an MCP server accepts tokens with incorrect audiences and forwards them unmodified to downstream services, a downstream API will treat that token as legitimate. This is the confused deputy problem, a flaw in the architecture of trust, not in any individual component. Server-level RBAC cannot prevent it because the problem lives in the relationship between servers.

The deeper issue is that server-level governance is the wrong unit of analysis entirely. The agent moves between servers, accumulates context across calls, and can chain tool invocations in ways no single server can observe. Trying to govern that from the edge of each server is like trying to audit a conversation by only listening at one door. But what if the agent's most dangerous behavior emerges precisely from that cross-server chaining — the sequence of calls that looks innocuous at each individual server but adds up to something no policy anticipated?

What the MCP authorization specification now provides as a foundation

The June 2025 spec revision drew a line that the original design had left blurry. MCP servers are now classified as OAuth Resource Servers. Authorization responsibility belongs to a dedicated authorization server, not to the MCP server itself. That separation moves the access decision upstream, away from the component doing the work and toward a component whose explicit purpose is to govern identity.

The November 2025 spec (2025-11-25) required OAuth 2.1 for all remote MCP server connections and made PKCE mandatory for all public clients. Authorization remains optional for MCP implementations in general, but when HTTP-based transport is used, implementations should conform. STDIO transport retrieves credentials from the environment instead.

Token audience binding is now specified. Clients must include the resource parameter in authorization and token requests; servers must validate that tokens were issued specifically for their use. Authorization servers should issue short-lived access tokens to reduce the exposure window when a token leaks.

SEP-835 introduced incremental scope consent, which resolved a surprisingly persistent ecosystem problem. Before it, every server invented its own scope names, making permissions unpredictable across deployments. Baseline OAuth scope names are now standardized. Servers can request new scopes on an as-needed basis rather than front-loading all permissions at session initialization. If a token lacks required scopes for a given operation, the server responds with a 403 and the client can escalate through step-up authorization.

SEP-1046 established a standard machine-to-machine OAuth path via client credentials, enabling headless agents, scheduled jobs, and agent-to-agent flows without requiring a user consent step. SEP-990, the Cross App Access specification, inserts the corporate identity provider back into the loop when an AI application connects to a third-party tool. The organization can see that an AI agent is acting as a specific user in a specific external system, rather than just seeing that a user logged in somewhere.

SEP-991 introduced Client ID Metadata Documents as the recommended default over Dynamic Client Registration. Clients host a static JSON metadata file at an HTTPS URL. Servers verify client identity without maintaining unbounded client databases.

What the specification provides, then, is the authentication and authorization plumbing. It does not tell you how to define roles, assign permissions, or enforce them at runtime. That design work belongs entirely to the implementer, and that gap is where most organizations are currently stalled.

Building a role taxonomy that reflects how agents actually operate

Diagram: Four Agent Roles, Four Risk Tiers. Visualizes: Visualize the four-tier agent role taxonomy described in the article as a ranked hierarchy from lowest to highest privilege: Read-Only (retrieve information, no write/update/delete access)…

Before writing a single permission rule, map the agent personas that exist, or will exist, in your environment. Not what agents theoretically do. What they are actually deployed to do.

The first instinct for most teams is to enumerate capabilities: what can this agent technically reach? That instinct produces overexposure. The more useful question is what the agent is for, because purpose is also the natural limit on what access is defensible. An agent that processes support tickets doesn't need access to billing infrastructure even if the same database server can technically serve both.

A four-tier starting structure covers most organizational contexts. Read-only agents retrieve information and hold no access to write, update, or delete tools. Workflow agents execute defined business processes with write access scoped to specific objects within those workflows. Admin agents manage infrastructure or configuration and warrant the same scrutiny as human admin accounts. Privileged agents require elevated access for specific tasks, use ephemeral credentials, and operate under time limits.

The practical value of a taxonomy is inheritance. When an engineer builds a new agent and assigns it to the Read-Only group, it inherits the read-only policy automatically. No per-agent permission negotiation required. The policy surface stays small; the failure modes stay predictable.

I've watched teams design roles around what agents do rather than what they're for, and it consistently produces the same overexposure problem as server-level RBAC, just one abstraction layer up. The roles end up granting access that nobody explicitly authorized in any meaningful sense, because the permissions accumulated incrementally as capabilities were added, not as decisions were made.

The taxonomy also produces something beyond policy enforcement: it becomes a governance document. A record that the organization made a deliberate choice about what each class of agent is permitted to touch. That record is essential when something goes wrong. The difference between "we have no idea what this agent accessed" and "we have a documented decision and we can compare it against the logs" is the difference between a manageable incident and an unbounded one.

Scoping tool permissions and translating roles into enforceable access lists

Three conditions have to hold simultaneously for tool-level access control to work. Every MCP request carries a verified identity. Each identity maps to a role with defined permissions. Each tool declares the scope it requires, enforced both at tool-list time and tool-call time.

A workable scope naming convention is: mcp:server:action. The MCP servers define which scope strings exist. The identity provider decides which agents or users receive those scopes.

A customer-facing agent should have crmlookupcustomer allowed and crmdeletecustomer denied. Same server; categorically different tools. A documentation agent should be able to search and read repository files but not create pull requests or merge branches. A scheduling agent should read and create calendar events but not delete them. In each case, the agent's role determines which tools are accessible, and the tool's declared scope makes that determination enforceable at runtime rather than on the honor system.

Parameter-level scoping adds a layer that matters more than it initially sounds. Calling a tool that reads files is one authorization decision. Calling that tool against a specific private document, database row, or secret store entry is a separate decision. These are not the same question, and mature implementations enforce both, because the second decision is frequently where the actual sensitive access happens.

SEP-835's incremental scope model reinforces least privilege at the operational level. Agents start with minimal scopes and escalate only when an operation requires it, avoiding the front-loading of permissions that go unused in a given session.

The permission list is also the answer to a question every security team will eventually ask: what did we decide this agent should be able to do? Treating it as a decision record, keeping it current, reviewing it on a defined cycle, changes the organizational relationship with agent deployment from implicit to explicit. That change has governance implications, but more practically, it changes what's possible in an investigation.

Enforcing RBAC at the gateway, not at the edge of each server

The alternative to centralized enforcement is each MCP server implementing its own access controls independently. That produces inconsistent policies, no unified audit trail, and gaps wherever any individual server's implementation is weak. A well-governed server can be undermined by a poorly governed one, because the agent moves between them freely.

Gateway enforcement operates at two distinct moments. At tool-discovery time, the model never sees forbidden tools in its context. If a tool doesn't appear in the list returned to the agent, the agent cannot attempt to invoke it. Eliminating the option is more reliable than blocking a request after it's been formed. At tool-execution time, if a model attempts to call a tool outside its permitted scope, the gateway denies the invocation before it reaches the server.

Per-invocation verification matters here. Authorization controls need to extend beyond initial authentication. Each tool invocation should be evaluated against the requesting agent's current permission set, which will vary based on context, the identity of the user the agent is acting on behalf of, and session state.

The confused deputy problem, raised earlier, is also solvable at the gateway. Token audience validation prevents a server from forwarding tokens with incorrect audiences to downstream services. That control only works reliably if it's centralized; a distributed approach depends on every individual server getting the validation right, which is not a reasonable operational assumption at scale.

Cross App Access at the gateway level gives the identity provider visibility into agent-to-tool connections, not just user logins. The organization gains a view of what AI is acting as which user in which external system. That visibility doesn't exist if enforcement is fragmented across servers.

A single policy surface. Consistent behavior across all servers regardless of individual server implementation quality. A real-time record of every tool invocation. The friction teams attribute to security governance is, in most cases, the friction of lacking a gateway, not the friction of having one.

What a complete RBAC implementation requires beyond the permission rules

A complete RBAC implementation requires infrastructure beyond the permission rules themselves, and the pieces that get skipped are usually the ones that matter most after an incident.

Start with a server registry. Every MCP server that agents can connect to needs a registry entry before it goes into service. An unregistered server is an identity the organization cannot account for, and unaccounted identities are what gets exploited. Registry entries establish server identity, ownership, approved tool list, permitted agent roles, and the policy version that governs it. If something goes wrong, the registry is where you start the investigation.

Real-time observability is distinct from logging, and conflating them is a common mistake. An audit log read after an incident is a postmortem tool. Visibility into what an agent is touching is only operationally useful if it's available during the session. The minimum signal needed: which agent, which tool, which resource, at what time, with what result. That signal, accessible in real time, is what turns an incident from a forensic exercise into a containable event.

Privileged agents should use time-limited, session-scoped credentials wherever possible. The privileged role carries the broadest access, which means the largest blast radius if compromised. Ephemeral credentials reduce the window of exposure; there is no elegant substitute for that.

It is also worth considering permission drift as an ongoing risk that most initial implementations underestimate. Roles and tool lists defined carefully at deployment accumulate additions over time, as agents take on new responsibilities without corresponding policy review. That drift quietly recreates the overexposure problem that RBAC was designed to prevent. Gartner projected in April 2026 that 25% of enterprise GenAI applications will experience five or more minor security incidents per year by 2028, up from 9% in 2025. The direction that implies is consistent with what's already visible in production environments: agents accumulating access, incidents becoming more frequent, organizations discovering the gaps only after exploitation.

Review cycles are part of the implementation, not optional additions to it. The same way dependency updates are part of maintaining software, not an afterthought.

The hardest question after an incident is: what did this agent access during this session? An organization that cannot answer that cannot scope the blast radius of a compromise. Gateway-level enforcement is what makes the question answerable, because the gateway is where the record lives.

How deliberate permission design changes the pace of agent deployment

The common assumption among development teams is that RBAC is a gate that slows them down. That assumption is understandable, and in some contexts it's accurate. Governance layers introduced late in a deployment cycle do create friction, because they force retroactive mapping of capabilities that were built without them in mind. The friction is real. But it belongs to the timing, not the practice.

Teams that define roles and tool-level permissions before building agents operate differently. When a new agent is scoped to an existing role, deployment requires no new security review. The role already carries an approved permission set, a documented rationale, and a known blast radius. The engineer's job becomes mapping the agent to the right role, not negotiating access from scratch on each deployment.

The same dynamic applies at the organizational level. When security and engineering share a role taxonomy, agent proposals arrive with a common vocabulary. The question stops being a vague "should we let this agent do things?" and becomes "does this agent fit the workflow role or the admin role?" That is a faster conversation, and a more honest one, because it forces a precise answer about what the agent is actually for.

Deliberately designed permissions don't constrain what agents can do; they constrain what agents can do without the organization having made a conscious choice about it. That shift, from implicit capability to explicit decision, is what makes agent deployment something an organization can govern, audit, and scale. Access accumulates the same way other organizational liabilities do: incrementally, invisibly, until the moment it isn't.

Sources

  1. coalitionforsecureai.org
  2. arxiv.org
  3. arxiv.org
  4. arxiv.org
Filed underMCP 101

More in MCP 101