A coding agent can write a test in seconds and still leave you with a suite nobody can read. The Momentic MCP server changes what the agent has in its hands: a live browser, your existing tests, and the run history behind them. This guide connects that server to Claude Code, Cursor, and Codex, then shows how to confirm the connection works.
What you get
Momentic's MCP server is a local stdio server. It runs on your machine, next to your repository, and it exposes tools that let an agent do four things:
- Read and edit the tests already in your repository
- Drive a live browser, step by step, and see a screenshot after each step
- Run a test or a range of steps and read the result
- Read run history, so it can explain why a test failed on a branch
A test is a YAML file in your repository, so every change the agent makes arrives as a diff you review in a pull request.
Before you start
- The Momentic CLI, version 2.54.0 or later
momentic.config.yamlin your project- A
MOMENTIC_API_KEYthe MCP process can read. Most editors do not inherit your shell environment, so set the key in the editor config.
Sign in once from your project root:
npx momentic loginEvery client below runs the same command underneath:
npx momentic mcp --config /absolute/path/to/momentic.config.yamlFor Android and iOS, substitute momentic-mobile mcp and sign in with npx momentic-mobile login.
Claude Code
Register the server from your project root:
claude mcp add --transport stdio momentic -- npx momentic mcp --config /absolute/path/to/momentic.config.yamlPass the API key with the CLI's --env flag, or run the command from a shell that already exports it. On native Windows, wrap the command with cmd /c. Restart Claude Code, then run /mcp to see the server.
Cursor
Open the command palette, select View: Open MCP Settings, click Add a new Custom MCP server, and paste this entry:
{
"mcpServers": {
"momentic": {
"type": "stdio",
"command": "npx",
"args": [
"momentic",
"mcp",
"--config",
"/absolute/path/to/momentic.config.yaml"
],
"env": {
"MOMENTIC_API_KEY": "your-api-key"
}
}
}
}Restart Cursor after you save the file.
Codex
Register the server:
codex mcp add momentic -- npx momentic mcp --config /absolute/path/to/momentic.config.yamlThe command writes the entry to ~/.codex/config.toml. For a project-scoped config, edit .codex/config.toml in a trusted project. Restart Codex, then run /mcp in the TUI.
Other clients
Any MCP-compatible client can launch the server. VS Code with Copilot, OpenCode, and Devin all work. Give the client these three values:
- Command:
npx - Arguments:
momentic mcp --config /absolute/path/to/momentic.config.yaml - Environment:
MOMENTIC_API_KEY=your-api-key
Devin needs a few extra machine-configuration steps, because it installs browsers and skills before MCP starts. The Devin integration page covers them.
Install the skills
The server gives the agent tools. The skills tell it how to use them, and this is the part teams skip. Without the skills, an agent writes malformed steps and then argues with the error. Install them from your project root:
npx skills add momentic-ai/skillsThree skills matter:
momentic-test: how to build tests, steps, and modules that hold upmomentic-spec: how to write the affected tests before you change product codemomentic-maintain: how to investigate a branch failure, deflake a test, and repair a stale step
Some agents load skills on their own. Many do not, so name the skill in the prompt:
/momentic-test write a test for the checkout flowConfirm it works
Restart the client and start a new chat. Ask the agent which MCP tools it has. You want to see momentic_* tools, such as momentic_get_artifacts. If they do not appear, quit the client fully and open it again; a reload is often not enough.
Then give the agent a real job and read the diff:
/momentic-test open the login page, sign in with the seeded test user, and assert the dashboard loadsThe agent drives the browser, checks each step against a screenshot, and leaves a YAML test in your repository. Run it yourself before you commit it:
npx momentic run tests/login.yamlTwo things that break setups
The missing API key. The editor starts the server, the server cannot authenticate, and the agent reports a vague failure. Put MOMENTIC_API_KEY in the client config, not only in your shell.
The leaked browser. The agent closes a session with momentic_session_terminate. If you hard-stop the editor mid-run, browser processes stay alive. Also add .momentic-mcp/ to your gitignore, because screenshots, videos, and traces land there.
Where this leaves your suite
The point of the MCP server is not that an agent can click a button. It is that the tests it writes go into your repository, run in your CI, and get reviewed like code. The agent proposes; you merge.
If you are weighing this against a browser-only server, read Playwright MCP vs a testing MCP server . If flaky tests are what sent you here, start with how to fix flaky tests .