Fastly MCP Server

Search, inspect and call the whole Fastly API from an assistant through three tools

Official · Fastly JavaScript Local · stdio Cloud platformsDevOps and monitoring

47 popularity score ★ 39 ↓ 309/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs FASTLY_API_TOKEN. Replace each <NAME> with your value.

Claude CodeTerminal
claude mcp add fastly -e FASTLY_API_TOKEN=<FASTLY_API_TOKEN> -- bunx -p @fastly/mcp fastly-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "fastly": {
      "command": "bunx",
      "args": [
        "-p",
        "@fastly/mcp",
        "fastly-mcp"
      ],
      "env": {
        "FASTLY_API_TOKEN": "<FASTLY_API_TOKEN>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "fastly": {
      "command": "bunx",
      "args": [
        "-p",
        "@fastly/mcp",
        "fastly-mcp"
      ],
      "env": {
        "FASTLY_API_TOKEN": "<FASTLY_API_TOKEN>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "fastly": {
      "type": "stdio",
      "command": "bunx",
      "args": [
        "-p",
        "@fastly/mcp",
        "fastly-mcp"
      ],
      "env": {
        "FASTLY_API_TOKEN": "<FASTLY_API_TOKEN>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.fastly]
command = "bunx"
args = ["-p", "@fastly/mcp", "fastly-mcp"]

[mcp_servers.fastly.env]
FASTLY_API_TOKEN = "<FASTLY_API_TOKEN>"
Gemini CLITerminal
gemini mcp add --scope user -e FASTLY_API_TOKEN=<FASTLY_API_TOKEN> fastly bunx -- -p @fastly/mcp fastly-mcp

Settings 5

FASTLY_API_TOKEN Required: Fastly API token used for real API calls; search and inspect work without it. Use a read-only token unless you want changes made.
FASTLY_MCP_ENCRYPT_SECRETS Optional: Set to true to encrypt recognised secrets in API output (same as --encrypt-secrets).
FASTLY_MCP_ENCRYPT_KEY Optional: 32 hex characters that keep the encryption key the same across restarts.
FASTLY_MCP_ENCRYPT_TWEAK Optional: Optional separate tweak value for secret encryption.
FASTLY_MCP_HTTP_AUTH_TOKEN Optional: Bearer token that clients must send when the server runs in HTTP mode.

What it does

Fastly MCP Server is Fastly's own server for working with a Fastly account from an MCP client. It does not give each API operation its own tool. It ships the documentation of the Fastly JavaScript client and builds a search index from it when it starts. The assistant uses `search` to find the right API method, `inspect` to read that method's parameters and an example, and `execute` to run a short JavaScript snippet against a `Fastly` client that already holds your token. That way every documented method is reachable while the tool list stays at three.

In practice that covers looking up services, domains, backends and TLS status, reading traffic and usage stats, editing dictionaries and ACLs, purging URLs, and cloning or changing service versions. It also adds read-only methods for Next-Gen WAF (rules, signals, events, stored requests), Log Explorer & Insights request-log search and rankings, and observability time series, including account-wide sustainability figures.

By default it runs locally over stdio. A `--transport http` flag serves it on 127.0.0.1:8231 so several trusted clients can share one token, and `--remote-http` runs it as a shared service where each caller sends their own Fastly token. Results too big for one response are written to a temporary JSON file and the response gives its path. An optional `--encrypt-secrets` mode swaps recognised tokens in API output for encrypted values before the model sees them, and decrypts them again when they are sent back.

What it needs

RuntimeNode.js 24+

Node.js 24.12.0 or newer, or Bun (either one is enough; Node.js is recommended for remote mode). A Fastly account and a Fastly API token in FASTLY_API_TOKEN. The Log Explorer and request-log time series methods need the Log Explorer & Insights product enabled on the service.

Limits

Each `execute` call stops after 30 seconds, and a single API response or stored result is capped at 4 MB, so large jobs must be paged or split. Without a token only `search` and `inspect` work. Log Explorer data is sampled and kept for seven days, so it gives estimates, not exact counts. Without a fixed FASTLY_MCP_ENCRYPT_KEY, encrypted values stop working after a restart, and encryption only catches values that match known token patterns. Result files are kept for at most six hours (newest twenty only) and are never written in remote mode.

Who it suits

Suits teams already on Fastly who want an assistant to investigate services, traffic, WAF events and logs, or to make reviewed changes such as purges, ACL edits and new service versions. Because it is published by Fastly and reaches every documented API method, it covers far more than a fixed tool list would. Calls go through the model writing JavaScript, so it is a better fit for users who will read the planned call before approving it. Anyone who wants a narrow, fixed set of read-only actions should give it a read-only token, or pick a different tool.

Tools 3

search
Finds Fastly API methods by keyword, method name, API class or HTTP path in the bundled docs
inspect
Shows one API method's parameters, return type and an example call
execute
Runs a JavaScript snippet against a ready Fastly client using your API token; can read or change the account

Similar servers