article
README
🚀 基于 MCP 协议的浏览器自动化服务器实现演示项目
本项目是一个基于 Playwright 实现模型上下文协议 (MCP) 服务器的 demo 项目。它能演示如何借助 Claude Desktop 客户端接收用户提示,进而利用服务器控制浏览器完成自动化操作。
🚀 快速开始
✨ 主要特性
- 基于 Playwright 实现 MCP 服务器,实现浏览器自动化操作。
- 通过 Claude Desktop 客户端接收用户提示,控制浏览器。
📦 安装指南
先决条件
项目构建
- 克隆仓库:
git clone https://github.com/hrmeetsingh/mcp-browser-automation.git
- 安装依赖项:
npm install
- 验证输出可执行文件是否存在于
dist文件夹中。
整合步骤
- 在
~/Application\ 支持/Claude/claude_desktop_config.json创建配置文件(适用于 macOS)。 - 将以下内容复制到该文件中:
{
"mcpServers": {
"mcp-browser-automation": {
"command": "node",
"args": ["/path/to/mcp-browser-automation/dist/index.js"]
}
}
}
- 启动 Claude Desktop。
💻 使用示例
基础用法
- 打开 Claude Desktop。
- 开始新的对话以打开浏览器并导航到指定 URL。
示例操作
-
添加 MCP 服务器选项

-
导航至 URL 并使用 Playwright 进行操作

Scan to contact