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

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

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

将 Firecrawl 作为远程扩展接入 Goose，让 Goose 能够通过远程托管的 MCP 服务器进行网页搜索并读取页面内容。

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

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

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

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

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

2. 将该扩展添加到 `~/.config/goose/config.yaml` 的 `extensions` 部分：

```yaml theme={null}
extensions:
  firecrawl:
    type: streamable_http
    name: firecrawl
    enabled: true
    uri: https://mcp.firecrawl.dev/v2/mcp
    headers:
      Authorization: "Bearer $FIRECRAWL_API_KEY"
    env_keys:
      - FIRECRAWL_API_KEY
    timeout: 300
```

3. 开始一个会话，让 Goose 执行搜索或抓取：

```bash theme={null}
goose session
```

<Warning>
  请将标头写为 `$FIRECRAWL_API_KEY` (不加花括号) ，并保留 `env_keys`。否则 Goose 会将 `${FIRECRAWL_API_KEY}` 按字面文本原样发送，导致服务器拒绝该请求。
</Warning>

有关密钥的更多信息，请参见[配置 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>

* **提示密钥无效或已撤销：**检查标头中使用的是不带花括号的 `$FIRECRAWL_API_KEY`，并确认已在启动 Goose 的 shell 中导出 `FIRECRAWL_API_KEY`。
* **扩展未显示：**保存文件后重新运行 `goose session`，并确认已设置 `enabled: true`。
* **调用超时：**调高 `timeout`。抓取大型页面耗时可能超过默认值。
* **工具未被调用：**不同模型调用 MCP 工具的可靠性不一，可尝试换用其他模型。


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