Back to MCP directory
publicPublicdnsLocal runtime

deno2-playwright-mcp-server

基于Deno 2和Playwright的浏览器自动化MCP服务

article

README

🚀 基于Deno 2的Playwright模型上下文协议服务器示例

本项目是一个运用Playwright浏览器自动化功能的模型上下文协议(Model Context Protocol)服务器。借助该服务器,大语言模型(LLMs)能够在真实的浏览器环境里与网页进行交互、截取屏幕截图以及执行JavaScript代码。

项目基于Deno 2构建,Deno 2具备出色的人体工学设计,可将项目编译为二进制文件,并且在运行时无需依赖其他环境。

此外,该项目高度借鉴了官方的Puppeteer MCP服务器,您可以点击此处查看相关内容。

🚀 快速开始

📦 安装指南

虽然仅对mac版本的构建进行了测试,但您也能够为Linux x86_64、Linux ARM64和Windows x86_64构建可执行二进制文件。您可以使用以下命令进行构建:

  • deno task build-mac
  • deno task build-linux-x86_64
  • deno task build-linux-ARM64
  • deno task build-windows-x86_64

💻 使用示例

要调用playwright-server二进制文件,您需要更新~/Library/Application\ Support/Claude/claude_desktop_config.json文件,使其指向该二进制文件。以下是示例配置:

{
  "mcpServers": {
    "playwright": {
      "command": "/path/to/deno2-playwright-mcp-server/playwright-server"
    }
  }
}
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client