# Fastly MCP

> Fastly MCP manages your edge cloud delivery and CDN infrastructure entirely through natural conversation. You can deploy instant security patches by promoting service versions, audit backend origins (AWS/GCP), purge global cache instantly via a simple chat command, or map specific domains to verify routing rules—all without touching a dashboard.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** cdn, edge-computing, waf, cache-purging, web-security, network-optimization

## Description

Think of this MCP as giving your AI client direct, conversational access to the core controls of your CDN. You stop logging into multiple consoles and start talking to your infrastructure instead. Your agent can look up every service you run, tell you which version is actually serving live traffic right now, or check if a specific domain name points to the correct edge location.

It handles everything from coordinating complex deployments—like moving a drafted configuration to active status—to emergency maintenance tasks, such as issuing an absolute HTTP PURGE across all global data centers. If you already use Vinkius for other integrations, adding Fastly means one place controls your entire network stack. It lets you manage backend origins and verify port constraints while keeping track of which architectural instance is controlling live traffic today.

## Tools

### activate_service_version
Promotes a specific draft configuration version of a service to active status immediately.

### create_service
Initializes and creates an entirely new Fastly content delivery network service in your account.

### delete_service
Permanently removes a specified Fastly service from your cloud infrastructure.

### get_me
Retrieves basic information about the API token identity linked to the MCP connection.

### get_service
Pulls all core details and status information for a named Fastly service.

### get_service_stats
Retrieves usage statistics, including performance metrics, for a specific running service.

### get_service_version
Gets detailed information about an individual configuration version of a service.

### list_version_backends
Lists all physical upstream origins (AWS, GCP) mapped within a specific service configuration version.

### list_version_domains
Retrieves a list of domain names associated with a particular service version.

### list_services
Provides an inventory of all existing Fastly services managed by your account.

### list_service_versions
Fetches a complete list of every configuration version draft and active state for one service.

### purge_all_cache
Issues an absolute HTTP PURGE command, invalidating all cached content globally for a target service.

## Prompt Examples

**Prompt:** 
```
List all active Fastly services
```

**Response:** 
```
Retrieving services... I found 3 CDN services: 'Prod-Main-CDN' (ID: 1a2b), 'Staging-App' (ID: 3c4d), and 'Media-Assets' (ID: 5e6f). All are currently terminating traffic across the edge network. Which one would you like to inspect?
```

**Prompt:** 
```
Activate version 15 for service 'Prod-Main-CDN'
```

**Response:** 
```
Version 15 promoted! I've successfully activated the drafted configuration for 'Prod-Main-CDN'. The changes are now live across all global points-of-presence. I'll monitor the traffic health for you.
```

**Prompt:** 
```
Purge all cache for service '1a2b'
```

**Response:** 
```
Cache purge initiated! I've issued a global HTTP PURGE for service 1a2b. All static content has been invalidated, and the network will fetch fresh data from your origins immediately.
```

## Capabilities

### Deploy Service Versions
You tell the MCP to promote a configuration draft or activate an existing version for immediate service rollout.

### Manage CDN Services
You can create, delete, and get detailed status information on every Fastly service running in your account.

### Purge Global Cache
The MCP issues a command to wipe all cached content for a specific service globally, forcing fresh data retrieval from the source.

### Audit Network Details
You can list and verify domains attached to your services or check the physical upstream origins mapped within configurations.

## Use Cases

### Rolling out an emergency security patch.
A Security Engineer needs to deploy a zero-day fix. Instead of manually logging into the console and promoting drafts, they simply ask their agent: 'Activate version 12 for service X.' The MCP executes `activate_service_version` instantly, making the changes live globally.

### Troubleshooting a broken website image.
A Frontend Developer notices an old logo is showing up. They instruct their agent to 'Purge cache for service Y.' The MCP runs `purge_all_cache`, clearing the global CDN and forcing the network to grab the fresh version from the origin.

### Verifying complex routing rules.
A Cloud Architect needs to know which domains are attached to a staging environment. They prompt their agent to run `list_version_domains` against the specific service version, getting an immediate list of all FQDNs terminating there.

### Checking backend dependencies before deletion.
An SRE needs to decommission a service but must first confirm its connection points. They use `list_version_backends` on the target service version, verifying every mapped origin (AWS/GCP) is accounted for before running `delete_service`.

## Benefits

- Instantly deploy patches. Use the `activate_service_version` tool to promote a draft configuration, moving changes from test environments straight into production traffic.
- Never worry about stale content again. A single prompt using `purge_all_cache` issues an absolute HTTP PURGE across all global points of presence for immediate data freshness.
- Audit your network easily. You can run `list_version_domains` to verify every FQDN apex domain terminating at the edge, or use `list_services` to get a full inventory count.
- Verify your infrastructure depth. Use `list_version_backends` to pinpoint the physical upstream origins (AWS/GCP) mapped inside any service version, ensuring no load balancer is missed.
- Manage entire services lifecycle. You can list all running assets with `list_services`, get performance metrics via `get_service_stats`, and even clean up old infrastructure using `delete_service`.

## How It Works

The bottom line is that you use natural language to execute complex infrastructure commands without needing developer credentials or manual dashboard navigation.

1. Subscribe to this MCP and provide your Fastly API token from your account control panel.
2. Connect your AI client (Claude, Cursor, etc.) to Vinkius and activate the Fastly toolset.
3. Start by asking your agent a direct question, like 'What services need cache purging?' or 'List all domains attached to service X.' 

## Frequently Asked Questions

**How do I purge the cache using Fastly MCP?**
You use the `purge_all_cache` tool by specifying the service ID. This sends a global HTTP PURGE command, invalidating all static content immediately.

**Can I see what domains are attached to my services with Fastly MCP?**
Yes, you can use `list_version_domains` to get an exact list of FQDN apex domains tied to a specific service version for auditing.

**What is the difference between creating and activating a service version with Fastly MCP?**
Creating (`create_service`) builds a new, draft configuration. Activating (`activate_service_version`) promotes that existing, tested draft to live traffic status.

**Does Fastly MCP help me find my backend origins?**
Absolutely. Use `list_version_backends` to list all physical upstream Origins (AWS/GCP) associated with a given service version, helping you verify connectivity points.

**What if I need to delete a Fastly service? Which tool should I use?**
Use the `delete_service` tool. However, always run `list_version_backends` first to ensure no other services rely on that infrastructure.