返回市场
MCP浏览器自动化

MCP浏览器自动化

作者:hrmeetsingh11 星标更新:2025-01-01

项目介绍

MCP浏览器自动化

这是一个示例项目,用于练习基于模型上下文协议(Model Context Protocol)的服务器实现,以使用Playwright进行浏览器自动化。它与Claude桌面客户端交互,接受用户提示并使用服务器控制浏览器。

<a href="https://glama.ai/mcp/servers/hokppvk1dy"><img width="380" height="200" src="https://gips3.baidu.com/it/u=3678335612,476499674&fm=3081&app=3081&f=PNG?w=760&h=400" alt="浏览器自动化服务器MCP服务器" /></a>

先决条件

构建

  1. 克隆仓库:git clone https://github.com/hrmeetsingh/mcp-browser-automation.git
  2. 安装依赖:npm install
  3. 验证输出可执行文件是否存在于dist文件夹中

集成

  1. ~/Application\ Support/Claude/claude_desktop_config.json创建配置文件(这是针对macOS的)
  2. 将以下内容复制到文件中:
{
  "mcpServers": {
    "mcp-browser-automation": {
      "command": "node",
      "args": ["/path/to/mcp-browser-automation/dist/index.js"]
    }
  }
}
  1. 启动Claude桌面

使用方法

  1. 打开Claude桌面
  2. 开始新的对话以打开浏览器并导航到URL

示例

  • 添加MCP服务器选项 添加MCP服务器选项

  • 导航到URL并使用playwright执行操作 导航到URL并输入文本