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

# OpenCodeでのMCP Web検索とスクレイピング

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

MCP 経由で、Firecrawl の検索、スクレイピング、クロール、ブラウザの各ツールを [OpenCode](https://opencode.ai) に追加します。

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

OpenCode は `~/.config/opencode/config.json` (グローバル) またはプロジェクト内の `./opencode.json` から設定を読み込みます。以下を追加します:

```json theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "firecrawl": {
      "type": "local",
      "command": ["npx", "-y", "firecrawl-mcp"],
      "environment": {
        "FIRECRAWL_API_KEY": "fc-YOUR-API-KEY"
      }
    }
  }
}
```

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

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

```bash theme={null}
opencode
```

OpenCode は起動時に MCP サーバーを読み込みます。Firecrawl が接続されていることを確認してください:

```
/mcp
```

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

```
Search the web for "Bun 2.0 changelog" and summarize the top results.
```

```
Scrape https://docs.firecrawl.dev/introduction and list the code examples.
```

```
Crawl https://example.com/blog and save each post as markdown.
```

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

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

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

* **サーバーが接続されていない** — MCP の読み込みエラーを確認するには、`opencode doctor` を実行します。
* **`npx` で権限が拒否される** — Node.js 18 以降をインストールし、シェルがそのインストールを認識していることを確認してください (`which npx`) 。
