> ## Documentation Index
> Fetch the complete documentation index at: https://firecrawl-claude-eager-dijkstra-u6tgua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 在本地运行 Firecrawl MCP

> 安装并配置本地 Firecrawl MCP 服务器。

<div id="prerequisites">
  ## 前置条件
</div>

* Node.js 22 或更高版本
* Node.js 自带的 npm 和 `npx`
* 云端 API 所需的 Firecrawl API 密钥，或自托管 Firecrawl API 的 URL

确认已安装的 Node.js 版本：

```bash theme={null}
node --version
```

<div id="run-over-stdio">
  ## 通过 stdio 运行
</div>

```bash theme={null}
env FIRECRAWL_API_KEY=fc-YOUR_API_KEY npx -y firecrawl-mcp@3.23.0
```

这是将 MCP 服务器作为本地进程启动时客户端默认使用的传输方式。

<div id="run-with-streamable-http">
  ## 使用 Streamable HTTP 运行
</div>

对于连接到已运行 MCP 服务器的 n8n 等客户端，请使用 HTTP 传输：

```bash theme={null}
env HTTP_STREAMABLE_SERVER=true \
  FIRECRAWL_API_KEY=fc-YOUR_API_KEY \
  npx -y firecrawl-mcp@3.23.0
```

将客户端连接至：

```text theme={null}
http://localhost:3000/mcp
```

确认服务器已准备就绪：

```bash theme={null}
curl http://localhost:3000/health
```

健康检查会返回 `ok`。本地路由为 `/mcp`，托管版 Firecrawl 的路由为 `/v2/mcp`。

<div id="install-globally">
  ## 全局安装
</div>

```bash theme={null}
npm install -g firecrawl-mcp@3.23.0
```

然后运行：

```bash theme={null}
env FIRECRAWL_API_KEY=fc-YOUR_API_KEY firecrawl-mcp
```

<div id="configuration">
  ## 配置
</div>

<div id="environment-variables">
  ### 环境变量
</div>

<div id="cloud-and-self-hosted-api">
  #### 云端和自托管 API
</div>

* `FIRECRAWL_API_KEY`：你的 Firecrawl API 密钥
  * 使用云端 API (默认) 时必填
  * 使用带有 `FIRECRAWL_API_URL` 的自托管实例时可选
* `FIRECRAWL_API_URL` (可选) ：用于自托管实例的自定义 API 端点
  * 示例：`https://firecrawl.your-domain.com`
  * 若未提供，将使用云端 API (需要 API 密钥)

<div id="configuration-examples">
  ### 配置示例
</div>

使用云端 API 时：

```bash theme={null}
export FIRECRAWL_API_KEY=your-api-key
```

对于自托管的实例：

```bash theme={null}
export FIRECRAWL_API_URL=https://firecrawl.your-domain.com
export FIRECRAWL_API_KEY=your-api-key  # 如果你的实例需要鉴权
```

<div id="custom-configuration-with-claude-desktop">
  ### 在 Claude Desktop 中进行自定义配置
</div>

将以下内容添加到你的 `claude_desktop_config.json`：

```json theme={null}
{
  "mcpServers": {
    "mcp-server-firecrawl": {
      "command": "npx",
      "args": ["-y", "firecrawl-mcp"],
      "env": {
        "FIRECRAWL_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}
```

<div id="hosted-mcp-vs-local-mcp">
  ### 远程托管的 MCP 与本地 MCP
</div>

远程托管的 MCP 服务器针对安全的远程使用进行了优化。本地运行 MCP 服务器时可用的某些选项，在远程环境中会受到限制或不可用：

* 远程托管的免密钥模式仅开放 Search、Scrape 和解析，并按 IP 限流。
* 仅限本地的文件读取功能仅在本地运行 MCP 服务器时可用。
* 当代理需要访问本地资源时，应通过本地或自托管的 MCP 服务器配置 Webhook 和本地文件路径。

<Note>
  使用 `firecrawl_parse` 直接解析本地文件时，需要将 `FIRECRAWL_API_URL` 指向自托管的 Firecrawl API。仅配置云端 API 密钥的本地 MCP 服务器无法通过该工具上传本地文件。
</Note>

<div id="rate-limiting">
  ### 限流
</div>

Firecrawl 会实施限流。使用 API 密钥可提高限额，并访问完整工具集。
