web-search-mcp
web-search-mcp
ローカルLLM向けの外部ウェブ検索およびページ取得機能。MCPツールおよびCLIとして公開されています。実装はPlaywrightファーストの非同期処理で、デフォルトでシステムにインストールされたChromiumバイナリを起動します。設計の経緯は docs/IMPLEMENTATION_PLAN.md に記載されています。
ツール
search(provider, context)は、duckduckgo(デフォルト)、google、またはyandexでブラウザベースの検索を実行し、最大5件のオーガニック検索結果URLを返します。fetch(urls)は1..5件のURLを取得し、URLごとのpages、errors、truncatedフィールドを含むブラウザレンダリング済みのHTMLを返します。
context は、呼び出し元との互換性を保つため、意図的に検索クエリ文字列としています。
Related MCP server: Web Search MCP
セットアップ
uv sync
chromium --versionChromiumが標準以外の場所にインストールされている場合は、PLAYWRIGHT_CHROMIUM_EXECUTABLE=/path/to/chromium を設定してください。
使用方法
MCPサーバーをstdio経由で実行します:
uv run web-search serve-mcpCLIを直接実行します:
uv run web-search search --context "python async playwright"
uv run web-search fetch https://example.comstdioの代わりにHTTPトランスポートを公開します:
uv run web-search serve-mcp --transport streamable-http --host 127.0.0.1 --port 8000設計上の注意点
プロセスごとに1つの共有ブラウザを使用し、リクエストごとに新しいシークレットコンテキストを作成します。
Playwrightは、Playwrightがダウンロードしたブラウザバンドルではなく、システムのChromiumバイナリを起動します。
システムのChromiumはPlaywrightで動作しましたが、テストしたシステムのFirefoxビルドは起動直後に終了しました。そのため、このリポジトリではサポート対象のホストブラウザとしてシステムのChromiumをターゲットにしています。
ブラウザの健全性テスト(スモークテスト)は、通常のホストシェルから実行する必要があります。制限されたサンドボックス環境では、ホストブラウザが正しく動作していてもChromiumの起動がブロックされる可能性があります。
グローバルなナビゲーションの同時実行数は
3に制限されています。タイムアウト:ページごとに
15s、search全体で20s、fetch全体で35sです。SSRF対策:
http/httpsのみに限定し、埋め込み認証情報は使用せず、ナビゲーション前およびブラウザのサブリクエスト時にループバック/プライベート/リンクローカル/予約済みIPをブロックします。JavaScriptチャレンジページには
10sの待機ウィンドウが設定されています。CAPTCHAの解決、ステルスフィンガープリント、サイト固有のバイパスロジックはありません。HTMLはURLごとに
1 MiBに制限されています。サイズ超過のレスポンスは切り捨てられ、truncatedに報告されます。v1では
robots.txtは参照されません。
開発
source .venv/bin/activate
pytestパーサーテストは保存されたHTMLフィクスチャに対して実行されます。セレクターのドリフトは、メンテナンスコストとして想定されています。
This server cannot be deployed
Maintenance
Related MCP Connectors
Web search, browser automation, scraping, crawling and CAPTCHA solving for AI agents.
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
A real browser for your agent: render any page, or 25 pages of a site, to clean text.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment10162 npm299MIT
- AlicenseNot gradedqualityDmaintenanceEnables web searching through Google, DuckDuckGo, and Bing using a headless Chrome browser, returning structured results with titles, URLs, and snippets. Also supports fetching and extracting text content from any webpage.15MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to fetch and extract web content using browser automation, OCR, and multiple extraction methods, handling JavaScript rendering and anti-scraping techniques.17MIT
- AlicenseAqualityDmaintenanceProvides web access capabilities for LLMs including search, fetching, content extraction, PDF reading, image viewing, and screenshots.346MIT