Fastly CDN MCP server

Enables management of Fastly CDN services through authenticated API requests and CLI commands for DevOps teams using natural language interactions.
Back to servers
Provider
Arodoid
Release date
Apr 16, 2025
Language
TypeScript
Stats
6 stars

Fastly MCP brings the power of Fastly's API directly to your AI assistants through the Model Context Protocol (MCP). This server lets you securely manage and interact with Fastly services through natural language without exposing your API key to the AI model itself.

Prerequisites

Installation

To set up the Fastly MCP server:

  1. Ensure you have Node.js 16 or higher installed
  2. Clone the repository or download the server files
  3. Install dependencies:
npm install

Configuration

Connect your AI assistant with the MCP server by adding the following configuration:

{
  "mcpServers": {
    "fastly": {
      "command": "node",
      "args": ["path/to/fastly-mcp.mjs"],
      "env": {
        "FASTLY_API_KEY": "your_fastly_api_key"
      }
    }
  }
}

Be sure to replace "your_fastly_api_key" with your actual Fastly API key and adjust the path to the server file as needed.

Usage Capabilities

With Fastly MCP configured, you can ask your AI assistant to:

Manage CDN Services

  • Create, configure, and deploy content delivery services
  • Set up cache strategies and perform instant purges
  • Configure security settings including WAF, DDoS protection, and TLS certificates

Monitor Performance

  • Access real-time metrics and historical stats
  • View traffic patterns and analytics
  • Check cache hit ratios and other performance indicators

Implement Edge Logic

  • Deploy custom VCL or Compute@Edge applications
  • Automate workflows with CI/CD pipelines

Example Queries

Here are examples of questions you can ask your AI assistant:

Basic Operations

  • "Show me all my Fastly services"
  • "What domains are configured for my e-commerce service?"
  • "Purge the cache for my product service"
  • "What's the traffic pattern for my main site over the last week?"
  • "Show me the backend servers for my API service"
  • "What's my current cache hit ratio?"

Advanced Operations

  • "Analyze the configuration for my service and suggest optimizations based on its traffic profile, prioritizing low latency."
  • "Configure my service for optimal live video streaming."
  • "Identify potential configuration conflicts in my service compared to standard e-commerce delivery patterns."
  • "Optimize caching for my service to handle 10-second video chunks efficiently, minimizing origin load."
  • "Review the WAF rules for my service and suggest stricter settings to mitigate potential SQL injection attacks."
  • "Set up Mutual TLS (mTLS) authentication between Fastly and the origin servers."
  • "Analyze logs for my service from the past 24 hours to identify the root cause of the recent spike in 5xx errors."

Security Note

A key benefit of this MCP server is that your AI assistant never sees your Fastly API key. It communicates with the local FastlyMCP helper which securely handles the authentication with Fastly's API.

Additional Resources

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later