Cloudflare has published a production-grade threat model and policy architecture for Model Context Protocol traffic, covering detection, identity enforcement, prompt injection blocking, and lateral movement prevention across three control surfaces. The announcement arrives as MCP adoption has expanded beyond engineering teams at Cloudflare itself into product, sales, marketing, and finance.

The core risk is speed without bounds. A human engineer deploying to production or querying a sensitive database is constrained by human judgment and human pace. An AI agent is not. A wrong decision can replicate into thousands of incorrect actions before anyone notices. MCP amplifies this because a single line of configuration connects an agent to a tool server, and the resulting traffic has no obvious network signature — MCP uses no guaranteed hostname and does not require /mcp in the path.

Cloudflare's architecture carves out three intervention points. First: inside the MCP client, a hook that fires after the model selects a tool can deny unapproved servers, strip sensitive arguments, or prompt for human confirmation. This is the earliest intercept and the only plane that sees local stdio MCP servers that generate no network traffic. The limit is standardization — controls must be reproduced across every client employees use. Second: Cloudflare Gateway inspects HTTP traffic after it leaves the device. With TLS decryption, Gateway correlates requests to users and devices, applies DLP policies, and blocks direct connections to unapproved servers. Third: the server itself. Cloudflare's AI Security for Apps within the WAF inspects inbound MCP traffic for prompt injection, sensitive data leakage, and topic violations.

Cloudflare's three-layer MCP defense: client hook intercepts before network egress; Gateway inspects HTTP traffic; server-side WAF covers inbound requests.
FIG. 02 Cloudflare's three-layer MCP defense: client hook intercepts before network egress; Gateway inspects HTTP traffic; server-side WAF covers inbound requests. — Cloudflare blog, blog.cloudflare.com/mcp-security-updates/

Shadow MCP detection is the operationally interesting new piece. Cloudflare Gateway runs multi-layer scans to surface remote MCP servers employees are hitting outside approved portals. Detection layers include hostname matching for known servers like mcp.stripe.com, wildcard subdomain patterns, path patterns (/mcp, /mcp/sse), and DLP body inspection that scans POST payloads for JSON-RPC markers like "method": "tools/call". The DLP body scan has a hard ceiling: the first 1,024 bytes of the POST body only, using Rust regex syntax.

Detection LayerMethodDetails / Constraints
Hostname matchingKnown server name lookupMatches explicit hostnames such as mcp.stripe.com
Wildcard subdomain patternsPattern-based subdomain scanCatches MCP-related subdomain variants
Path patternsURL path matchingMatches /mcp and /mcp/sse
DLP body inspectionPOST payload scanLooks for JSON-RPC markers e.g. "method": "tools/call"; limited to first 1,024 bytes; uses Rust regex syntax
FIG. 03 Shadow MCP detection layers in Cloudflare Gateway — Cloudflare blog, blog.cloudflare.com/mcp-security-updates/; developers.cloudflare.com/cloudflare-one/tutorials/detect-mcp-traffic-gateway-logs/

Traffic routing through MCP Server Portals adds enforcement. When Gateway routing is enabled, every tool call from the portal proxies through Gateway before reaching the upstream server. Two constraints: Gateway routing only supports Streamable HTTP transport, so servers using SSE endpoints (/sse) will fail. Background tool and prompt synchronization — running every two hours with admin credentials — does not route through Gateway, creating a visibility blind spot.

GapDescription
DLP scan ceilingBody inspection covers only the first 1,024 bytes of a POST request
Transport constraintGateway routing requires Streamable HTTP transport; servers using SSE endpoints (/sse) will fail
Background sync blind spotTool and prompt synchronization runs every two hours using admin credentials and does not route through Gateway
stdio invisibilityClient-side hook is the only plane that sees local stdio MCP servers — Gateway cannot observe them
FIG. 04 Known gaps and constraints in Cloudflare's MCP Portal + Gateway enforcement — Cloudflare blog, blog.cloudflare.com/mcp-security-updates/; developers.cloudflare.com/cloudflare-one/access-controls/ai-controls/mcp-portals/

Real incidents illustrate what this framework defends against. In June 2025, a team collaboration tool's MCP integration leaked customer data across instances, forcing a two-week outage. CVE-2025-6514 hit an npm package widely used for MCP authentication. NeighborJack research found hundreds of MCP servers bound to 0.0.0.0 without firewall rules, open to OS command injection and host takeover. One documented confused deputy attack saw an agent with high-level privileges execute SQL commands embedded in a support ticket, compromising an entire database.

IncidentDateImpact
Team collaboration tool MCP integration data leakJune 2025Customer data leaked across instances; two-week outage
CVE-2025-6514 — npm MCP auth package2025Vulnerability in npm package widely used for MCP authentication
NeighborJack research: MCP servers on 0.0.0.02025Hundreds of servers exposed without firewall rules; open to OS command injection and host takeover
Confused deputy attack via support ticketDocumented (year unspecified)Agent executed SQL commands embedded in ticket; entire database compromised
FIG. 05 Documented MCP security incidents referenced in Cloudflare's threat model — Cloudflare blog, blog.cloudflare.com/mcp-security-updates/

Gateway-based shadow detection plus Portal-enforced routing provides the widest network-layer coverage. But the 1,024-byte DLP scan limit, the SSE-to-Streamable-HTTP transport constraint, and the background sync gap mean perimeter detection is necessary but not sufficient — server-side WAF rules and client-side hooks carry independent weight.