谷歌多关键词搜索服务器
一个功能强大的MCP服务器,可实现同时使用多个关键词进行并行Google搜索,提供结构化结果的同时处理验证码并模拟用户浏览模式。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"g-search": {
"args": [
"-y",
"g-search-mcp"
],
"command": "npx"
}
}
}
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
search 6 个参数 需填 1 项
Search on Google for multiple keywords and return the results
必填参数:queries
服务介绍
G-Search MCP
一个强大的MCP服务器,用于在Google上同时使用多个关键词进行并行搜索。
该项目修改自 google-search。
优势
- 并行搜索:支持同时使用多个关键词在Google上进行搜索,提高搜索效率
- 浏览器优化:在一个浏览器实例中打开多个标签页以实现高效的并行搜索
- 自动验证处理:智能检测验证码,并在需要时启用可见浏览器模式供用户验证
- 用户行为模拟:模拟真实用户的浏览模式以减少被搜索引擎检测的可能性
- 结构化数据:以JSON格式返回结构化的搜索结果,便于处理和分析
- 可配置参数:支持多种参数配置,如搜索结果限制、超时设置、区域设置等
快速开始
直接使用npx运行:
npx -y g-search-mcp
首次设置 - 在终端中运行以下命令安装所需的浏览器:
npx playwright install chromium
调试模式
使用--debug选项以调试模式运行(显示浏览器窗口):
npx -y g-search-mcp --debug
配置MCP
在Claude Desktop中配置此MCP服务器:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"g-search": {
"command": "npx",
"args": ["-y", "g-search-mcp"]
}
}
}
功能
search- 使用多个关键词执行Google搜索并返回结果- 使用Playwright浏览器执行搜索
- 支持以下参数:
queries: 要执行的搜索查询数组(必需参数)limit: 每个查询的最大返回结果数量,默认为10timeout: 页面加载超时时间(毫秒),默认为60000(60秒)noSaveState: 是否避免保存浏览器状态,默认为falselocale: 搜索结果的语言环境设置,默认为en-USdebug: 是否启用调试模式(显示浏览器窗口),覆盖命令行中的--debug标志
示例用法:
Use the search tool to search for "machine learning" and "artificial intelligence" on Google
示例响应:
{
"searches": [
{
"query": "machine learning",
"results": [
{
"title": "What is Machine Learning? | IBM",
"link": "https://www.ibm.com/topics/machine-learning",
"snippet": "Machine learning is a branch of artificial intelligence (AI) and computer science which focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy."
},
...
]
},
{
"query": "artificial intelligence",
"results": [
{
"title": "What is Artificial Intelligence (AI)? | IBM",
"link": "https://www.ibm.com/topics/artificial-intelligence",
"snippet": "Artificial intelligence leverages computers and machines to mimic the problem-solving and decision-making capabilities of the human mind."
},
...
]
}
]
}
使用技巧
处理特殊网站场景
调整搜索参数
-
搜索结果数量:对于更多搜索结果的需求:
请为每个关键词返回前20条搜索结果这将设置
limit: 20参数。 -
增加超时时间:对于加载缓慢的情况:
请将页面加载超时设置为120秒这将调整
timeout参数至120000毫秒。
调整语言环境设置
- 更改搜索区域: 指定不同的区域设置:
这将设置请使用中文区域设置 (zh-CN) 进行搜索locale: "zh-CN"参数。
调试和故障排除
启用调试模式
- 动态调试激活: 在特定的搜索操作中显示浏览器窗口:
即使服务器启动时没有使用请为此搜索操作启用调试模式--debug标志,这也会设置debug: true。
安装
前提条件
- Node.js 18 或更高版本
- NPM 或 Yarn
从源代码安装
- 克隆仓库:
git clone https://github.com/jae-jae/g-search-mcp.git
cd g-search-mcp
- 安装依赖项:
npm install
- 安装 Playwright 浏览器:
npm run install-browser
- 构建服务器:
npm run build
开发
自动重建(开发模式)
npm run watch
使用 MCP Inspector 进行调试
npm run inspector
相关项目
- fetcher-mcp: 一个强大的 MCP 服务器,用于使用 Playwright 无头浏览器抓取网页内容。具有智能内容提取、并行处理、资源优化等功能,是理想的网页内容抓取工具。
许可证
本项目根据 MIT License 许可发布。