Model Context Protocol, or MCP, is quickly becoming the connective tissue between AI agents and the systems they can read from or act on. That is exactly why security teams are paying closer attention. Operator discussions on Reddit now routinely question whether MCP deployments are shipping too much trust by default, and the formal MCP documentation now includes detailed authorization guidance and a dedicated security best practices section. The pattern is familiar: a useful new integration layer arrives, developers move fast, and identity, network control, and audit discipline lag behind.
For cloud security teams, the right response is not to ban MCP. It is to treat MCP servers the same way you would treat any other privileged integration point: as part of the control plane, not as a convenience script. That means no implicit trust, no shared long-lived tokens, no unrestricted outbound access, and no tool execution without clear policy context. This article lays out a practical zero trust design for MCP servers, the failure modes that matter most, and a 90-day rollout plan that can move from pilot to governed production.
Why MCP servers deserve a zero trust architecture
NIST SP 800-207 defines zero trust around a simple principle: never grant trust based only on network location or presumed environment. Every request should be evaluated using identity, device or workload context, policy, and the sensitivity of the target resource. MCP servers fit that model perfectly because they sit between an AI client and tools that often reach into tickets, source code, cloud APIs, SaaS platforms, and internal knowledge stores.
What makes MCP different from a normal API gateway is that the caller is not just a human or a service. It is often a model-driven workflow that can chain many actions, reinterpret text as instructions, and discover tools dynamically. If that workflow is compromised by prompt injection, poisoned tool descriptions, a weak approval model, or a mis-scoped token, the MCP server becomes a force multiplier for the attacker.
If you have already worked on workload identity federation for multi-cloud AI pipelines, identity-aware egress for AI agents, or session-scoped identity for AI agents, the next logical step is to bring those same disciplines into your MCP layer.
A practical reference architecture for zero trust MCP
A production-grade MCP deployment should separate five control concerns instead of collapsing them into one server process.
1. Identity plane. The MCP client authenticates to the MCP server using a standard mechanism appropriate to the transport. For remote HTTP-based MCP, the specification points implementers toward OAuth-based authorization and protected resource metadata. The important design choice is audience separation: the token presented to the MCP server must be issued for the MCP server, not copied from some upstream SaaS API.
2. Policy decision plane. Every tool invocation should be evaluated against policy inputs such as user identity, agent identity, tenant, environment, tool name, requested action, target system, and data sensitivity. Open Policy Agent is a practical fit here because it gives teams versioned, testable policy that can be reviewed like code instead of buried inside prompts or ad hoc conditionals.
3. Tool execution plane. High-risk tools should run behind a broker or adapter layer, not directly inside the same trust boundary as the protocol handler. That broker can mint short-lived downstream credentials, enforce parameter validation, strip unsafe defaults, and block dangerous argument combinations before a tool ever reaches the target API.
4. Egress control plane. Outbound network traffic from MCP servers should traverse an egress proxy or firewall policy that denies internal RFC1918 ranges, localhost, link-local addresses, and cloud metadata endpoints unless explicitly required. This is the simplest way to reduce SSRF risk during metadata discovery, document retrieval, or tool execution.
5. Audit and approval plane. Logs should preserve who requested the action, which agent session issued it, which tool was selected, what policy decision was returned, which downstream identity was minted, and whether a human approval gate fired. Without that chain, you may have logs, but you will not have accountability.
The trade-off is explicit: brokered execution and short-lived credentials add complexity and some latency, but they dramatically reduce blast radius and make incident review far more precise.
The failure modes that break most early MCP deployments
Token passthrough. The MCP security guidance explicitly calls token passthrough an anti-pattern. If the client hands the server a token for some downstream API and the server simply forwards it, you lose audience control, weaken audit quality, and make it easier to bypass server-side rate limits or validation logic. Cloudflare describes the safer pattern for remote MCP: store upstream tokens securely and issue server-scoped tokens to clients instead of leaking upstream credentials.
Confused deputy behavior. The MCP security best practices document spends unusual detail on this because it is easy to miss in proxy-style designs. If your MCP server acts as an OAuth client to a third-party API and also accepts many MCP clients, weak consent handling can let one client exploit another user’s existing consent state. Per-client consent, exact redirect URI matching, and strong state validation are not optional hygiene here; they are foundational.
Metadata discovery SSRF. MCP clients and servers may fetch URLs derived from authentication and metadata exchanges. The specification warns that malicious endpoints can point clients at internal services, localhost, or cloud metadata IPs. If your platform allows broad outbound access, a protocol convenience feature can turn into credential theft or internal reconnaissance.
Shared API keys and tenant ambiguity. Many teams start with one API key per MCP server for speed. That choice makes every invocation look the same downstream. It destroys per-user accountability, complicates customer isolation, and turns one exposed secret into a broad compromise path.
Unbounded tool authority. OWASP’s guidance for LLM applications highlights excessive agency and prompt injection as systemic risks. In MCP terms, that means a tool catalog that is too broad, too weakly typed, or too trusted. A model should not be able to jump from reading documentation to rotating credentials or deleting resources without a distinct trust transition.
Tool poisoning and unsafe descriptions. Recent research and community discussion around MCP attacks have focused on poisoned tool metadata and notification flows that manipulate agent behavior. Even if your server code is technically correct, unsafe instructions embedded in tool descriptions, resources, or retrieved content can steer the model toward dangerous tool use unless your policy layer treats model output as untrusted input.
Control patterns that hold up in production
Bind identity to the MCP server first. Make the MCP server the only direct resource server from the client’s perspective. Then let the MCP server obtain or mint downstream credentials that are audience-restricted, short-lived, and policy-constrained. RFC 8693 token exchange is one standards-based way to think about this pattern when brokering identities across services.
Adopt per-tool, per-action policy. Do not write a single rule that says a user may access an MCP server. Write rules that evaluate whether a given subject may run this tool, against this target, in this environment, with these parameters. Good policies also distinguish between read, write, and destructive actions.
Tier tools by risk. A useful production pattern is three tiers: informational tools, bounded mutation tools, and high-impact tools. Informational tools can run automatically if data classification allows it. Bounded mutation tools require stricter scope checks and parameter validation. High-impact tools such as infrastructure changes, credential actions, or customer data export should require explicit approval or a second factor in the workflow.
Use workload identity instead of stored secrets. If the MCP server needs cloud access, prefer federation or service-issued temporary credentials over static secrets in environment variables. This keeps downstream identity tied to workload context and shortens the lifetime of useful stolen credentials.
Make egress policy default-deny. Allow only the domains, APIs, and SaaS providers a given tool truly needs. For generic fetch or browser-style tools, add additional restrictions such as metadata IP blocking, DNS rebinding protections, redirect limits, and content size limits.
Preserve decision context in logs. Log the normalized request, tool selection, policy input, policy result, approval result, and downstream principal. During incident response, the question is rarely just “what API was called?” It is “who caused this call, through which agent run, under which policy, with which justification?”
A 90-day rollout plan
Days 0 to 30: inventory and containment. Catalog every MCP server, client, tool, downstream API, and credential in use. Disable unused tools. Replace any shared administrator tokens with scoped identities. Add egress restrictions for metadata endpoints, localhost, and internal address space. For remote deployments, verify that tokens presented by clients are actually intended for the MCP server.
Days 31 to 60: policy and brokering. Introduce a policy engine in front of tool execution. Move high-risk tools behind adapters that validate arguments and issue short-lived downstream credentials. Establish risk tiers for tools and turn on explicit approvals for destructive classes of action. Standardize log fields across all MCP services and forward them to your SIEM.
Days 61 to 90: hardening and measurement. Add automated tests for policy regressions, redirect URI validation, and approval bypass attempts. Exercise prompt injection and tool poisoning scenarios in pre-production. Require evidence that every production tool has an owner, a data classification, an approved egress profile, and a rollback path. At this stage, your goal is not perfect prevention. It is controlled, observable operation with sharply reduced blast radius.
Metrics that actually show progress
Track the percentage of MCP tools covered by policy evaluation, the percentage using short-lived downstream credentials, the number of tools still backed by shared secrets, the number of high-risk tools with an approval step, and the rate of denied versus approved high-risk requests. Add operational quality metrics too: median approval time, failed policy deployments caught in testing, and incident investigations where full request-to-action lineage was available. These metrics show whether zero trust is becoming real engineering practice rather than slideware.
Actionable recommendations
- Treat MCP servers as privileged control-plane components, not helper scripts.
- Ban token passthrough and require audience-restricted server-side identity.
- Enforce per-tool policy with explicit read, write, and destructive distinctions.
- Put high-risk tools behind adapters that validate parameters and mint short-lived credentials.
- Apply default-deny egress rules, especially for internal IP ranges and metadata services.
- Require human approval for destructive actions and customer data export.
- Keep tool catalogs small, typed, owned, and regularly reviewed.
- Log subject, session, tool, policy result, approval result, and downstream principal for every sensitive call.
FAQ
Are local MCP servers automatically safer than remote ones?
No. Local transport reduces Internet exposure, but it does not remove risks from prompt injection, poisoned tools, overbroad local credentials, or unsafe outbound access.
Can I let the client provide the API key for the downstream service?
That is usually the wrong default. It weakens audience separation and makes it harder to apply consistent server-side controls and audit.
Do all high-risk tools need human approval every time?
Not necessarily. Mature teams often use conditional approvals based on environment, data sensitivity, target system, and action class. The important point is to make the approval rule explicit and testable.
What should I review first if I inherit an existing MCP deployment?
Start with token handling, outbound network policy, shared secrets, tool inventory, and whether logs can reconstruct a full request-to-action lineage.
What is the fastest safe improvement?
Turn on egress restrictions and remove shared long-lived credentials. Those two changes close a surprising amount of risk quickly.
References
- Model Context Protocol Authorization
- Model Context Protocol Security Best Practices
- NIST SP 800-207: Zero Trust Architecture
- NIST SP 800-53 Rev. 5
- OWASP Top 10 for LLM Applications
- Open Policy Agent Documentation
- RFC 8693: OAuth 2.0 Token Exchange
- Cloudflare: Build and deploy Remote Model Context Protocol servers
- CyberArk: MCP Security Flaws
- Invariant Labs: MCP tool poisoning attacks
- Reddit discussion: Anyone else concerned about MCP security?





