Skip to content

Commit 14ec847

Browse files
committed
feat(cli): configure MCP natively across coding agents
Replace the subprocess installer in `setup mcp` with a built-in one that detects installed agents, pre-selects them in a picker, and offers to install rules telling those agents to prefer Firecrawl for web search and scraping. Covers Claude Code, Cursor, VS Code, Codex, OpenCode, Windsurf, Zed, Hermes Agent, and OpenClaw through per-agent flags, `--project` for project scope, and `--rules` / `--no-rules` for scripted runs. `-y` stays MCP-only. The two launchers were previously reachable only by flag, so a plain `setup mcp` never offered them; they now sit in the picker alongside the editors, and because a launcher shells out to a CLI, a missing binary is reported against that one agent instead of ending the run. Credential handling is unchanged in principle and stricter in reach: an API key is never written as a literal. Knowing which agents were selected means each one receives a reference to FIRECRAWL_API_KEY in the syntax it expands, so the setup no longer has to refuse a run that omits --agent. Agents with no verified syntax fall back to the keyless endpoint and say so rather than persisting a secret. Config edits are surgical. JSON is patched through a JSONC-aware editor so commented settings files parse at all and keep their comments, and TOML tables are replaced along with any stale sub-tables left by a previous stdio entry. Reruns are byte-identical. Also gives every setup test a throwaway HOME and resets spawn mocks between tests, since MCP setup now writes real config files and would otherwise rewrite the developer's own agent settings; and teaches doctor about the `servers` and `context_servers` keys so those registrations are recognized.
1 parent 3852cce commit 14ec847

10 files changed

Lines changed: 1873 additions & 411 deletions

File tree

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,40 @@ firecrawl setup skills
7575
firecrawl setup workflows
7676
```
7777

78-
To install the Firecrawl MCP server into your editors (Cursor, Claude Code, VS Code, etc.):
78+
To install the Firecrawl MCP server into your coding agents:
7979

8080
```bash
8181
firecrawl setup mcp
8282
```
8383

84+
This detects which agents you have installed, pre-selects them in a picker, and
85+
asks whether to add rules telling those agents to prefer Firecrawl for web
86+
search and scraping. Supported agents are Claude Code, Cursor, VS Code, Codex,
87+
OpenCode, Windsurf, Zed, Hermes Agent, and OpenClaw.
88+
89+
Pass agent flags to skip the picker, `-y` to configure every detected agent
90+
(MCP only), or `--project` to write to the current project instead of your
91+
global agent settings:
92+
93+
```bash
94+
firecrawl setup mcp --claude --cursor # skip the picker
95+
firecrawl setup mcp -y # every detected agent, MCP only
96+
firecrawl setup mcp -y --rules # ...and install the rules too
97+
firecrawl setup mcp --project --cursor # write project config
98+
```
99+
100+
Rerun the command any time to update an existing setup or add another agent; it
101+
edits only the Firecrawl entry and leaves the rest of each config alone.
102+
103+
Your API key is never written into an agent config. When `FIRECRAWL_API_KEY` is
104+
exported in the environment your agents run under, each agent gets a reference
105+
to that variable in the syntax it understands. Otherwise setup stays keyless,
106+
which still serves search, scrape, and parse under an anonymous rate limit. Use
107+
`--keyless` to force the anonymous path even when a key is available.
108+
109+
Not every agent supports project-level MCP configuration. Those agents always
110+
receive the global configuration.
111+
84112
To make Firecrawl the default web provider for supported AI agents:
85113

86114
```bash

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"@inquirer/prompts": "^8.2.1",
7575
"commander": "^14.0.2",
7676
"firecrawl": "4.24.0",
77+
"jsonc-parser": "3.3.1",
7778
"yaml": "^2.9.0",
7879
"zod-to-json-schema": "3.24.6"
7980
}

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)