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:
- Tutorial — learning-oriented. Getting started walks a first session end to end.
- How-to — task-oriented. Connect your MCP client, Launch, attach, or inject, Assert UI state, Type into code editors, Capture diagnostics, and Migrate from electron-driver each solve one job.
- Explanation — understanding-oriented. Concepts explains the agent-native model and why the server is shaped the way it is; the Security model explains the trust boundaries.
- Reference — information-oriented.
TOOL-REFERENCE.mdlists every tool (parameters, return shapes, error codes) generated from the live manifest, and the Architecture Decision Records record why each decision was made.
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.