Skip to main content
Glama
ye4wzp

google-search-mcp-v2

by ye4wzp

Google Search MCP Server v2.0.0

一个强大的 MCP (Model Context Protocol) 服务器,为 Claude Code 提供 Google 搜索和图片搜索能力。

✨ 特性

🔍 搜索功能

  • Google 文本搜索 - 自定义结果数量,支持多语言

  • 网页内容提取 - 智能过滤广告和导航

  • 批量提取 - 并行处理,速度提升 3x

  • 搜索+提取组合 - 一键深度内容检索

🖼️ 图片搜索 (核心功能)

  • 双平台搜索 - Google Images + Pinterest 并行搜索

  • 多模型 AI 视觉分析 - 支持 GLM-4.6V、GPT-4O、Claude 3.5 等

  • S/A/B/C 质量评分 - 基于来源和相似度的智能评分

  • 产品参考图搜索 - 非常适合电商、设计场景

🚀 性能优化

  • 浏览器池 - 单例复用,避免重复启动

  • 并行处理 - 批量操作并发执行

  • 模块化架构 - 代码清晰,易于维护

Related MCP server: Gemini Google Web Search MCP

📦 安装

前置条件

  • Node.js >= 18.0.0

  • Claude Code

安装步骤

# 1. 克隆项目
git clone <repo-url>
cd google-search-mcp-v2

# 2. 安装依赖
npm install

⚙️ 配置

配置 Claude Code

编辑 ~/.claude.json,添加以下配置:

{
  "mcpServers": {
    "google-search": {
      "type": "stdio",
      "command": "node",
      "args": ["/你的路径/google-search-mcp-v2/src/index.js"]
    }
  }
}

重启 Claude Code 生效。

配置 AI 视觉分析 (可选)

设置环境变量以启用 AI 图片分析:

# 智谱 GLM (推荐,国内使用)
export GLM_API_KEY=your_api_key

# 或 OpenAI
export OPENAI_API_KEY=your_api_key

# 或 Anthropic Claude
export ANTHROPIC_API_KEY=your_api_key

# 指定使用的模型 (可选)
export VISION_MODEL=glm-4.6v  # 或 gpt-4o, claude-3.5-sonnet

💡 如果不配置 API Key,图片搜索会使用文件名作为关键词进行搜索(仍然可用)。

🛠️ MCP 工具

工具名

描述

google_search

Google 文本搜索

fetch_url

提取单个网页内容

batch_fetch_urls

批量提取多个网页 (并行)

search_and_extract

搜索并自动提取内容

search_by_image

图片搜索 (双平台 + AI 分析 + 评分)

💻 命令行使用

除了 MCP 模式,还支持命令行直接使用:

# 显示帮助
node src/index.js --help

# Google 搜索
node src/index.js "Node.js 教程"
node src/index.js "React hooks" 5

# 提取网页内容
node src/index.js --fetch https://example.com

# 批量提取
node src/index.js --batch "https://a.com,https://b.com"

# 搜索并提取
node src/index.js --extract "Python 入门" 3

# 图片搜索
node src/index.js --image ./product.jpg 10

📊 图片搜索评分系统

等级

分数范围

说明

🏆 S

85-100

顶级来源 (天猫国际、品牌官网)

⭐ A

75-84

优质来源 (天猫、京东、亚马逊)

✓ B

60-74

普通来源 (淘宝、Pinterest)

○ C

0-59

其他来源

📁 项目结构

google-search-mcp-v2/
├── src/
│   ├── index.js          # 入口
│   ├── mcp-server.js     # MCP 协议处理
│   ├── cli.js            # 命令行模式
│   ├── config.js         # 配置管理
│   │
│   ├── browser/
│   │   └── pool.js       # 浏览器池 (单例复用)
│   │
│   ├── tools/
│   │   ├── google-search.js
│   │   ├── fetch-url.js
│   │   ├── search-extract.js
│   │   └── image-search.js
│   │
│   ├── image/
│   │   ├── google-images.js
│   │   ├── pinterest.js
│   │   └── scorer.js     # S/A/B/C 评分
│   │
│   ├── ai/
│   │   ├── models.js     # 视觉模型配置
│   │   └── vision.js     # AI 分析
│   │
│   └── utils/
│       └── logger.js
│
├── package.json
└── README.md

