Skip to main content
Glama
limklister

MCP Google Custom Search Server

by limklister

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

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

🌟 特徴

  • Googleカスタム検索APIとのシームレスな統合

  • モデルコンテキストプロトコル(MCP)準拠のサーバー実装

  • TypeScriptを使用した型安全な実装

  • 環境変数の設定

  • Zodを使用した入力検証

  • 設定可能な検索結果(クエリごとに最大 10 件)

  • タイトル、URL、説明を含むフォーマットされた検索結果

  • エラー処理と検証

  • Claude Desktopおよびその他のMCPクライアントと互換性があります

Related MCP server: MCP Server for Google Search

📋 前提条件

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

  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_KEY

Googleカスタム検索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 ファイルを参照してください。

🙏 謝辞

Install Server
A
security – no known vulnerabilities
A
license - permissive license
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/limklister/mcp-google-custom-search-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server