MCP Google Custom Search Server

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.

Integrations

  • Enables web search capabilities through Google's Custom Search API, allowing users to retrieve search results with titles, URLs, and descriptions.

  • Uses Google Cloud's Custom Search API to perform web searches with configurable results (up to 10 per query).

MCP Googleカスタム検索サーバー

Google Custom Search API を通じてウェブ検索機能を提供するモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、言語学習モデル(LLM)は標準化されたインターフェースを使用してウェブ検索を実行できるようになります。

🌟 特徴

  • Googleカスタム検索APIとのシームレスな統合
  • モデルコンテキストプロトコル(MCP)準拠のサーバー実装
  • TypeScriptを使用した型安全な実装
  • 環境変数の設定
  • Zodを使用した入力検証
  • 設定可能な検索結果(クエリごとに最大 10 件)
  • タイトル、URL、説明を含むフォーマットされた検索結果
  • エラー処理と検証
  • Claude Desktopおよびその他のMCPクライアントと互換性があります

📋 前提条件

始める前に、次のものを用意してください。

  1. カスタム検索 API が有効になっている Google Cloud プロジェクト
    • Google Cloud Consoleにアクセス
    • カスタム検索APIを有効にする
    • API認証情報を作成する
  2. カスタム検索エンジンID
  3. ローカル開発要件:
    • Node.js (v18以上)
    • npm (Node.js に付属)

🚀 クイックスタート

  1. リポジトリをクローンします。
    git clone https://github.com/yourusername/mcp-google-custom-search-server.git cd mcp-google-custom-search-server
  2. 依存関係をインストールします:
    npm install
  3. .env ファイルを作成します。
    GOOGLE_API_KEY=your-api-key GOOGLE_SEARCH_ENGINE_ID=your-search-engine-id
  4. サーバーを構築します。
    npm run build
  5. サーバーを起動します。
    npm start

🔧 構成

環境変数

変数説明必須
GOOGLE_API_KEYGoogleカスタム検索APIキーはい
GOOGLE_SEARCH_ENGINE_IDカスタム検索エンジンIDはい

クロードデスクトップ統合

この構成を Claude Desktop 構成ファイル (通常は~/Library/Application Support/Claude/claude_desktop_config.jsonにあります) に追加します。

{ "mcpServers": { "google-search": { "command": "node", "args": [ "/absolute/path/to/mcp-google-custom-search-server/build/index.js" ], "env": { "GOOGLE_API_KEY": "your-api-key", "GOOGLE_SEARCH_ENGINE_ID": "your-search-engine-id" } } } }

📖 APIリファレンス

利用可能なツール

検索

Google カスタム検索 API を使用して Web 検索を実行します。

パラメータ:

  • query (文字列、必須): 実行する検索クエリ
  • numResults (数値、オプション): 返される結果の数
    • デフォルト: 5
    • 最大: 10

応答例:

Result 1: Title: Example Search Result URL: https://example.com Description: This is an example search result description --- Result 2: ...

🛠️ 開発

プロジェクト構造

mcp-google-custom-search-server/ ├── src/ │ └── index.ts # Main server implementation ├── build/ # Compiled JavaScript output ├── .env # Environment variables ├── package.json # Project dependencies and scripts ├── tsconfig.json # TypeScript configuration └── README.md # Project documentation

利用可能なスクリプト

  • npm run build : TypeScript を JavaScript にコンパイルする
  • npm start : MCPサーバーを起動する
  • npm run dev : 開発用のウォッチモード

テスト

  1. MCP Inspector の使用:
    npx @modelcontextprotocol/inspector node build/index.js
  2. サンプルクエリを使用した手動テスト:
    # After starting the server {"jsonrpc":"2.0","id":1,"method":"callTool","params":{"name":"search","arguments":{"query":"example search"}}}

📝 ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

🙏 謝辞

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Tools

LLM が標準化されたインターフェースを通じて Google のカスタム検索 API を使用して Web 検索を実行できるようにするモデル コンテキスト プロトコル サーバー。

  1. 🌟 Features
    1. 📋 Prerequisites
      1. 🚀 Quick Start
        1. 🔧 Configuration
          1. Environment Variables
          2. Claude Desktop Integration
        2. 📖 API Reference
          1. Available Tools
        3. 🛠️ Development
          1. Project Structure
          2. Available Scripts
          3. Testing
        4. 📝 License
          1. 🙏 Acknowledgments
            ID: y1s99uqqq6