mcp AGENTS.md

Repository instructions for Fastly's MCP server, covering setup, testing, coding conventions, debugging, and how its tools should be used.

In plain words
What is it for?
Use them when developing, testing, formatting, or debugging the Fastly MCP server.
Why use it?
They provide the project's required workflow and prevent changes that would conflict with its public tool design.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/fastly/mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/fastly/mcp

Made for: Codex, OpenCode.

Per session 801 This file is loaded in full into every session.
When invoked 801 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00801 $0.00801
Opus 5 $0.00400 $0.00400
Sonnet 5 $0.00160 $0.00160
Haiku 4.5 $0.00080 $0.00080

Measured 2d ago against content hash e9d13f183589, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- debug: `FASTLY_API_TOKEN=your-token bun run start`; `FASTLY_API_TOKEN=your-token bun run start:node`; `FASTLY_API_TOKEN=your-token bun run start:http`; `FASTLY_API_TOKEN=your-token FASTLY_MCP_HTTP_AUTH_TOKEN=dev-token
AGENTS.md · 31 lines

How it starts

The opening of the file, as written. The whole thing — 31 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Workflow

  • install: bun install
  • test all: bun test
  • test file: bun test <test-file>
  • test case: bun test <test-file> -t "<test-name>"
  • lint: bun run lint
  • format: bun run format
  • after every edit: bun test && bun run lint
  • debug: FASTLY_API_TOKEN=your-token bun run start; FASTLY_API_TOKEN=your-token bun run start:node; FASTLY_API_TOKEN=your-token bun run start:http; FASTLY_API_TOKEN=your-token FASTLY_MCP_HTTP_AUTH_TOKEN=dev-token bun run src/index.js --transport http; curl http://127.0.0.1:8231/healthz

Conventions

  • Keep the public MCP surface to search, inspect, and execute; do not add one tool per Fastly API endpoint. The expected assistant flow is search first, inspect for call details, then execute focused JavaScript.
  • execute snippets must use return; console output is captured separately and is not the result. Fastly client methods return values directly, not inside .result.
  • Prefer sandbox globals like serviceApi, statsApi, purgeApi, and tlsCertificatesApi over new Fastly.ServiceApi() in examples and generated usage.
  • search results stay compact: discovery fields only, with full description, params, returnType, and example reserved for inspect.
  • search and inspect must work without FASTLY_API_TOKEN; real API calls through execute need it.
  • Everything thrown inside the sandbox, on either side of the host bridge, goes through describeThrown in src/errors.js. The Fastly client rejects with a plain object rather than an Error, so String(err) or a bare err.message silently turns a 401 into [object Object]. Failures reach the model as {error, status, statusText, body, hint}.
  • When secret encryption is enabled, decrypt input strings before handlers and re-encrypt text output before returning it.
  • HTTP defaults are loopback 127.0.0.1, port 8231, path /mcp, and auto response framing; --http-json and --http-sse pin the framing and are mutually exclusive, and non-loopback/network binds require auth. Both flags reach the 2026 leg only — the 2025 fallback always answers with SSE.
  • The server speaks the 2026-07-28 revision plus the 2025 family. There are no sessions in either era: createMcpHandler serves the modern path and falls back to per-request stateless serving for 2025 clients, both off the same createMcpServer factory.
  • Modern requests must carry Mcp-Method (and Mcp-Name on tools/call); the server rejects a request whose headers and body disagree. Keep those two on the CORS allow-headers list.
  • docs/*Api.md are generated inputs to the runtime index. Regenerate with bun run update-docs rather than hand-editing generated API docs.

Read the full file on GitHub · 31 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 31 lines · 801 tokens per session scan A e9d13f183589

Subscribe to this mod's changes

mcp AGENTS.md is an instructions file published in the GitHub repository fastly/mcp (39 stars, last pushed 14d ago), licensed MIT. It adds 801 tokens to every session, about $0.0040 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.