> ## 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.

# 在 Crush 中使用 MCP 网页搜索与抓取

> 为 Crush 添加 Firecrawl 网页搜索与抓取功能

将 Firecrawl 作为远程 HTTP MCP 服务器接入 Crush，使 Crush 能够进行网页搜索并读取页面内容。

<h2 id="requirements">
  前提条件
</h2>

* Crush 0.98 或更高版本。
* 一个 [Firecrawl API 密钥](https://www.firecrawl.dev/app/api-keys)，并已导出为环境变量 `FIRECRAWL_API_KEY`。

<h2 id="quick-setup">
  快速设置
</h2>

1. 在用于启动 Crush 的 shell 中导出 API 密钥：

```bash theme={null}
export FIRECRAWL_API_KEY="fc-YOUR-API-KEY"
```

2. 将该服务器添加到项目中的 `crush.json`，若要在所有项目中使用，则添加到 `~/.config/crush/crush.json`：

```json theme={null}
{
  "$schema": "https://charm.land/crush.json",
  "mcp": {
    "firecrawl": {
      "type": "http",
      "url": "https://mcp.firecrawl.dev/v2/mcp",
      "headers": {
        "Authorization": "Bearer $FIRECRAWL_API_KEY"
      }
    }
  }
}
```

3. 启动 Crush，让它执行搜索或抓取。

<Accordion title="使用 crushrc 文件？">
  较新的 Crush 版本支持读取 Bash 风格的 `crushrc` 文件，在其中只需一条命令即可添加 MCP 服务器：

  ```bash theme={null}
  mcp add firecrawl \
    --type http \
    --url "https://mcp.firecrawl.dev/v2/mcp" \
    --header Authorization "Bearer $FIRECRAWL_API_KEY"
  ```

  运行 `crush dirs`，即可查看 Crush 在你的机器上会从哪些位置读取配置。
</Accordion>

有关密钥的更多信息，请参见[配置 API 密钥](/zh/mcp-server/keyless#add-an-api-key)。

<h2 id="try-it">
  立即试用
</h2>

```text theme={null}
进行网页搜索，查找最新的 Rust 版本发布说明，并总结信息来源。
```

```text theme={null}
抓取 https://firecrawl.dev 并说明它的功能。
```

<h2 id="what-you-can-do">
  你能做什么
</h2>

<CardGroup cols={2}>
  <Card title="搜索" icon="magnifying-glass" href="/zh/features/search">
    查找最新信息，并读取相关结果的内容。
  </Card>

  <Card title="抓取" icon="file-lines" href="/zh/features/scrape">
    将 URL 转换为干净的 markdown 或结构化数据。
  </Card>

  <Card title="交互" icon="hand-pointer" href="/zh/features/interact">
    通过页面导航、点击和表单填写，获取所需数据。
  </Card>

  <Card title="Alexandria" icon="books" href="/zh/features/alexandria">
    发现结构化数据工具，查看其输入参数和定价，然后通过 Firecrawl 运行这些工具。
  </Card>
</CardGroup>

<h2 id="troubleshooting">
  故障排除
</h2>

* **服务器无法启动：** 请检查启动 Crush 的 shell 中是否已导出 `FIRECRAWL_API_KEY`，并确认 URL 与 `https://mcp.firecrawl.dev/v2/mcp` 完全一致。
* **标头被丢弃：** 如果某个标头的值解析为空 string，Crush 会将其移除。未设置 `FIRECRAWL_API_KEY` 时就会出现这种情况。
* **工具未被使用：** 不同模型调用 MCP 工具的可靠性各不相同，请尝试换用其他模型。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.