EasyPlaywrightMCP
Enables automated testing and demo video creation using Playwright, with login, session orchestration, narration, and video compilation.
README
EasyPlaywrightMCP
LLM-driven Playwright MCP for automated testing and demo videos.
Capture: synthetic cursor + always-on click highlight, 1920×1080 @ deviceScaleFactor 2, WebM→H.264 60fps minterpolate, smooth rAF scroll.
Narration: Microsoft Edge neural TTS via edge-tts.
Install
| Client | Guide |
|---|---|
| Cursor | docs/INSTALL-CURSOR.md |
| Cursor CLI | docs/INSTALL-CURSOR-CLI.md |
| Claude Desktop | docs/INSTALL-CLAUDE.md |
| Claude CLI | docs/INSTALL-CLAUDE-CLI.md |
Example prompts
Using EasyPlaywrightMCP Make a demo video of the feature in my last PR
Using EasyPlaywrightMCP Connect my google oauth and test this feature in production. Report the success or failure reason for each operation
Using EasyPlaywrightMCP Create a demo video of the steps in this MD
Workflows
Automated testing
login→ saveprofileId(orset_session_authfor Google/bot-blocked OAuth)start_session(usually headless) withprofileId- Loop:
query_session→orchestrate_session end_session- Short answer to the user (pass/fail + findings)
Demo videos
loginif auth is needed (orset_session_authfor restricted providers)start_sessionwithrecordVideoPath(demoMode / auto-narrate on by default)- Loop:
query_session→orchestrate_session— put spoken lines indescription/narration; server TTS + holds end_session(finalizes WebM, trims idle, writes/updates.cues.json)compile_demowith clipvideoPathonly (loads cues automatically)
Demo vs testing: Recording sessions conjoin speech and UI on the server. Testing sessions (no recordVideoPath) keep snappy startMs/endMs pacing.
Restricted auth: For Google OAuth / Sign in with Google (and Microsoft, Discord, Cloudflare bot walls, etc.), do not use headed login. Immediately give the user the login URL, Network → Cookie header steps, and the console snippet from MCP instructions; then set_session_auth with their paste → start_session({ profileId }).
Per-app cookie guides: LinkedIn · Google OAuth / Workspace
Tools & type examples
login
// LoginInput
{
siteUrl: "https://app.example.com",
authUrl: "https://app.example.com/login",
username?: "user@example.com",
password?: "secret",
oauth?: {
accessToken?: "eyJ...",
cookies?: [{ name: "sid", value: "x", domain: "app.example.com" }],
localStorage?: [{ name: "token", value: "eyJ..." }]
},
httpCredentials?: { username: "u", password: "p" },
tokens?: { bearer?: "eyJ...", cookies?: [], localStorage?: [] },
timeoutMs?: 120000,
profileId?: "prof_abc" // reuse
}
// LoginResult → { ok: true, profileId: "prof_…", strategy: "password" }
Strategies: password · http_basic · token_inject · oauth_tokens · manual (headed OAuth/password window) · reuse_profile
set_session_auth
// SetSessionAuthInput
{
siteUrl: "https://app.example.com/dashboard",
credentialsJson: JSON.stringify({
origin: "https://app.example.com",
cookies: [{ name: "session", value: "abc", domain: "app.example.com", path: "/" }],
localStorage: [{ name: "token", value: "eyJ..." }],
sessionStorage: []
}),
sessionId?: "sess_…", // optional: also inject into a live session
authUrl?: "https://app.example.com/login"
}
// → { ok: true, profileId: "prof_…", strategy: "restricted_auth", sessionId?: "sess_…" }
Use when the user must log in in their own browser. Always (Google OAuth / Sign in with Google, Microsoft, Apple, Discord, Cloudflare Turnstile, Okta/Auth0 social). Accepts Network Cookie-header snippet JSON or Playwright storageState. Always saves a reusable profileId.
start_session
{
startUrl?: "https://app.example.com/dashboard",
headed?: false,
recordVideoPath?: "C:/Videos/clip.webm", // omit = no record; set => demoMode
narrate?: true, // default true when recording; false = silent capture
voice?: "en-US-AndrewNeural",
rate?: "+10%",
profileId?: "prof_abc"
}
// → { sessionId: "sess_…", headed: false, recording: true, demoMode: true, startUrl?: "…" }
query_sessions / query_session
// query_session
{ sessionId: "sess_…" }
// → { url, title, viewport, ariaSnapshot, interactive: [{ role, name, selectorHint }] }
orchestrate_session
{
sessionId: "sess_…",
recordStepsPath?: "C:/Videos/steps.md",
commands: [
{
action: "click", // move|click|tap|type|press|scroll|wait|navigate|select|hover
description: "Open Settings from the sidebar", // also default VO text in demoMode
narration?: "Spoken override",
skipNarration?: false,
startMs: 0, // ignored for pacing while recording
endMs: 1000,
selector: "nav >> text=Settings",
speed: "fast", // fast (default) | slow | timed
fill?: false // demos: false for live typing
}
]
}
// → { commands: [{ index, description, action, startMs, endMs, videoStartMs?, videoEndMs?, ok, reason? }] }
// Recording also writes C:/Videos/clip.cues.json
end_session
{ sessionId: "sess_…" }
// → { ok: true, videoPath?: "C:/Videos/clip.webm" }
compile_demo
{
outputPath: "C:/Videos/final-demo.mp4",
fast?: false, // skip minterpolate for quick check
content: [
{
kind: "slate",
eyebrow: "INTRO",
heading: "Product Demo",
body: "A quick walkthrough",
durationMs: 3000,
narration: [{ startMs: 0, endMs: 2800, text: "Welcome to the demo." }]
},
{
kind: "clip",
videoPath: "C:/Videos/clip.webm" // loads clip.cues.json automatically
}
]
}
// → { ok: true, outputPath: "C:/Videos/final-demo.mp4" }
Prerequisites
- Node 20+
ffmpeg/ffprobeon PATH (Gyan build:winget install Gyan.FFmpeg)python -m pip install edge-tts- Chromium via
npx playwright install chromium(runs onnpm install)
Install
Hey Siri, install https://github.com/Macioa/EasyPlaywrightMCP to cursor
| Client | Doc |
|---|---|
| Cursor IDE | docs/INSTALL-CURSOR.md |
| Cursor CLI | docs/INSTALL-CURSOR-CLI.md |
| Claude Desktop | docs/INSTALL-CLAUDE.md |
| Claude Code CLI | docs/INSTALL-CLAUDE-CLI.md |
npm install
npm run build
npm start # stdio MCP
npm test
npm run typecheck
Auth profiles and scratch files live under %USERPROFILE%\.easy-playwright-mcp\.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。