Playwright MCP HTTPS隧道服务

通过Cloudflare Quick Tunnels为本地Playwright MCP服务器提供免费的临时HTTPS URL,适用于ChatGPT Connectors的开发和测试。

  • by Juganof
  • 本地部署
  • 更新于
在 GitHub 查看 juganof/playwright-mcp-tunnel

使用说明

剧作家MCP+免费HTTPS隧道(Cloudflare)

旋转官方 剧作家MCP 本地服务器并通过 临时免费HTTPS URL 使用Cloudflare快速隧道。此URL可以粘贴到 ChatGPT连接器 UI作为 定制连接器(MCP).

⚠️ 这是用于开发/测试的。快速隧道是公共的、临时的,并且有限制。做 不 泄露秘密或私人数据。

你得到了什么

  • 单命令Playwright MCP服务器(npx @playwright/mcp@latest)
  • 通过Cloudflare免费、无帐户HTTPS隧道(cloudflared tunnel --url …)
  • 使用MCP与连接器UI配合使用 HTTP端点 (/mcp).

前提条件

  • Node.js 18+
  • 云层爆发 (安装:https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare)

快速启动

# 1) Clone
git clone https://github.com/Juganof/playwright-mcp-tunnel.git
cd playwright-mcp-tunnel

# 2) Start the MCP server locally on port 8931
npx -y @playwright/mcp@latest --port 8931 --host 127.0.0.1
# (Leave this running)

# 3) In a second terminal, start a free HTTPS tunnel to the local server
cloudflared tunnel --url http://127.0.0.1:8931
# You'll get a URL like: https://random-subdomain.trycloudflare.com

将其连接到ChatGPT(自定义连接器)

  1. 打开 ChatGPT→ 设置→ 连接器→ 添加源→ 自定义(MCP).
  2. 集 MCP服务器URL 到您的隧道URL 随着 /mcp 最后,例如:
    https://random-subdomain.trycloudflare.com/mcp
    
  3. 点击 创建 (并批准任何警告/复选框)。

如果您的客户希望使用较旧的SSE风格端点,请尝试 /sse 相反: https://…trycloudflare.com/sse最新的剧作家MCP支持现代 流式HTTP 端点位于 /mcp.

健全性检查

  • 在浏览器中打开URL: https://<your-tunnel>/mcp --您应该看到一条小JSON消息或一个空白页(正常)。
  • 可选:测试SSE GET(可能启用也可能不启用):
    curl -i -N -H "Accept: text/event-stream" https://<your-tunnel>/mcp
    

有用的旗帜(剧作家MCP)

# Headless (CI / no GUI)
npx -y @playwright/mcp@latest --port 8931 --host 127.0.0.1 --headless

# Restrict network access
npx -y @playwright/mcp@latest --port 8931 --allowed-origins=https://example.com;https://another.com

# Config file
npx -y @playwright/mcp@latest --config ./mcp.config.json --port 8931

有关更多选项,请参阅repo页面。

NPM脚本

此仓库包含可以运行的简单脚本,而不是原始命令:

# Start the MCP server
npm run mcp
# Start the tunnel (in another terminal)
npm run tunnel

安全说明

  • 快速隧道是公共和临时的。避免暴露内部系统。
  • 完成后关闭隧道和MCP服务器。
  • 对于任何持久性的东西,更喜欢真正的Cloudflare隧道(零信任)。

许可证

麻省理工学院