Skip to main content
Glama
XRayZen

simple-google-search-mcp

by XRayZen

Simple Google Search MCP

Model Context Protocol (MCP)準拠のGoogle検索サービス

  • Vibe Coding・調べ物のお供にどうぞ!

English version here (英語版はこちら)

機能

  • Google Custom Search APIを利用した検索機能

  • ウェブページの内容解析・抽出機能

  • 複数ウェブページの一括解析機能

  • 高度な検索オプション対応:

    • 日付制限(date_restrict)

    • 言語指定(language)

    • 国・地域指定(country)

    • セーフサーチ(safe_search)

Related MCP server: MCP Local Web Search Server

セットアップ

前提条件

  • Node.js 16以上

  • Google Custom Search API キー

  • Google Custom Search Engine ID

インストール

npm install

設定

以下の方法でGoogle APIキーを設定してください:

方法1:環境変数を使用

export GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY
export GOOGLE_SEARCH_ENGINE_ID=YOUR_SEARCH_ENGINE_ID

ビルド

npm run build

サーバーの起動

npm start

Clineでの導入方法

Clineは、VS Code向けの自律型コーディングエージェントで、MCPサーバーとの統合をネイティブにサポートしています。Google Search MCPをClineで使用するには:

前提条件

  • VS Codeのインストール

  • Cline拡張機能のインストール

  • Google APIキーとSearch Engine IDの取得(上記の「セットアップ」セクション参照)

手順

  1. Google Search MCPサーバーをクローンして設定:

git clone https://github.com/your-username/google-search-mcp.git
cd google-search-mcp
npm install
  1. サーバーをビルドして起動:

npm run build
npm start
  1. Clineでの設定:

    • VS Codeを開き、Cline拡張機能が有効になっていることを確認

    • ~/Documents/Cline/MCP ディレクトリ(Windowsの場合は%USERPROFILE%\Documents\Cline\MCP)に以下のような設定ファイルを追加

{
  "google-search-mcp": {
    "autoApprove": [
      "google_search",
      "extract_webpage_content",
      "extract_multiple_webpages"
    ],
    "disabled": false,
    "timeout": 60,
    "command": "node",
    "args": [
      "/path/to/google-search-mcp/dist/index.js"
    ],
    "env": {
      "GOOGLE_API_KEY": "YOUR_GOOGLE_API_KEY",
      "GOOGLE_SEARCH_ENGINE_ID": "YOUR_SEARCH_ENGINE_ID"
    },
    "transportType": "stdio"
  }
}
  • Clineチャットで @GoogleSearch または関連ツール名を使用して機能を呼び出し

設定ファイルの説明

  • autoApprove: 自動承認するツールのリスト

  • disabled: MCPサーバーを無効にするかどうか

  • timeout: タイムアウト時間(秒)

  • commandargs: MCPサーバーを起動するコマンドと引数

  • env: 環境変数の設定

  • transportType: 通信方式("stdio"または"sse")

利用例

Clineチャットで以下のように使用できます:

@GoogleSearch React関連の最新ニュースを探して

@ExtractWebpage https://example.com/react-news からコンテンツを抽出

詳細な使用方法については、Cline公式ドキュメントを参照してください。

使用方法

このMCPサーバーは、StandardIOを介してモデルと通信します。サポートされているツールは:

Google検索を実行し、結果を返します。

引数:

  • query (必須): 検索クエリ

  • num_results (オプション): 返す結果の数(デフォルト: 5、最大: 10)

  • date_restrict: 特定の期間に絞り込み (例: 'd1'=過去1日, 'w2'=過去2週間, 'm3'=過去3ヶ月, 'y1'=過去1年)

  • language: 言語絞り込み - ISO 639-1コード (例: 'en'=英語, 'ja'=日本語)

  • country: 国・地域絞り込み - ISO 3166-1 alpha-2コード (例: 'us'=米国, 'jp'=日本)

  • safe_search: セーフサーチレベル ('off'=フィルタなし, 'medium'=中程度, 'high'=厳格)

extract_webpage_content

指定されたURLからウェブページのコンテンツを抽出し、読みやすいテキスト形式で返します。

