e2e mcp gives a coding agent such as Claude Code, Codex, or Cursor a live
session on your app, on web, iOS, or Android. The agent sees the screen,
acts on it, and checks its work.
Why it matters
The server needs no model.
Set it up
e2e init offers to register the server in .mcp.json (Claude Code) and
.cursor/mcp.json (Cursor). By hand:
Add the server to .codex/config.toml, trust the project, and start a
new session:
Add the server to .cursor/mcp.json. Other clients that read an
mcpServers map take the same block.
A session starts the target’s app command, if it has one.
Ask the agent
- “Add a Remember me checkbox to the login form. Check it in the app with e2e.”
- “Write a test for checkout while you walk it in the app.”
- “Reproduce issue #123 in the app and record a video.”
Add “headed” to watch a local browser or simulator.
How it writes a test line
Each action in a session answers with the test line that repeats it. The line’s locator matched that control alone on the live screen:
The agent copies the lines it needs into the test as it walks the flow.
test_lines returns every line so far, in order, as a draft test body. See
test_lines for how a line is built.
How it checks a locator
For a line no action printed, such as an assertion, the agent tries the locator in the session first. A wrong guess fails there, not in a test run:
Run tests next to a session
A session doesn’t run tests and writes no test results or cache
recordings. The agent runs tests with e2e run and, when a run can go
beside the session, keeps the session open between runs. After a failed
run, it goes to the failing screen in that session instead of opening a
new one.
On web, a run next to a session depends on the target’s app:
When CI is set, e2e ignores reuseExisting, and the run fails as on a
fixed port. Close the session before a run that would fail. On mobile, run
on a device no session uses.
Run several agents
Each agent, subagents included, opens its own session with its own browser or device, up to four by default. On mobile, give each session its own target.
Secrets
type_secret fills a secret without showing it to the agent. After a
secret is filled, the session stops returning screenshots.
Videos from start_recording are not masked.