`setup mcp` can brick Codex (invalid config: url is not supported for stdio) via add-mcp merge bug
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- cli
Research direction
Start at the setup mcp implementation that shells out to npx -y add-mcp, then review neon-solutions/add-mcp#83 and the generated ~/.codex/config.toml entry. Determine whether this repository should pin a fixed add-mcp version or remove the stale stdio entry before installation. Done means rerunning the reported reproduction no longer leaves Codex with an invalid hybrid configuration.
Written by the indexing model from the issue text.
Description
Summary
firecrawl setup mcp can leave Codex completely unusable ("Error creating chat") when the machine has a leftover stdio-style firecrawl entry in ~/.codex/config.toml from the older firecrawl-mcp setup.
The root cause is not in this repo — setup mcp shells out to npx -y add-mcp, and add-mcp deep-merges the new server entry into an existing one with the same name instead of replacing it. The old stdio keys survive alongside the new remote ones:
[mcp_servers.firecrawl]
command = "npx"
args = [ "-y", "firecrawl-mcp" ]
type = "http"
url = "https://mcp.firecrawl.dev/<key>/v2/mcp"
[mcp_servers.firecrawl.env]
FIRECRAWL_API_KEY = "<key>"
Codex rejects the whole config file on this hybrid entry:
Error creating chat
invalid configuration: url is not supported for stdio
in `mcp_servers.firecrawl`
and every chat fails until the user hand-edits config.toml. Since your user base is exactly the population likely to have the old firecrawl-mcp stdio entry lying around, setup mcp is a common trigger for this even though the defect is upstream.
Repro
- Have
~/.codex/config.toml(orCODEX_HOME) containing the classic stdio entry:[mcp_servers.firecrawl] command = "npx" args = [ "-y", "firecrawl-mcp" ] [mcp_servers.firecrawl.env] FIRECRAWL_API_KEY = "fc-test" - Run
firecrawl setup mcp(or the equivalentnpx -y add-mcp "https://mcp.firecrawl.dev/fc-test/v2/mcp" --name firecrawl --transport http -g -a codex -y). - Codex now fails to create any chat with the error above.
Observed with firecrawl-cli 1.19.6/1.19.27 and add-mcp 1.14.0 on macOS.
Status upstream
Fix submitted as neon-solutions/add-mcp#83 (replace server entries atomically on re-install instead of deep-merging). Since setup mcp invokes add-mcp unpinned via npx -y add-mcp, users get the fix automatically once it's merged and released — no change needed here in that case.
Possible mitigations in this repo
- Pin a minimum add-mcp version in the
setup mcpshell-out once the fix ships (npx -y add-mcp@^1.x.y). - Optionally have
setup mcpdetect/remove a stale stdiofirecrawlentry before installing the remote one, which would also protect users of other agents' config files.
- Dominant language
- TypeScript
- Stars
- 635
- Forks
- 106
- Avg merge
- 1h 33m
- Merged PRs (30d)
- 43
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firecrawl/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
firecrawl-monitor skill: description exceeds Claude Code's 1024-char limit, skill fails to load Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·