🔧 支持的 AI 模型

模型

环境变量

说明

GLM-4.6V

GLM_API_KEY

智谱 AI,国内推荐

GLM-4V

GLM_API_KEY

智谱 AI

GPT-4O

OPENAI_API_KEY

OpenAI 最新视觉模型

GPT-4 Turbo

OPENAI_API_KEY

OpenAI

Claude 3.5 Sonnet

ANTHROPIC_API_KEY

Anthropic

📄 License

MIT

Available Tools

5 tools
batch_fetch_urlsA

批量提取多个网页的内容(并行处理,速度更快)

ParametersJSON Schema
NameRequiredDescriptionDefault
urlsYesURL 数组

TDQS

A3.6/5.0
Behavior3/5

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

The description mentions parallel processing and faster performance, but lacks details on rate limits, error handling, or response format. With no annotations, more behavioral context would be beneficial.

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 very concise: a single sentence with key information front-loaded. No wasted words.

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 batch fetch tool with no output schema and no annotations, the description is moderately complete. It explains the basic purpose and parallelism, but lacks details on limits, errors, or output structure.

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

Parameters2/5

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

The parameter schema already describes the 'urls' parameter as a URL array. The description adds no additional meaning beyond that, such as URL format or constraints. Schema coverage is 100%, but the description does not compensate.

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's function: batch extraction of multiple web pages with parallel processing. It distinguishes itself from siblings like fetch_url (single URL) and search tools.

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

Usage Guidelines3/5

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

The description implies usage for multiple URLs, but does not explicitly state when to use vs. alternatives like fetch_url for single URLs or search tools for finding content. No when-not-to-use guidance.

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

fetch_urlB

提取单个网页内容,返回标题和正文

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes要提取内容的网页 URL

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description bears full burden for behavioral disclosure. It states the output (title and body) but does not disclose error handling, rate limits, rendering behavior, authentication needs, or what happens with invalid URLs. This is minimal transparency for a web fetching tool.

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, front-loaded sentence with no extraneous content. Every word is essential, achieving maximum conciseness while conveying purpose and output.

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

Completeness4/5

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

Given the tool's simplicity (1 parameter, no output schema), the description adequately covers its core function and return value. However, it could be more complete by briefly noting limitations or exceptions (e.g., 'if the page is not accessible, an error is returned'). Still, for a basic fetch tool, it is mostly sufficient.

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 coverage is 100% (url parameter has a clear description). The tool description adds the overall purpose and output format, but does not provide additional semantic detail about the parameter beyond what the schema already says ('要提取内容的网页 URL'). Baseline 3 is appropriate as the description does not enhance parameter understanding further.

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 verb '提取' (extract) and resource '单个网页内容' (single web page content), and specifies output '标题和正文' (title and body). It effectively distinguishes from siblings like batch_fetch_urls (which handles multiple URLs) and search_and_extract (which likely involves searching first).

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?

No explicit guidance on when to use this tool versus alternatives. While the description implies single-URL scope, it doesn't mention that batch operations should use batch_fetch_urls or that search scenarios should use search_and_extract. The agent is left to infer usage context.

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

search_and_extractC

搜索后自动提取前N个结果的完整内容

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes搜索关键词
maxResultsNo搜索并提取结果数量 (默认 3)

TDQS

C2.9/5.0
Behavior2/5

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

No annotations exist, so the description bears full burden. It mentions automatic extraction of 'full content' but omits behavioral traits like potential multiple HTTP requests, rate limiting, or memory/time costs, which are crucial for an agent to understand.

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

Conciseness4/5

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

