Google Chrome 搜索内容提取器
通过 Chrome 为 macOS 启用 Google 搜索和网页内容提取,可访问经过身份验证和未经过身份验证的内容,并与 Claude 集成以实现安全且自动化的浏览任务。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mcp-chrome-google-search": {
"args": [
"-y",
"@cmann50/mcp-chrome-google-search"
],
"command": "npx"
}
}
}
服务介绍
MCP Chrome Google Search Tool
MCP 工具,使用 Chrome 浏览器进行 Google 搜索和网页内容提取。与 Claude 配合使用,以实现 Google 搜索和内容获取功能。
快速安装
-
配置 Claude Desktop
- 在 Mac 上打开 Claude Desktop
- 前往 Claude > 设置 > 开发者 > 编辑配置
- 将以下内容添加到您的配置文件中:
{ "mcpServers": { "mcp-chrome-google-search": { "command": "npx", "args": [ "-y", "@cmann50/mcp-chrome-google-search" ] } } }- 重启 Claude Desktop
-
首次设置
-
授予辅助功能权限
- 第一次运行时,批准 macOS 辅助功能权限提示
- 导航至:系统偏好设置 > 安全性与隐私 > 隐私 > 辅助功能
- 添加并启用终端应用程序的权限
-
启用来自 Apple 事件的 Chrome JavaScript
- 打开 Chrome
- 导航至:查看 > 开发者 > 允许来自 Apple 事件的 JavaScript
- 仅需设置一次
-
配置完成后,当您发出请求时,Claude 将能够通过 Chrome 进行 Google 搜索并提取网页内容。
主要优势
- 免费搜索 Google
- 打开小窗口并使用您的 Chrome 浏览器,因此不会被阻止
- 由于使用的是您的 Chrome 窗口,它可以访问经过身份验证的内容。Claude 可以直接在您的浏览器中打开 URL。
平台支持
- ✅ macOS
- ❌ Windows(不支持)
- ❌ Linux(不支持)
要求
- macOS
- Google Chrome
- Node.js 20 或更高版本
替代安装方法
NPX 安装
npx mcp-chrome-google-search
自定义安装
- 从 git 仓库检出
- 运行
npm run build - 添加到 Claude 配置文件(使用绝对路径):
{
"google-tools": {
"command": "node",
"args": [
"/your/checkout/path/mcp/mcp-chrome-google-search/dist/index.js"
]
}
}
本地开发
要测试本地更改,请更新 package.json 版本并运行
以进入编辑模式:
npm install -g .
然后只需执行 npm run build,文件将进入 dist 目录,Claude 会在此处监控
然后在 Claude 桌面中按 ctrl-R,无需重新启动
调试
日志监控
# Follow logs in real-time
tail -n 20 -F ~/Library/Logs/Claude/mcp*.log
开发工具访问
- 启用开发者设置:
echo '{"allowDevTools": true}' > ~/Library/Application\ Support/Claude/developer_settings.json
- 打开 DevTools:在 Claude 桌面中按 Command-Option-Shift-i
- 在 Claude 桌面中使用 ctrl-r 并跟踪以获得更好的错误信息
故障排除
Chrome JavaScript 错误
如果您看到:
execution error: Google Chrome got an error: Executing JavaScript through AppleScript
is turned off. For more information: https://support.google.com/chrome/?p=applescript (12)
解决方案:
- 打开 Chrome
- 查看 > 开发者 > 允许来自 Apple 事件的 JavaScript
辅助功能权限问题
如果 Chrome 控制失败:
- 打开系统偏好设置
- 安全性与隐私 > 隐私 > 辅助功能
- 确保终端应用程序已列出并启用
- 如有需要,使用锁定图标进行更改
实现细节
- 使用 AppleScript 控制 Chrome
- 可见自动化 - Chrome 窗口将打开/导航
- 每个请求都会打开一个新的 Chrome 标签页
- 定期关闭未使用的标签页以优化性能
- 仅与受信任的 Claude 实例一起使用(具有 Chrome 控制访问权限)
支持
- 为问题创建 GitHub issues
- 包含 macOS 和 Chrome 版本详情
许可证
MIT 许可证 - 详见 LICENSE 文件中的详细信息