# Fastly MCP server

> Lets an AI client search, inspect, and execute Fastly API methods to manage CDN services, domains, dictionaries, and purges.

- Repository: https://github.com/fastly/mcp
- Page: https://hostedmcp.org/servers/fastly/mcp
- Transport: stdio
- Stars: 40
- License: MIT

## Install

### Claude Code

```sh
claude mcp add mcp -- npx -y @fastly/mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@fastly/mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@fastly/mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@fastly/mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@fastly/mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp -- npx -y @fastly/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp]
command = "npx"
args = ["-y", "@fastly/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp npx -- -y @fastly/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@fastly/mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `FASTLY_API_TOKEN` | no | no |  |
| `FASTLY_MCP_ENCRYPT_SECRETS` | no | no |  |

## FAQ

### How do I connect the Fastly MCP server to Claude Desktop?

Add the generic JSON server block to Claude Desktop's configuration file and restart the app. The block runs the server with bunx and passes your Fastly API token through the environment.

### What authentication does the Fastly MCP server use?

It uses a Fastly API token, supplied as FASTLY_API_TOKEN in the client configuration or shell environment. Read-only tokens are recommended for investigation and write tokens only when changes are intended.

### What can the assistant do with Fastly through this server?

It can look up services, inspect domains and TLS settings, check traffic and usage, manage dictionaries and ACLs, purge content, and make configuration changes when asked.

### What happens when a result is too large for one response?

The server writes the full result to a JSON file in the temporary directory and returns the path in resultFile along with a short preview in result.
