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

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

> 为 Kimi Code CLI 添加 Firecrawl 网页抓取与搜索功能

通过远程托管的 MCP 服务器，为 [Kimi Code CLI](https://www.kimi.com/code/docs/en/kimi-code-cli/getting-started.html) 添加 Firecrawl 的搜索、抓取及其他网页工具。

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

[创建 Firecrawl API 密钥](https://www.firecrawl.dev/app/api-keys)，然后将以下内容添加到 `~/.kimi-code/mcp.json` (或项目内的 `.kimi-code/mcp.json`) 中：

```json theme={null}
{
  "mcpServers": {
    "firecrawl": {
      "url": "https://mcp.firecrawl.dev/v2/mcp",
      "headers": {
        "Authorization": "Bearer <FIRECRAWL_API_KEY>"
      }
    }
  }
}
```

为避免将密钥写入文件，可将其导出为环境变量，并改为引用该变量，而不是使用 `headers`：

```json theme={null}
{
  "mcpServers": {
    "firecrawl": {
      "url": "https://mcp.firecrawl.dev/v2/mcp",
      "bearerTokenEnvVar": "FIRECRAWL_API_KEY"
    }
  }
}
```

你也可以通过 `/mcp-config` 以交互式方式添加服务器。启动一个新的 Kimi Code 会话，运行 `/mcp`，确认 `firecrawl` 已连接，且其工具 (如 `firecrawl_search` 和 `firecrawl_scrape`) 已列出。

如需通过浏览器登录而非使用 API 密钥，请将 URL 设为 `https://mcp.firecrawl.dev/v2/mcp-oauth`，不设置 `headers`，然后运行 `/mcp-config login firecrawl`。请参见[面向人类用户](/zh/mcp-server/oauth)。

<h2 id="try-it">
  动手试试
</h2>

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

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

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

* **工具未显示：** MCP 服务器在会话开始时加载，因此编辑 `mcp.json` 后请开启新会话。会话中途添加的服务器只会在后续会话中生效。
* **服务器无法连接：** 运行 `/mcp` 查看状态，然后检查 URL 以及 API 密钥是否正确。如果使用 `bearerTokenEnvVar`，必须在启动 `kimi` 的 shell 中设置该变量。
* **项目级配置被忽略：** 对于未受信任的文件夹，项目中 `.kimi-code/mcp.json` 配置的服务器会保持禁用状态。请将该文件夹设为受信任，或在无头运行时设置 `KIMI_CODE_TRUST_WORKSPACE=1`。
* **希望使用本地服务器：** Kimi Code 也可以运行 `npx -y firecrawl-mcp`，并在 `env` 中配置 `FIRECRAWL_API_KEY`。请参见[本地运行](/zh/mcp-server/local)。


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