OpenCodeでのMCP Web検索とスクレイピング
OpenCode に Firecrawl の Web スクレイピングと検索を追加
MCP 経由で、Firecrawl の検索、スクレイピング、クロール、ブラウザの各ツールを OpenCode に追加します。
firecrawl.dev/appで登録し、APIキーをコピーします。
OpenCode は ~/.config/opencode/config.json (グローバル) またはプロジェクト内の ./opencode.json から設定を読み込みます。以下を追加します:
{
"$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キーに置き換えてください。
opencodeOpenCode は起動時に MCP サーバーを読み込みます。Firecrawl が接続されていることを確認してください:
/mcpSearch 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.{
"mcp": {
"firecrawl": {
"type": "remote",
"url": "https://mcp.firecrawl.dev/v2/mcp"
}
}
}この構成では、キー不要のFirecrawlツールセットを使用します。アカウント接続型または無人セットアップの場合は、ホスト型MCP接続モードに従ってください。APIキーはURLではなく、Authorizationヘッダーまたは安全なシークレットストアに保管してください。
- サーバーが接続されていない — MCP の読み込みエラーを確認するには、
opencode doctorを実行します。 npxで権限が拒否される — Node.js 18 以降をインストールし、シェルがそのインストールを認識していることを確認してください (which npx) 。
Was this page helpful?Suggest editsRaise issue