跳转到主要内容

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 为 OpenCode 添加 Firecrawl 的搜索、抓取、爬取和浏览器工具。

快速开始

1. 获取 API 密钥

firecrawl.dev/app 注册,然后复制您的 API 密钥。

2. 将 Firecrawl 添加到 OpenCode

OpenCode 会从 ~/.config/opencode/config.json (全局) 或项目中的 ./opencode.json 读取配置。添加:
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "firecrawl": {
      "type": "local",
      "command": ["npx", "-y", "firecrawl-mcp"],
      "environment": {
        "FIRECRAWL_API_KEY": "fc-YOUR-API-KEY"
      }
    }
  }
}
fc-YOUR-API-KEY 替换为你的 Firecrawl API 密钥。

3. 启动 OpenCode

opencode
OpenCode 会在启动时加载 MCP 服务器。请确认已接入 Firecrawl:
/mcp

快速演示

进行网页搜索,查找 "Bun 2.0 changelog" 并总结排名靠前的结果。
抓取 https://docs.firecrawl.dev/introduction and list the code examples.
爬取 https://example.com/blog and save each post as markdown.

Remote Hosted URL (无需 Node.js)

{
  "mcp": {
    "firecrawl": {
      "type": "remote",
      "url": "https://mcp.firecrawl.dev/fc-YOUR-API-KEY/v2/mcp"
    }
  }
}

故障排查

  • 服务器未连接 — 运行 opencode doctor 检查 MCP 加载错误。
  • npx 权限被拒绝 — 安装 Node.js 18+,并确保 shell 已正确识别该安装 (which npx) 。