@electron-stagewright/core

中文文档
0.9.0发布于 2026/11/14MITTypeScriptES Module近 30 天下载 2528

Agentic UX testing for real Electron apps: launch, inspect, interact, assert, and capture evidence through MCP.

原始使用文档
文档目录4 节
  1. Use the published package
  2. Use from a checkout
  3. Use with Claude Code
  4. License

@electron-stagewright/core

The core MCP server for Electron Stagewright: agentic UX testing for real Electron apps.

Launch or attach, inspect the accessibility tree, interact through stable refs, assert behavior with retrying expectations, and capture bounded evidence through the Model Context Protocol.

Early release. Published versions are exercised against real Electron on macOS, Windows, and Linux; APIs may still evolve before 1.0.

Run the packaged demo or read the getting-started guide before pointing the server at your own app.

Use the published package

Requires Node.js 24 or newer, and on Linux a display for the server (DISPLAY, WAYLAND_DISPLAY, or xvfb-run -a). The default launch transport uses Playwright and an Electron runtime, so start the CLI with all three packages available. Before handing the command to an MCP host, prepare it once in a terminal: Electron downloads its binary the first time something loads it, and that download prints progress to stdout, which would corrupt the host's stdio protocol. Fetch the binary with Electron's install-electron bin using the same package list, then check that doctor reports "ok": true. --prefix ~/ keeps npx from skipping a listed package because the current project already has that version, which would leave the server unable to load it:

npx -y --prefix ~/ --package @electron-stagewright/[email protected] \
  --package [email protected] --package [email protected] install-electron
npx -y --prefix ~/ --package @electron-stagewright/[email protected] \
  --package [email protected] --package [email protected] electron-stagewright doctor --json

Then configure or run the normal server command:

npx -y --prefix ~/ --package @electron-stagewright/[email protected] \
  --package [email protected] --package [email protected] electron-stagewright

Or install all three once and run the bin directly:

npm install -g @electron-stagewright/[email protected] [email protected] [email protected]
install-electron
electron-stagewright

Use from a checkout

pnpm install
pnpm build
node packages/core/dist/cli.js

Useful CLI flags:

  • --allow-eval registers electron_eval_main and electron_eval_renderer.
  • --tool-profile <essential|testing|debug|full> selects an explicit core tool surface. full is the default, so existing installations keep the complete core catalog; eval and explicitly loaded plugins compose independently. testing includes electron_screenshot for test-evidence capture without requiring the broader diagnostic profile.
  • --screenshot-dir <path> changes where screenshots are written when a tool call does not pass an explicit path.
  • --app-root <path> confines launch/file paths and makes electron_launch({ main }) use the Electron package installed inside that project (runtime: "server" opts out). The server, not the agent, chooses this root.
  • doctor --json runs a machine-readable preflight for Node, Playwright, Electron, display setup, configured paths, eval policy, target runtime alignment, and the exact serve configuration. Pass the same plugin/config/profile/timeout/demo flags you intend to serve with; doctor imports and briefly sets up those explicitly trusted plugins, validates the server object graph, then tears it down. Run it as electron-stagewright doctor --json, never as an MCP server argument.
  • production validate --app <path> --json delegates macOS, Windows, or Linux release-artifact validation to a separately installed @electron-stagewright/plugin-production package. It exits without starting MCP stdio.

Use with Claude Code

claude mcp add electron-stagewright -- \
  npx -y --prefix ~/ --package @electron-stagewright/[email protected] \
  --package [email protected] --package [email protected] \
  electron-stagewright --tool-profile essential

Run claude mcp list to confirm the server is connected; its tools appear as mcp__electron-stagewright__electron_launch and so on.

For a local checkout, replace the command after -- with node /abs/path/to/electron-stagewright/packages/core/dist/cli.js. Claude Code's default local scope limits this setup to the current project; use --scope project only when you intend to commit a shared .mcp.json configuration.

License

MIT. See LICENSE at the repository root.

版本与发布记录

@electron-stagewright/core 共发布 16 个版本,首次发布于 2026/06/23;过去 12 个月发布了 16 个版本。

版本发布日期距今
0.9.0latest2026/11/14今天
0.8.12026/10/2915 天前
0.8.02026/10/2915 天前
0.7.02026/10/2420 天前
0.6.32026/10/1728 天前
0.6.22026/10/1628 天前

关于 @electron-stagewright/core 的常见问题

@electron-stagewright/core 是什么?

Agentic UX testing for real Electron apps: launch, inspect, interact, assert, and capture evidence through MCP.

如何安装 @electron-stagewright/core?

在项目目录运行 npm install @electron-stagewright/core,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 electron-stagewright,可以用 npx electron-stagewright 直接运行。

@electron-stagewright/core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@electron-stagewright/core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@electron-stagewright/core 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@electron-stagewright/core 可以商用吗?

@electron-stagewright/core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@electron-stagewright/core 的下载量有多少?

根据 npm 官方下载统计,@electron-stagewright/core 在 2026/10/14 – 2026/11/12 这 30 天内被下载 2,528 次,日均约 84 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@electron-stagewright/core 还在维护吗?

最新版本 0.9.0 发布于 2026/11/14(今天);至今共发布 16 个版本,其中过去 12 个月发布了 16 个;首次发布于 2026/06/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。