MS

modelcontextprotocol-servers/google-search-mcp

浏览器自动化

本页由 AI 翻译,技术细节请以原文为准。 查看原文

24 stars 6 forks 质量 52 趋势 10

用于谷歌搜索的模型上下文协议服务器。一款基于Playwright的模型上下文协议(MCP)工具,可绕过搜索引擎的反机器人机制,执行谷歌搜索并提取结果,...

概览

用于谷歌搜索的模型上下文协议服务器。基于Playwright的模型上下文协议(MCP)工具,绕过搜索引擎的反机器人机制,执行谷歌搜索并提取结果,为Claude和Cursor等AI助手提供实时搜索功能。 - :使用浏览器指纹伪造和真实用户行为模拟以避免检测 - :遇到验证码时切换为标题模式,允许用户完成验证 - 保存浏览器会话状态以减少重复验证的需求 - :使用多种选择器组合以适应谷歌搜索页面的变化 - :实现模型上下文协议,便于与AI助手集成 - 支持不同语言和地区的搜索结果 1. 进入MCP>光标设置 2.点击 + 添加新MCP服务器 3。填写表格:- 名称:google-search(或您喜欢的任何名称)- 类型:命令 - 命令:npx -y @mcp-server/google-search-mcp@latest 添加一个 .cursor/mcp。

概述(AI 翻译)

用于谷歌搜索的模型上下文协议服务器。 一款基于Playwright的模型上下文协议(MCP)工具,绕过搜索引擎的反机器人机制,执行谷歌搜索并提取结果,为Claude和Cursor等AI助手提供实时搜索功能。

特色

  • 反机器人绕过:利用浏览器指纹伪造和真实用户行为模拟来规避检测
  • 自动验证码处理:遇到验证码时切换到头置模式,允许用户完成验证
  • 状态持久性:保存浏览器会话状态,减少重复验证的需求
  • 适应性:使用多种选择器组合来适应谷歌搜索页面的变化
  • MCP 集成:实现模型上下文协议,便于与 AI 助手集成
  • 多语言支持:支持不同语言和地区的搜索结果

使用光标

安装——全球

使用 npx 运行 MCP 服务器:

在你的光标IDE中

  1. 前往 Cursor Settings > MCP
  2. 点击+ Add New MCP Server
  3. 填写表格:
  • 名称:google-search(或你喜欢的任何名字)
  • 类型:command

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Google Search MCP

Model Context Protocol server for google search. A Playwright-based Model Context Protocol (MCP) tool that bypasses search engine anti-bot mechanisms, performs Google searches, and extracts results, providing real-time search capabilities for AI assistants like Claude and Cursor.

Features

  • Anti-Bot Bypass: Uses browser fingerprint spoofing and real user behavior simulation to avoid detection
  • Automatic CAPTCHA Handling: Switches to headed mode when encountering CAPTCHAs, allowing users to complete verification
  • State Persistence: Saves browser session state to reduce the need for repeated verification
  • Adaptability: Uses multiple selector combinations to adapt to changes in Google search pages
  • MCP Integration: Implements the Model Context Protocol for easy integration with AI assistants
  • Multi-language Support: Supports search results in different languages and regions

Using with Cursor

Installation - Globally

Run the MCP server using npx:

npx -y @mcp-server/google-search-mcp@latest

In your Cursor IDE

  1. Go to Cursor Settings > MCP
  2. Click + Add New MCP Server
  3. Fill in the form:
    • Name: google-search (or any name you prefer)
    • Type: command
    • Command: npx -y @mcp-server/google-search-mcp@latest

Installation - Project-specific

Add an .cursor/mcp.json file to your project:

{
  "mcpServers": {
    "google-search": {
      "command": "npx",
      "args": [
        "-y",
        "@mcp-server/google-search-mcp@latest"
      ]
    }
  }
}

Development

yarn install

Build the project

yarn build

Usage

Running as an MCP Server

yarn start

Using with MCP Inspector

To debug the server, you can use the MCP Inspector:

# First build the project
yarn build

# Start the MCP Inspector and server
npx @modelcontextprotocol/inspector node dist/index.js

Parameters

The search tool accepts the following parameters:

  • query (required): Search query string
  • limit (optional): Number of search results to return, default is 10
  • timeout (optional): Search operation timeout in milliseconds, default is 60000
  • language (optional): Language for search results, e.g., zh-CN, en-US, default is zh-CN
  • region (optional): Region for search results, e.g., cn, com, co.jp, default is cn

How It Works

  1. The tool uses Playwright to control a Chromium browser to perform Google searches
  2. It avoids bot detection through browser fingerprint spoofing and real user behavior simulation
  3. When encountering CAPTCHA verification, it automatically switches to headed mode for user completion
  4. It extracts search results and returns them in a structured format
  5. It saves browser state for reuse in subsequent searches

Advanced Configuration

Browser State File

在 GitHub 查看完整 README

安装

npx -y @mcp-server/google-search-mcp@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "google-search": { "command": "npx", "args": [ "-y", "@mcp-server/google-search-mcp@latest" ] } } }