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

# MCPorter で使う MCP Web検索とスクレイピング

> TypeScript 製の MCP ランタイム兼 CLI である MCPorter に、Firecrawl のウェブスクレイピングと検索機能を追加します

MCP サーバー向けの TypeScript ランタイム兼 CLI である [MCPorter](https://mcporter.sh) を、ホスト型MCPサーバー経由で Firecrawl に接続します。

<h2 id="quick-setup">
  クイックセットアップ
</h2>

[Firecrawl APIキーを作成](https://www.firecrawl.dev/app/api-keys)し、環境変数としてエクスポートします。

```bash theme={null}
export FIRECRAWL_API_KEY="fc-YOUR-API-KEY"
```

Firecrawl をプロジェクト内の `config/mcporter.json` に追加します。すべてのプロジェクトで使用する場合は、`~/.mcporter/mcporter.json` に追加してください。

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

MCPorter は `${FIRECRAWL_API_KEY}` を環境変数の値に置き換えるため、キーをファイルに直接記述せずに済みます。接続を確認します：

```bash theme={null}
npx mcporter list firecrawl
```

ローカルプロセスで実行したい場合は、代わりに stdio 形式を使用してください：

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

<h2 id="try-it">
  試してみる
</h2>

```bash theme={null}
npx mcporter call firecrawl.firecrawl_scrape url=https://firecrawl.dev 'formats=["markdown"]'
```

このコマンドはページを Markdown 形式で出力します。同じエントリをコードから使用するには `createRuntime` を使います ([MCPorter のドキュメント](https://mcporter.sh)を参照) 。

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

* **サーバーが見つからない:** `npx mcporter config list` を実行し、MCPorter がどの設定ファイルを読み込んだかを確認してください。`--config <file>` または `MCPORTER_CONFIG` で指定できるのは 1 つのファイルのみです。
* **認証エラー:** MCPorter は `${env:VAR}` 形式に対応していません。プレースホルダーは `${FIRECRAWL_API_KEY}` の形式で記述し、同じシェルで変数がエクスポートされていることを確認してください。
* **ツールの引数が拒否される:** 上記の `formats` の例のように、JSON の値は使用しているシェルに合わせてクォートして渡してください。


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