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

# 在本地运行 Firecrawl MCP

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

<div id="run-locally">
  ## 本地运行
</div>

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

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

```bash theme={null}
npm install -g 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 服务器时可用的某些选项，在远程环境中会受到限制或不可用：

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

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

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