Electron Stagewright docs

Electron Stagewright guides

Public documentation for driving Electron apps over the Model Context Protocol. Start where your situation matches:

You are… Read
New here and want a working session in minutes Getting started
Wiring the server into Claude Desktop, Cursor, or another client Connect your MCP client
Deciding how to get a session against YOUR app Launch, attach, or inject
Writing assertions an agent can act on Assert UI state
Driving a code editor (Monaco, CodeMirror, EditContext) Type into code editors
Debugging a flow — screenshots, console, dialogs, session traces Capture diagnostics
Coming from electron-driver Migrate from electron-driver
Deciding whether and how to expose the server Security model
Trying to understand how it works, and why Concepts

The four kinds of docs here

These docs follow the Diátaxis split, so you can tell at a glance what a page is for:

Conventions the guides assume

Every tool returns a JSON envelope discriminated by ok. On failure, branch on the stable code (never the prose), check retryable, and look at next_actions for the recommended recovery:

{
  "ok": false,
  "code": "SELECTOR_NO_MATCH",
  "error": "\"#missing\" matched no element.",
  "retryable": false,
  "next_actions": ["electron_snapshot()", "electron_find({ role, name_contains })"]
}

Sessions thread through every call: electron_launch / electron_attach / electron_inject return a session_id; pass it to subsequent calls (it may be omitted while exactly one session is live) and end the session with electron_stop.