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

# Codex CLI での MCP Web Search & Scrape

> OpenAI Codex CLI に Firecrawl の Web スクレイピングと検索を追加

MCP を介して、Firecrawl の検索、スクレイピング、クロール、ブラウザツールを [OpenAI Codex CLI](https://github.com/openai/codex) に追加します。

<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-codex">
  ### 2. Codex に Firecrawl を追加する
</div>

Codex は `~/.codex/config.toml` から MCP Server の設定を読み込みます。Firecrawl サーバーを追加してください。

```toml theme={null}
[mcp_servers.firecrawl]
command = "npx"
args = ["-y", "firecrawl-mcp"]

[mcp_servers.firecrawl.env]
FIRECRAWL_API_KEY = "fc-YOUR-API-KEY"
```

`fc-YOUR-API-KEY` をお使いの Firecrawl APIキーに置き換えてください。

<div id="3-start-codex">
  ### 3. Codex を起動する
</div>

```bash theme={null}
codex
```

Codex は起動時に Firecrawl ツールを検出します。正しく読み込まれていることを確認してください。

```bash theme={null}
/mcp
```

`firecrawl_search`、`firecrawl_scrape`、`firecrawl_crawl`、`firecrawl_extract` などのツールとともに、`firecrawl` が一覧に表示されているはずです。

<div id="quick-demo">
  ## クイックデモ
</div>

次のプロンプトを試してください：

```
Next.js App Routerの最新リリースノートをウェブで検索し、要約してください。
```

```
スクレイピング https://docs.firecrawl.dev and list the top-level sections.
```

```
クロール https://example.com and save the markdown for every page under /blog.
```

<div id="remote-hosted-url-no-nodejs-required">
  ## リモートホストのURL (Node.js不要)
</div>

ローカルで `npx` を実行したくない場合:

```toml theme={null}
[mcp_servers.firecrawl]
url = "https://mcp.firecrawl.dev/fc-YOUR-API-KEY/v2/mcp"
```

<div id="troubleshooting">
  ## トラブルシューティング
</div>

* **Codex でツールを認識できない** — `codex --version` を実行して、MCP をサポートするバージョンを使用していることを確認し、`config.toml` を編集した後に CLI を再起動してください。
* **`spawn npx ENOENT`** — Node.js 18 以降をインストールし、`npx` が `PATH` に含まれていることを確認するか、上記のリモートホストのURLに切り替えてください。
* **401 / 無効なキー** — [firecrawl.dev/app/api-keys](https://www.firecrawl.dev/app/api-keys) で API キーを再生成してください。
