Skip to main content
Using an AI coding tool? Copy the following prompt to set up the Momentic skills and MCP server so agents can author and run tests directly from your editor.

Set up the Momentic CLI, skills, and MCP server for a web project.

CursorOpen in Cursor

1. Prerequisites

  • Node.js 20.19.0+, 22.12.0+, or 24.0.0+
  • A package.json in your project (run npm init -y if you don’t have one)
  • A Momentic account, sign up to generate an API key
node -v  # must print v20.19.0 or higher

2. Install

npm install --save-dev momentic@latest

3. Authenticate

Create an API key in the dashboard, then export it:
export MOMENTIC_API_KEY=your-api-key-here
Persist the key by appending the export line to ~/.zshrc (macOS) or ~/.bashrc (Linux). In CI, set MOMENTIC_API_KEY as a secret environment variable.

4. Initialize

npx momentic init
This creates two files:
  • momentic.config.yaml, your project configuration
  • example-test.test.yaml, a starter test scaffold

5. Install browsers

Momentic runs your tests against a headless browser. Install Chromium:
npx momentic install-browsers chromium

6. Write your first test

Open the local editor:
npx momentic app
A browser window opens to the Momentic editor. Create a test with:
  • Name: example-test
  • Base URL: https://practicetestautomation.com/practice-test-login/
Add a step in natural language, for example:
Log in with username "student" and password "Password123", then confirm the
success page loads.
Click Run from start to execute it live. The editor saves your test to example-test.test.yaml.

7. Run from the CLI

npx momentic run example-test

8. Verify

  • Check example-test.test.yaml exists in your project root
  • Open the dashboard and check Runs for the result

9. Next steps

Core concepts

Finding elements, writing assertions, modules, variables

CI/CD

Run Momentic on every pull request

Best practices

Write tests that hold up over time
Need a full working example? Clone momentic-ai/examples.