The description is a single, front-loaded sentence with no wasted words. It efficiently conveys the core purpose, though a bit more structure (e.g., listing steps) could improve clarity.

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

Completeness2/5

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

Given lack of output schema and sibling tools (google_search, fetch_url, etc.), the description fails to explain return value structure, highlight limitations, or clarify differentiation, leaving agents to infer too much.

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 coverage is 100%; both parameters (query, maxResults) have descriptions. The description adds 'extract result count (default 3)' for maxResults, but this largely mirrors the schema. No additional constraints or usage nuances are provided.

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

Purpose4/5

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

The description clearly states the tool performs a search and automatically extracts the full content of the top N results. It distinguishes the combined action but does not explicitly differentiate from siblings like google_search (snippets only) or fetch_url (single URL).

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?

No guidance is provided on when to use this tool versus alternatives, such as for contexts requiring full-page extraction versus snippet-only searches. Prerequisites or exclusions are absent.

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

search_by_imageB

上传产品图片,搜索相似产品参考图(双平台: Google + Pinterest,支持 AI 视觉分析,S/A/B/C 质量评分)

ParametersJSON Schema
NameRequiredDescriptionDefault
image_pathYes产品图片的本地文件路径
max_resultsNo返回结果数量 (默认 10)
enable_ai_analysisNo启用 AI 分析(需要配置 API Key)

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description bears full transparency burden. It discloses dual-platform search and AI analysis, but lacks details on authentication requirements, error handling, rate limits, or what happens when the image is invalid. It adds moderate behavioral context beyond the schema.

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

Conciseness4/5

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

Single sentence packs key information but uses Chinese with parentheticals. It is front-loaded and efficient, though structure could be improved for machine parsing.

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?

No output schema exists, so description should explain return value structure. It mentions '相似产品参考图' but not format or fields. For a tool with 3 parameters, the description is adequate but lacks return specification.

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 coverage is 100% for 3 parameters. The description does not add meaning beyond what the schema already provides for image_path, max_results, and enable_ai_analysis. Baseline of 3 is appropriate as schema already documents parameters adequately.

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's function: uploading a product image to search for similar reference images across Google and Pinterest, with AI visual analysis and quality scoring. It distinguishes clearly from sibling tools like google_search or fetch_url, which are text-based URL fetch tools.

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?

No explicit guidance on when to use this tool versus alternatives. The description implies usage for image-based product search but does not mention exclusions, prerequisites, or when to choose a sibling tool instead.

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.

  1. 5 tool updatesv2.0.0
    • First observedbatch_fetch_urls
    • First observedfetch_url
    • First observedgoogle_search
    • First observedsearch_and_extract
    • First observedsearch_by_image

TDQS

B3.3/5.0

Scored across 5 tools

Disambiguation4/5

Each tool has a distinct purpose, but search_and_extract combines functionality of google_search and batch_fetch_urls, which could cause some ambiguity for agents that only need raw search results.

Naming Consistency3/5

Naming conventions are mixed: google_search is branded, fetch_url/batch_fetch_urls follow verb_noun, while search_and_extract and search_by_image use different patterns (verb_and_verb, verb_prep_noun).

Tool Count5/5

With 5 tools covering basic search, content extraction, and image search, the count is well-scoped for a search-focused server without unnecessary bloat.

Completeness4/5

Core operations (search, fetch, combined, image search) are covered, but missing pagination and advanced search filters represent minor gaps for more complex workflows.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that enables Claude to perform web searches using Perplexity's API with intelligent model selection based on query intent and support for domain and recency filtering.
    6
    4
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that enables AI models to perform Google Web searches using the Gemini API, complete with citations and grounding metadata for accurate information retrieval. It is compatible with Claude Desktop and other MCP clients for real-time web access.
    1
    3
    Apache 2.0
  • F
    license
    D
    quality
    D
    maintenance
    A local MCP server providing free network access capabilities including HTTP requests, web search, webpage content extraction, and optional screenshots, designed for integration with Claude Desktop or Claude Code.
    6
    -