Back to Devoured - July 13, 2026
DEVOURED
How to protect your MCP Server with Fastly

How to protect your MCP Server with Fastly

DevOps Fastly
Fastly developed a prototype security architecture for Model Context Protocol (MCP) servers using edge-based WAF and bot management.
What: The prototype, tested by a global publisher, combines Fastly’s WAF and bot management to mitigate LLM-specific threats like prompt injection while maintaining sub-50ms latency.
Why it matters: Securing MCP servers is critical because they bridge natural language interfaces with sensitive enterprise data, creating a high-risk attack surface that traditional API firewalls do not fully address.
Deep dive
  • Threat Mitigation: Blocks non-standard content types and mitigates OWASP and LLM-specific injection attacks.
  • Performance: Achieved sub-50ms latency during a 10-week trial.
  • Authentication: Supports diverse models including mTLS and token-based auth at the edge.
  • Traffic Optimization: Uses Fastly Media Shield to anchor traffic and reduce origin load.
Decoder
  • Model Context Protocol (MCP): An open standard that enables AI models to interact with external tools and data sources in a unified way.
  • WAF (Web Application Firewall): Security software that filters, monitors, and blocks malicious HTTP/HTTPS traffic to a web application.
Original article

As organizations rapidly adopt AI agents and agentic workflows, Model Context Protocol (MCP) servers are becoming a foundational integration layer between AI models and enterprise systems. While they accelerate development and simplify tool integration, they also introduce a new class of security challenges. Unlike traditional API traffic that’s typically deterministic and narrowly scoped, MCP traffic enables dynamic tool discovery, natural language-driven interactions, and orchestration across trust boundaries. These characteristics expand the attack surface and require security controls that extend beyond conventional API protection.

When a major global publisher approached Fastly asking for help securing their MCP server backbone connecting their AI agents with real-time financial data and tools, our team sprang into action to build a prototype that any organization can follow the architecture of to protect theirs. The following outlines the process and outcomes they achieved, providing a practical reference for organizations working to secure their own MCP environments.

Fastly MCP Protection Prototype

To protect their MCP server, the Fastly prototype needed to adhere to three key requirements:

  • Detect and mitigate AI-specific attack vectors – OWASP and AI-specific attacks targeting the MCP server must be mitigated
  • Ensure production-scale performance – Sub-100ms latency is mandatory and the solution must handle at least 100Mbps throughput
  • Allow authentication complexity – A mix of IP-based, token-based, and mTLS authentication models must be allowed without false positives

To address these requirements, the prototype combined the flexibility and customization of multiple existing Fastly capabilities. While we won’t dive into the details of their unique implementation, each of these solutions provided the customer with another layer of protection for their MCP server.

Here’s how the prototype paired them together to solve the customer’s requirements:

  • Fastly’s Global Network provides more than just 578 Tbps global capacity and performance benefits, enabling customers to implement custom traffic logic as it enters the network. This configuration flexibility allowed rules to be implemented as intended MCP traffic hit our network that automatically blocked unexpected content types like xml and restrict HTTP methods.
  • Fastly Bot Management provides visibility into the automated traffic heading to the MCP server, allowing rules to be created to block unwanted automation clients, bots with bad fingerprints, and generally malicious bot traffic.
  • Fastly Next-Gen WAF provides the ability to mitigate OWASP attacks and LLM-specific attacks like encoded prompt injection and jailbreak phrases. The prototype leverages its rate limiting capabilities to incorporate policies against IPs or API keys that exceeded expected norms.
  • Fastly Media Shield provides a designated Fastly POP as anchor for all MCP server traffic before it ultimately goes to origin. This enables the prototype to reduce origin load while speeding up connections by reducing the time required for costly multi-roundtrip handshakes.

Key results

With these four solutions implemented and tuned for protecting the customer’s MCP server, the team ran a 10-week trial to see how it stacked up against the customer’s requirements and found it far exceeded them.

Requirement Desired Metric Result
Latency (average) < 100ms Sub 50 ms
Upload throughput 100 Mbps Achieved
Max payload size 200MB+ 500MB+ without timeouts
Authentication Flexibility IP-based, token-based, and mTLS model acceptance Achieved

Fastly for AI Infrastructure

Fastly's platform is uniquely positioned in the request path to secure and accelerate AI agent infrastructure because it was purpose-built for the edge where performance and security must coexist.

  • Performance without compromise: Inspection adds negligible latency; Fastly's global scale and resilience keeps AI agents performant
  • Programmable security: Network and Next Gen-WAF rules can be tuned for the novel patterns of MCP and agentic traffic
  • Real-time visibility: Security teams see everything, in near real-time, without waiting for batch log exports
  • AI-native threat mitigation: Policies for prompt injection, tool abuse, and bot-driven enumeration can be easily created and paired with out-of-the-box OWASP-style attack protections

As AI and associated technologies continue to rise in adoption, Fastly’s MCP server protection prototype is just one example of how Fastly can help your business confidently adopt emerging technologies without increasing risk.

Explore all 70 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi