feat(setup): configure Amp, Grok Build and Zed with setup mcp

Merged
ER
15h ago
+615-4

Adds Amp, Grok Build and Zed as firecrawl setup mcp targets, so users of those clients no longer hand-edit config to follow the docs quickstarts. Bumps the version to 1.26.17, on top of the 1.26.16 in https://github.com/firecrawl/cli/pull/339.

What it writes

Each client gets the hosted entry (https://mcp.firecrawl.dev/v2/mcp) in its user settings, following that client's documented format:

Client--agent valuesFileEntry
Ampamp, ampcode, amp-code~/.config/amp/settings.json (or settings.jsonc when only that exists)"amp.mcpServers".firecrawl = { url, headers? }
Grok Buildgrok, grok-build, grok-cli~/.grok/config.toml[mcp_servers.firecrawl] with url and optional headers
Zedzed~/.config/zed/settings.json ($XDG_CONFIG_HOME/zed on Linux, %APPDATA%\Zed on Windows)context_servers.firecrawl = { url }

Sources:

Key handling

The rules match the existing targets. A stored key is never written. With FIRECRAWL_API_KEY exported, Amp and Grok Build get Authorization: Bearer ${FIRECRAWL_API_KEY}, which both clients expand when they load the file. Zed does not expand environment variables in MCP headers (https://github.com/zed-industries/zed/issues/60459). So Zed takes the keyless entry only: with an exported key, --agent zed fails with the same "no verified environment-variable syntax" error unknown clients get, and --agent all skips it, as it already does for Antigravity. --keyless includes it.

Editing existing files

  • Amp and Zed settings are JSONC. The entry is set with jsonc-parser's modify, so comments, trailing commas, formatting and other servers are kept. A file that does not parse is left alone and reported.
  • In Grok's config.toml, the existing [mcp_servers.firecrawl] table and its subtables are replaced in place, and every other line, comments included, is kept. The result is checked with smol-toml before anything is written. Invalid TOML, or a firecrawl entry defined inline where setup cannot replace it, is reported and the file is not changed.
  • I wrote these files directly instead of going through add-mcp. add-mcp@1.14.0 has no Amp or Grok Build target, and it writes Zed to ~/Library/Application Support/Zed/settings.json on macOS, while Zed reads ~/.config/zed/settings.json.
  • The three clients are user settings only: --agent amp|grok|zed --project is rejected, and --agent all --project (keyless) skips them with a reason.

New runtime dependencies: jsonc-parser and smol-toml, both with no dependencies of their own.

Testing

  • New unit tests in setup.test.ts, each with a temp HOME, for every client. They cover the env-backed and keyless entries, keeping existing settings and comments, idempotent reruns, settings.jsonc fallback, replacing an old Grok firecrawl table, refusing invalid or unreplaceable TOML, XDG_CONFIG_HOME for Zed, rejecting stored keys and --project, and --agent all with and without an exported key.
  • Built CLI on a clean temp home: setup mcp --agent amp and --agent grok with an exported key wrote env references only (no literal key anywhere under the home). --agent zed with a key exited 1. --agent zed --keyless added the entry and kept the existing comments.
  • Real clients read the written files: amp mcp list shows firecrawl url https://mcp.firecrawl.dev/v2/mcp from ~/.config/amp/settings.json, and grok mcp list --json (Grok 1.0.62, run with a placeholder key) shows the firecrawl server with the header expanded from the environment.
  • pnpm test, pnpm type-check, pnpm format:check, pnpm build.

Merge order

Merge after https://github.com/firecrawl/cli/pull/339. 336 and 338 are merged. This branch has 339 merged in to settle the overlapping lines in package.json and the setup.ts imports, so until 339 merges its diff also shows its changes. It ships in 1.26.17.

Open in Capy


Summary by cubic

Adds Amp, Grok Build, and Zed as firecrawl setup mcp targets so users no longer hand-edit config to follow the docs quickstarts. Bumps the firecrawl SDK to 4.50.0 and the CLI to 1.26.17.

Each client gets the hosted MCP entry in its user settings: ~/.config/amp/settings.json (or an existing settings.jsonc when there's no settings.json for Amp), ~/.grok/config.toml, and ~/.config/zed/settings.json ($XDG_CONFIG_HOME/zed on Linux when set, %APPDATA%\Zed on Windows). A stored key is never written: Amp and Grok Build get a Bearer ${FIRECRAWL_API_KEY} header their clients expand at load time, while Zed is skipped when a key is exported since it cannot expand env vars in headers. All three are user-settings-only, so --project is rejected. Existing files keep comments and unrelated servers via jsonc-parser and smol-toml; Grok's config.toml is preserved byte for byte outside the replaced [mcp_servers.firecrawl] table. Aliases ampcode, amp-code, grok, grok-build, and grok-cli map to the same targets.

Found by Wildfire, Firecrawl's integration testing: the cli-setup-mcp check warned that Amp, Grok Build and Zed were documented but never configured.