引数:

  • url (必須): コンテンツを抽出するウェブページのURL(http://またはhttps://で始まる必要あり)

extract_multiple_webpages

複数のウェブページから一括でコンテンツを抽出します。

引数:

  • urls (必須): コンテンツを抽出するウェブページのURLの配列(最大5つまで)

プログラムからの利用

import { GoogleSearchService } from 'google-search-mcp';

const service = new GoogleSearchService();

// 基本的な検索
const results = await service.search('TypeScript programming');

// 結果数を指定
const limitedResults = await service.search('AI trends', 3);

// 高度な検索オプションの使用
const advancedResults = await service.search('programming', 5, {
  date_restrict: 'm3', // 過去3ヶ月以内
  language: 'ja',      // 日本語
  country: 'jp',       // 日本
  safe_search: 'high'  // 厳格なセーフサーチ
});

// ウェブページの内容抽出
const content = await service.extractWebpage('https://example.com');

// 複数ウェブページの一括抽出
const batchResults = await service.batchExtractWebpages([
  'https://example.com',
  'https://example.org'
]);

テスト

テスト実行には以下のコマンドを使用します:

npm test

テストコードには以下の機能が含まれています:

  • Google検索のテスト

  • 単一ウェブページからのコンテンツ抽出テスト

  • 複数ウェブページからのコンテンツ抽出テスト

  • エラー処理テスト

カスタマイズ

より高度な機能を追加するには、サーバー実装を拡張してください。

注意事項

  • Google Custom Search APIには使用制限があります。詳細はGoogle Custom Search APIのドキュメントを参照してください。

  • 一部の検索オプションはGoogle Custom Search APIのプランによって利用できない場合があります。

Available Tools

3 tools
extract_multiple_webpagesA

Extract and analyze content from multiple webpages in a single request. Limited to 5 URLs per request to maintain performance.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlsYesArray of webpage URLs to extract content from. Each URL must be public and start with http:// or https://. Maximum 5 URLs per request.

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description mentions content extraction with analysis and a performance limit, but lacks details on return format, error handling, or authentication needs. With no annotations provided, the description carries the full burden, and it falls short of fully disclosing behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that conveys the core functionality and constraint without any wasted words. It is well-structured and front-loaded with essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (single array parameter, no output schema), the description covers the basic purpose and constraint. However, it omits information about response structure, potential failure modes, and the meaning of 'analyze', leaving some gaps for complete context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% coverage, including details about public URLs and the 5-URL limit. The description does not add additional parameter meaning beyond what the schema already provides, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool extracts and analyzes content from multiple webpages, specifying the verb 'extract and analyze' and the resource 'multiple webpages'. It also mentions the 5-URL limit, distinguishing it from single-page extraction tools like its sibling 'extract_webpage_content'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies batch extraction for multiple URLs and sets a performance limit of 5 URLs, providing guidance on when to use. While it doesn't explicitly exclude alternatives, the sibling tool names suggest single URL extraction, making the context clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extract_webpage_contentA

Extract and analyze content from a webpage, converting it to readable text. This tool fetches the main content while removing ads, navigation elements, and other clutter.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesFull URL of the webpage to extract content from (must start with http:// or https://).

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the burden. It discloses that the tool fetches main content and removes clutter, which is helpful. However, it omits details like handling of dynamic content, JavaScript, authentication, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with clear front-loading of purpose. Every word adds value with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-param tool, the description covers core functionality but lacks usage guidelines relative to siblings and provides no output structure details (no output schema). Adequate but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (one parameter fully described). The description adds no additional meaning beyond what the schema already provides, so it meets the baseline but does not exceed it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool extracts and analyzes webpage content, converting it to readable text by removing ads and clutter. It implicitly distinguishes from siblings: extract_multiple_webpages (multiple pages) and google_search (search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus its siblings, nor any when-not-to-use scenarios. It simply states functionality without context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • First observedextract_multiple_webpages
    • First observedextract_webpage_content
    • First observedgoogle_search

TDQS

A4/5.0
Disambiguation5/5

Each tool serves a distinct purpose: google_search for searching, extract_webpage_content for single page extraction, and extract_multiple_webpages for batch extraction. No overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (google_search, extract_webpage_content, extract_multiple_webpages), making them predictable and easy to understand.

Tool Count5/5

With three tools, the server is well-scoped for simple Google search and content extraction. Each tool earns its place without redundancy or excess.

Completeness5/5

The tools cover the core workflow: search, single-page extraction, and multi-page extraction. No obvious gaps for the stated purpose of simple Google search and content analysis.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Provides web search capabilities using Google Custom Search API, enabling users to perform searches through a Model Context Protocol server.
    2
    213
    68
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables performing local web searches and extracting structured content from web pages using the Model Context Protocol, featuring customizable result limits and domain filtering.
    11
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables users to perform Google Custom Search queries through the Model Context Protocol. Requires Google API credentials and Custom Search Engine configuration for web search functionality.
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables performing Google searches using the Custom Search Engine API with support for various parameters like date restriction, site search, and file type. Returns search results in a conversational format.
    1
    Apache 2.0

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/XRayZen/simple-google-search-mcp'

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