
web-agent-master/google-search
Browser automationこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
web-agent-master/google-searchは、https://github.com/web-agent-master/google-search.からインポートされたMCPサーバー候補です。
概要
web-agent-master/google-searchは、https://github.com/web-agent-master/google-search.からインポートされたMCPサーバー候補です。
概要(AI 翻訳)
PlaywrightベースのNode.jsツールで、検索エンジンのアンチスクレイピング機構を回避してGoogle検索を実行し、結果を抽出します。コマンドラインツールとして直接使用することも、モデルコンテキストプロトコル(MCP)サーバーとして、ClaudeのようなAIアシスタントにリアルタイム検索機能を提供します。
中文文档
主な特徴
- ローカルSERP API代替:有料検索エンジンの結果APIサービスに頼る必要がなく、すべての検索がローカルで実行されます
- 高度なアンチボット検出バイパス技術:
- 実際のユーザー行動をシミュレートするインテリジェントブラウザの指紋管理
- 検証頻度を減らすためのブラウザ状態の自動保存および復元
- スマートヘッドレス/ヘッドモード切り替え:検証が必要な際に自動的にヘッドモードに切り替わる
- 検出リスクを減らすためにデバイスおよびロケーション設定のランダム化
- 生のHTML検索:検索結果ページの生のHTML(CSSとJavaScriptが削除された状態)を取得し、Googleのページ構造が変更された際に分析やデバッグを行う機能
- ページスクリーンショット:HTMLコンテンツを保存する際に、全ページのスクリーンショットを自動的にキャプチャ・保存します
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Google Search Tool
A Playwright-based Node.js tool that bypasses search engine anti-scraping mechanisms to execute Google searches and extract results. It can be used directly as a command-line tool or as a Model Context Protocol (MCP) server to provide real-time search capabilities to AI assistants like Claude.
Key Features
- Local SERP API Alternative: No need to rely on paid search engine results API services, all searches are executed locally
- Advanced Anti-Bot Detection Bypass Techniques:
- Intelligent browser fingerprint management that simulates real user behavior
- Automatic saving and restoration of browser state to reduce verification frequency
- Smart headless/headed mode switching, automatically switching to headed mode when verification is needed
- Randomization of device and locale settings to reduce detection risk
- Raw HTML Retrieval: Ability to fetch the raw HTML of search result pages (with CSS and JavaScript removed) for analysis and debugging when Google’s page structure changes
- Page Screenshot: Automatically captures and saves a full-page screenshot when saving HTML content
- MCP Server Integration: Provides real-time search capabilities to AI assistants like Claude without requiring additional API keys
- Completely Open Source and Free: All code is open source with no usage restrictions, freely customizable and extensible
Technical Features
- Developed with TypeScript, providing type safety and better development experience
- Browser automation based on Playwright, supporting multiple browser engines
- Command-line parameter support for search keywords
- MCP server support for AI assistant integration
- Returns search results with title, link, and snippet
- Option to retrieve raw HTML of search result pages for analysis
- JSON format output
- Support for both headless and headed modes (for debugging)
- Detailed logging output
- Robust error handling
- Browser state saving and restoration to effectively avoid anti-bot detection
Installation
# Install from source
git clone https://github.com/web-agent-master/google-search.git
cd google-search
# Install dependencies
npm install
# Or using yarn
yarn
# Or using pnpm
pnpm install
# Compile TypeScript code
npm run build
# Or using yarn
yarn build
# Or using pnpm
pnpm build
# Link package globally (required for MCP functionality)
npm link
# Or using yarn
yarn link
# Or using pnpm
pnpm link
Windows Environment Notes
This tool has been specially adapted for Windows environments:
.cmdfiles are provided to ensure command-line tools work properly in Windows Command Prompt and PowerShell- Log files are stored in the system temporary directory instead of the Unix/Linux
/tmpdirectory
インストール
npx google-search-mcp設定
{
"mcpServers": {
"google-search": {
"command": "npx",
"args": ["google-search-mcp"]
}
}
}