# How Cloudflare detects MCP traffic and helps secure it

[Cloudflare](https://yomu.fyi/company/cloudflare) · AJ Gerstenhaber · Aug 14, 2026

**Type:** Announcement

## Summary

Traditional security boundaries assume human speed and judgment, but AI agents execute nondeterministic actions rapidly and can invoke unapproved Model Context Protocol servers through standard HTTPS traffic. To mitigate this shadow traffic, Cloudflare One introduces detection and inspection capabilities across clients, network boundaries, and MCP servers. Cloudflare Gateway leverages protocol-level headers and JSON-RPC inspection to identify direct MCP connections, verify managed paths, and enforce access through approved MCP Server Portals. Furthermore, Cloudflare Agents SDK v0.20.0 implements the stateless 2026-07-28 MCP specification while providing fallback handshakes for legacy servers. Organizations can combine Gateway traffic source rules with server middleware like WriteGuard to block unauthorized tool invocations before execution.

## Context

AI agents execute nondeterministic tool calls at machine speed, creating risks where a single incorrect decision can rapidly trigger thousands of harmful actions. Model Context Protocol traffic often looks like ordinary HTTPS API calls without distinct hostnames or paths, allowing employees to configure unapproved shadow MCP servers across various AI clients without administrative visibility.

## Approach / What changed

Cloudflare One introduces inspection capabilities across three control points: MCP clients, the network gateway, and MCP servers. Cloudflare Gateway classifies MCP requests using protocol headers and JSON-RPC payload inspection, blocks direct unapproved connections, and enforces routing through MCP Server Portals. Additionally, Cloudflare Agents SDK v0.20.0 adds support for the stateless 2026-07-28 MCP specification with backward-compatible fallbacks, while server-side middleware like WriteGuard enforces tool permissions and risk tiers before execution.

## Takeaways

- MCP requests can be controlled at three distinct layers: inside the client hook before serialization, at the network boundary via a secure web gateway, and on the server before tool handler execution.
- Model Context Protocol requests carry inspection signals such as MCP-Protocol-Version, Mcp-Method, and Mcp-Name headers, alongside tool arguments encapsulated within the JSON-RPC envelope.
- Cloudflare Agents SDK v0.20.0 supports the stateless 2026-07-28 MCP specification using server/discover probes, while maintaining backward compatibility with legacy initialization handshakes.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [LLMs](https://yomu.fyi/topic/llm), [Observability](https://yomu.fyi/topic/observability)

[Read original post](https://blog.cloudflare.com/mcp-security-updates)
