Resources
4 min read

How to Set Up the Momentic MCP Server in Claude Code, Cursor, and Codex

The commands for each client, the API key mistake that breaks most setups, and how to confirm your agent really has the Momentic tools.

Wei-Wei Wu
CEO, Momentic
Sep 2, 2026

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.yaml in your project
  • A MOMENTIC_API_KEY the 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 login

Every client below runs the same command underneath:

npx momentic mcp --config /absolute/path/to/momentic.config.yaml

For 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.yaml

Pass 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.yaml

The 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/skills

Three skills matter:

  • momentic-test: how to build tests, steps, and modules that hold up
  • momentic-spec: how to write the affected tests before you change product code
  • momentic-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 flow

Confirm 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 loads

The 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.yaml

Two 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 .

Momentic MCP setup, answered.

What is the Momentic MCP server?

It is a local stdio server that gives a coding agent tools to read and edit the Momentic tests in your repository, drive a live browser step by step, run tests, and read run history. It runs on your machine with npx momentic mcp --config /absolute/path/to/momentic.config.yaml.

Which coding agents can connect to it?

Any MCP-compatible client. Claude Code, Cursor, and Codex have one-line or one-file setups. VS Code with Copilot, OpenCode, and Devin work with the same command, arguments, and API key.

Why does the agent say it has no Momentic tools?

Two usual causes. The client was reloaded instead of fully restarted, or the MOMENTIC_API_KEY is only in your shell. Most editors do not inherit your shell environment, so set the key in the client config and restart the client.

Do I need the skills as well as the server?

You want both. The server supplies the tools; the skills supply the operating guidance that keeps an agent on Momentic's test format. Install them with npx skills add momentic-ai/skills, then name the skill in your prompt, such as /momentic-test.

Where do the tests the agent writes end up?

In your repository, as YAML files. You review them in a pull request and run them locally or in CI with npx momentic run. Nothing is hidden in a vendor dashboard.

Does it work for mobile apps?

Yes. Substitute momentic-mobile mcp for the web command, sign in with npx momentic-mobile login, and use the momentic-mobile-test skill for Android and iOS.

Still have additional questions?

Contact us

Close the feedback loop.