MCP Googleカスタム検索サーバー
Google Custom Search API を通じてウェブ検索機能を提供するモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、言語学習モデル(LLM)は標準化されたインターフェースを使用してウェブ検索を実行できるようになります。
🌟 特徴
Googleカスタム検索APIとのシームレスな統合
モデルコンテキストプロトコル(MCP)準拠のサーバー実装
TypeScriptを使用した型安全な実装
環境変数の設定
Zodを使用した入力検証
設定可能な検索結果(クエリごとに最大 10 件)
タイトル、URL、説明を含むフォーマットされた検索結果
エラー処理と検証
Claude Desktopおよびその他のMCPクライアントと互換性があります
📋 前提条件
始める前に、次のものを用意してください。
カスタム検索 API が有効になっている Google Cloud プロジェクト
Google Cloud Consoleにアクセス
カスタム検索APIを有効にする
API認証情報を作成する
カスタム検索エンジンID
プログラマブル検索エンジンにアクセス
新しい検索エンジンを作成する
検索エンジンIDを取得する
ローカル開発要件:
Node.js (v18以上)
npm (Node.js に付属)
🚀 クイックスタート
リポジトリをクローンします。
git clone https://github.com/yourusername/mcp-google-custom-search-server.git cd mcp-google-custom-search-server依存関係をインストールします:
npm install.env ファイルを作成します。
GOOGLE_API_KEY=your-api-key GOOGLE_SEARCH_ENGINE_ID=your-search-engine-idサーバーを構築します。
npm run buildサーバーを起動します。
npm start
🔧 構成
環境変数
変数 | 説明 | 必須 |
GOOGLE_API_KEY | Googleカスタム検索APIキー | はい |
GOOGLE_SEARCH_ENGINE_ID | カスタム検索エンジンID | はい |
クロードデスクトップ統合
この構成を Claude Desktop 構成ファイル (通常は~/Library/Application Support/Claude/claude_desktop_config.json
にあります) に追加します。
📖 APIリファレンス
利用可能なツール
検索
Google カスタム検索 API を使用して Web 検索を実行します。
パラメータ:
query
(文字列、必須): 実行する検索クエリnumResults
(数値、オプション): 返される結果の数デフォルト: 5
最大: 10
応答例:
🛠️ 開発
プロジェクト構造
利用可能なスクリプト
npm run build
: TypeScript を JavaScript にコンパイルするnpm start
: MCPサーバーを起動するnpm run dev
: 開発用のウォッチモード
テスト
MCP Inspector の使用:
npx @modelcontextprotocol/inspector node build/index.jsサンプルクエリを使用した手動テスト:
# After starting the server {"jsonrpc":"2.0","id":1,"method":"callTool","params":{"name":"search","arguments":{"query":"example search"}}}
📝 ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。
🙏 謝辞
Googleのカスタム検索APIを使用
LLMアプリケーションにおけるより優れた検索機能の必要性に着想を得て
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
LLM が標準化されたインターフェースを通じて Google のカスタム検索 API を使用して Web 検索を実行できるようにするモデル コンテキスト プロトコル サーバー。
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that enables LLMs to perform Google searches via the Serper API, allowing models to retrieve current information from the web.Last updated -1315
- AsecurityFlicenseAqualityA Model Context Protocol server that provides web search capabilities using Google Custom Search API and webpage content extraction functionality.Last updated -241
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLM clients like VSCode, Copilot, and Claude Desktop to search the web using Google Programmable Search Engine API.Last updated -1157Apache 2.0
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to perform web searches using Google's Gemini API and return synthesized responses with citations.Last updated -47MIT License