跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.firecrawl.dev/llms.txt

Use this file to discover all available pages before exploring further.

通过 MCP,为 OpenAI Codex CLI 添加 Firecrawl 的搜索、抓取、爬取和浏览器工具。

快速开始

1. 获取 API 密钥

前往 firecrawl.dev/app 注册并复制你的 API 密钥。

2. 将 Firecrawl 添加到 Codex

Codex 会从 ~/.codex/config.toml 读取 MCP 服务器配置。添加 Firecrawl 服务器:
[mcp_servers.firecrawl]
command = "npx"
args = ["-y", "firecrawl-mcp"]

[mcp_servers.firecrawl.env]
FIRECRAWL_API_KEY = "fc-YOUR-API-KEY"
fc-YOUR-API-KEY 替换为你的 Firecrawl API 密钥。

3. 启动 Codex

codex
Codex 启动时会检测到 Firecrawl 工具。请确认它们已成功加载:
/mcp
你应该会看到已列出的 firecrawl,以及 firecrawl_searchfirecrawl_scrapefirecrawl_crawlfirecrawl_extract 等工具。

快速演示

试试以下 prompt:
Search the web for the latest Next.js App Router release notes and summarize.
Scrape https://docs.firecrawl.dev and list the top-level sections.
Crawl https://example.com and save the markdown for every page under /blog.

远程托管的 URL (无需 Node.js)

如果你不想在本地运行 npx
[mcp_servers.firecrawl]
url = "https://mcp.firecrawl.dev/fc-YOUR-API-KEY/v2/mcp"

故障排查

  • Codex 无法识别这些工具 — 运行 codex --version,确认你使用的是支持 MCP 的版本;编辑 config.toml 后,请重启 CLI。
  • spawn npx ENOENT — 安装 Node.js 18+,并确保 npx 已加入你的 PATH;或者改用上方的远程托管 URL。
  • 401 / 密钥无效 — 前往 firecrawl.dev/app/api-keys 重新生成 API 密钥。