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

# Gemini CLI 中的 MCP 网页搜索与抓取

> 为 Google Gemini CLI 添加 Firecrawl 的网页抓取与搜索功能

通过 MCP 为 [Google Gemini CLI](https://github.com/google-gemini/gemini-cli) 添加 Firecrawl 的搜索、抓取、爬取和浏览器工具。

<div id="quick-setup">
  ## 快速开始
</div>

<div id="1-get-your-api-key">
  ### 1. 获取 API 密钥
</div>

前往 [firecrawl.dev/app](https://www.firecrawl.dev/app) 注册，并复制你的 API 密钥。

<div id="2-add-firecrawl-to-gemini-cli">
  ### 2. 将 Firecrawl 添加到 Gemini CLI
</div>

Gemini CLI 会从 `~/.gemini/settings.json` (全局) 或项目中的 `.gemini/settings.json` 读取 MCP 配置。添加以下内容：

```json theme={null}
{
  "mcpServers": {
    "firecrawl": {
      "command": "npx",
      "args": ["-y", "firecrawl-mcp"],
      "env": {
        "FIRECRAWL_API_KEY": "fc-YOUR-API-KEY"
      }
    }
  }
}
```

将 `fc-YOUR-API-KEY` 替换为你的 Firecrawl API 密钥。

<div id="3-launch-gemini-cli">
  ### 3. 启动 Gemini CLI
</div>

```bash theme={null}
gemini
```

确认服务器已启动：

```
/mcp list
```

你应该能看到 `firecrawl` 及其工具。

<div id="quick-demo">
  ## 快速演示
</div>

```
Use firecrawl to search the web for "Gemini 2.5 context window" and summarize the top 5 results.
```

```
Scrape https://ai.google.dev/gemini-api/docs and outline the sections.
```

```
Crawl https://example.com and extract the product names from /products.
```

<div id="remote-hosted-url-no-nodejs-required">
  ## Remote 远程托管 URL (无需 Node.js)
</div>

```json theme={null}
{
  "mcpServers": {
    "firecrawl": {
      "url": "https://mcp.firecrawl.dev/fc-YOUR-API-KEY/v2/mcp"
    }
  }
}
```

<div id="troubleshooting">
  ## 故障排查
</div>

* **工具未显示** — 编辑 `settings.json` 后，请重启 Gemini CLI；MCP 服务器仅在启动时加载。
* **`spawn npx ENOENT`** — 请安装 Node.js 18+，或使用远程托管 URL。
* **触发速率限制** — 请前往 [firecrawl.dev/pricing](https://www.firecrawl.dev/pricing) 升级你的 Firecrawl 套餐。
