Back to blog

Follow and Subscribe

Fastly is easier than ever to use with our Model Context Protocol (MCP) Server

Jaskirat Singh Randhawa

Sr. Product Manager, Compute, Fastly

Managing a powerful platform like Fastly shouldn't feel like a chore. While our CLI and APIs offer deep control, what if you could manage your services just by... asking?

Fastly MCP Server is a new open-source tool that makes managing your Fastly infrastructure and services as simple as having a conversation. It acts as a secure bridge to the Fastly CLI, translating your requests into commands and bringing the answers right back into your chat window. It’s a powerful new way to work, designed to make you faster by bringing the power of Fastly to your favorite AI developer tool.

Get Started in 60 Seconds

Ready to jump in? It couldn’t be easier.

1. Install the MCP server

The Fastly MCP Server is currently available as a standalone Go tool in the fastly/mcp GitHub repository. To use this tool, you just need a Fastly account and the CLI installed. 

2. Configure your AI Developer Tool

Choose your AI developer tool and follow the configuration steps:

Claude Desktop

Add to your Claude configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "fastly": {
      "command": "/path/to/fastly-mcp",
      "args": []
    }
  }
}

Claude Code

Simply run this command:

claude mcp add fastly /path/to/fastly-mcp

Roo Code

  1. Click the MCP button in Roo Code

  2. Select "Edit Global MCP" or "Edit Project MCP"

  3. Add the following configuration:

{
  "mcpServers": {
    "fastly": {
      "command": "/path/to/fastly-mcp",
      "args": []
    }
  }
}

3. Your First Prompt

Let’s try a classic "hello world" for the MCP age.

👤 You: "Show me all my Fastly services"
🤖 AI: "I'll list all your Fastly services for you..."

That’s it! You’re now using MCP to interact with an AI developer tool.

Asking Claude to create and attach a KV store to a service. This video has been accelerated. LLM text generation has not yet reached comparable speeds.

We know you don’t take security lightly when it comes to managing your infrastructure, and the Fastly MCP Server is designed with this in mind. It operates by wrapping Fastly CLI commands in an MCP-compliant interface. This means you simply need to authenticate in your Fastly CLI, and the MCP server will then make calls through it. That way your Fastly API keys never get exposed to an LLM, preventing a whole class of prompt-engineering attacks. Frank Denis’ blog on leaky MCP servers explains how API keys are securely handled. 

But what can it do for you? Here are some prompts you can try right now. 

CDN Configuration Management: Easily create, list, update, or delete Fastly services, manage versions, and configure domains and backends using natural language prompts. Ask your AI tool to “Create a new Fastly service named 'my-app-service'” or “Add the domain 'example.com' to 'my-app-service'.” The MCP server handles the underlying API complexities.

Cache Management & Purging: Defining cache settings or instantly purging cached content becomes effortless. Instruct your AI tool to “Purge the cache for 'www.example.com/image.png'” or “Set a default TTL of 1 hour for my 'blog-service'.” The AI confirms the action, eliminating any manual steps.

Performance Insights: Retrieve statistics and metrics to understand performance and identify optimization areas. Ask, “What’s the traffic pattern for my main site over the last week?” or “What’s my current cache hit ratio for 'image-assets-service'?” The AI tool, powered by the MCP server, fetches and presents this data in an understandable format, even suggesting optimizations.

But please, don’t take my word for it, try these prompts out for yourself and let us know what you discover in the Fastly Community Forum. This is where the magic will happen. We want to hear everything:

Your feedback: What do you love? What’s confusing?

Bug reports: Did something break? Let us know!

Feature requests: What’s the one thing you wish MCP could do?

And most importantly... your prompts!: Share your most creative, powerful, and mind-bendingly useful prompts and prompt chains.

Fastly MCP is more than just a tool; it’s the start of a conversation. The real power of this project lies in the community that will form around it. And for that, we need you.