G-Search MCP 是一个强大的 MCP 服务器,专为 Google 搜索而设计。它支持同时使用多个关键词进行并行搜索,极大地提高了搜索效率,为用户带来更高效的搜索体验。
该项目基于google-search进行修改。
直接使用 npx 运行:
npx -y g-search-mcp
首次安装时,请先在终端中执行以下命令以安装所需的浏览器:
npx playwright install chromium
使用--debug选项以调试模式运行(显示浏览器窗口):
npx -y g-search-mcp --debug
git clone https://github.com/jae-jae/g-search-mcp.git
cd g-search-mcp
npm install
npm run install-browser
npm run build
执行并行搜索:
g-search-mcp search --queries keyword1,keyword2 --limit 5
获取实时汇率数据:
g-search-mcp fetcher --url https://www.google.com/finance/markets/currencies/EURUSD=X --xpath //*[@class=' financial-data-bucket__value']
搜索结果将以 JSON 格式返回,示例如下:
{
"results": [
{
"title": "关键词1的相关内容",
"url": "https://example.com/keyword1",
"snippet": "关键词1的简要描述..."
},
{
"title": "关键词2的相关内容",
"url": "https://example.com/keyword2",
"snippet": "关键词2的简要描述..."
}
]
}
⚠️ 重要提示
- 处理特殊网站场景时,可通过自定义脚本实现对特定网页内容的提取和处理。
- 调试与故障排除时,需检查浏览器驱动是否正确安装并保持最新,确保网络连接稳定,避免因超时导致搜索失败,定期清理缓存以提高搜索效率。
在 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 搜索,支持多个关键词并返回结果
queries:要执行的搜索查询数组(必填参数)limit:每个查询的最大返回结果数,默认为 10timeout:页面加载超时时间(以毫秒为单位),默认 60000(60 秒)noSaveState:是否避免保存浏览器状态,默认为 falseproxy:代理设置,支持 HTTP、HTTPS 和 SOCKS 协议region:指定搜索区域(如"us"表示美国)npm run watch
npm run inspector
本项目 licensed under the MIT License