Skip to main content
The Model Context Protocol (MCP) enables AI models to interact with your local Momentic tests via the desktop server. This allows AI assistants in various IDEs to understand, create, and modify your test suites directly.
MCP is currently publicly available for the Momentic local app as of version 2.17.1

Overview

The MCP server provides AI models with access to your Momentic project through a set of specialized tools. These tools allow AI assistants to:
  • Browse and understand your test structure
  • Create new tests with AI assistance
  • Edit existing tests using natural language
  • Manage test environments and configurations
  • Access test and module information

Before you start

Local only: The desktop MCP server runs on your machine so remember to run the momentic application before trying to connect to the MCP server.IDE support: Use an editor that supports MCP (e.g., Cursor, Windsurf, Claude Desktop, Codex, VS Code/Copilot).Project configured: Ensure your project has a valid momentic.config.yaml

Step 1: Enable the MCP server

We support three transport options. New features will target the Streamable HTTP and stdio standard, but SSE remains available for legacy IDEs.
Streamable HTTP Transport (newer standard): available in any version Momentic >= 2.17.2 Requires the Momentic app to be running.
POST/GET/DELETE /api/mcp/
Header: mcp-session-id: <session-id>
url: http://localhost:58888/api/mcp

Step 2: Set up your MCP client

Make sure you have started the local app then follow the steps for your IDE below.
Example configuration (used in Cursor as of 2025‑09‑19). This is an example and may not work universally across VS Code–branched IDEs.
{
  "mcpServers": {
    "momentic-desktop": {
      "url": "http://localhost:58888/api/mcp"
    }
  }
}
The momentic mcp command requires Momentic 2.42.0 or later.
Stdio server: Run Momentic through the CLI instead of connecting to the desktop server URL. This is gated behind the momentic mcp command and is useful when you want the MCP server to start on-demand or prefer a command-based setup.
{
  "mcpServers": {
    "momentic-desktop-stdio": {
      "type": "stdio",
      "command": "npx",
      "args": ["momentic", "mcp", "--config", "/absolute/path/to/momentic.config.yaml"],
      "env": {
        "MOMENTIC_API_KEY": "your-api-key",
        "MOMENTIC_SERVER": "https://api.momentic.ai",
        "MOMENTIC_DEV_LOG_LEVEL": "error"
      }
    }
  }
}
Setup Steps:
  1. Open Cursor’s command palette (Cmd Shift P)
  2. Navigate to “View: Open MCP Settings” command
  3. Add the momentic-desktop MCP server (configuration above)
  4. Restart the MCP server

Step 3: Agent Rules

Open your IDE’s or CLI’s agent‑rules settings and add one of the following suggested rules to prevent models from directly editing your test or module YAML files. If user approval is required before making changes:
Never directly edit a Momentic test (`*.test.yaml`) or module YAML file (`*.module.yaml`), only use the edit test MCP tool, and prompt the user before making changes.
If immediate implementation is OK without user approval:
Never directly edit Momentic test (`*.test.yaml`) or module YAMLs (`*.module.yaml`). Only use the Momentic MCP tools to edit Momentic YAMLs. If they are unavailable tell the user you are unable to edit the YAML files.
NOTE: Many IDEs and CLIs let you hide or protect files from agents (e.g., .cursorignore). Enable these safeguards where available.

Step 4: Use tools in your IDE

  • Verify you have started the Momentic application
  • Verify the MCP server appears in your IDE (e.g., Copilot Agent mode → Tools)
  • Try a simple action (e.g., list tests) to confirm connectivity
  • If tools don’t appear, restart both the IDE and the Momentic desktop server
NOTE: Several IDEs only provide support for MCP in agent mode

Security considerations

  • Local Only: The MCP server is designed for local development only
  • No Authentication: Currently no authentication is required for local access
  • Session Management: Sessions are automatically cleaned up on disconnection
  • Resource Access: MCP tools have access to your local file system and project data

Example Usage:

User Request:
create a new test called demo test for the yc website

Then once you create that test load its full data, use this to then edit the test

click on the companies tab
choose a major name brand company and click on their profile
check that the team size is visible
click on the jobs tab
assert that the blurb about what the company does is no longer visible
AI Response:I’ll help you create a new test for the YC website and then edit it according to your specifications. Let me start by creating the test and then loading its data to edit it.Creates TODO list:
  • Create a new test called demo test for the YC website [in_progress]
  • Load the full data of the created test [pending]
  • Edit the test to implement the specified flow [pending]
Parameters:
name: "demo-test"
baseUrl: "https://www.ycombinator.com"
description: "Test for YC website - companies tab navigation and job page verification"
Result: Successfully created test with ID 391f065b-48f3-4548-ab15-079543fa69e0
Parameters:
id: "391f065b-48f3-4548-ab15-079543fa69e0"
Result: Retrieved test configuration with empty steps array
Parameters:
id: "391f065b-48f3-4548-ab15-079543fa69e0"
message: |
  Add test steps to:
  1. Navigate to the YC website
  2. Click on the 'Companies' tab
  3. Find and click on a major brand company like DoorDash or Coinbase
  4. Verify that the team size is visible on the company profile
  5. Click on the 'Jobs' tab
  6. Assert that the company description blurb is no longer visible on the jobs page
Result: Test successfully updated with 7 automated steps:
  1. Navigate to https://www.ycombinator.com
  2. Click on “Companies” tab in navigation
  3. Verify companies list is displayed
  4. Click on DoorDash company profile
  5. Assert team size (8600) is visible
  6. Click on “Jobs” tab
  7. Assert detailed company description is not visible on jobs page
Final Result: ✅ Created “demo-test” for YC website ✅ Implemented complete user flow with proper assertions ✅ Test validates team size visibility and content changes between tabs ✅ Ready to execute with 7 comprehensive test stepsThe AI successfully:
  • Created a new test with appropriate configuration
  • Loaded and analyzed the test structure
  • Converted natural language requirements into specific test steps
  • Chose DoorDash as the major brand company example
  • Added proper assertions for team size visibility and content validation
  • Generated executable test steps ready for automation

Best practices

  1. Start Desktop Server: Always start your Momentic app before connecting MCP
  2. Project Context: Ensure you’re in the correct project directory
  3. Prompting: While you will see success with unclear directions of how to edit a test, using step by step descriptions will yield faster test edit times and steps closer to exactly what you are envisioning. We suggest keeping the amount of steps per edit_test tool call under 10.
  4. Session Management: Allow sessions to clean up properly by disconnecting cleanly
  5. Tool Safety: All of our tools other than edit test currently cannot do any harm or changes to your project (file creation or read only). Enabling these to auto run is safe. If you use the momentic_edit_test tool be sure you have tracked your changes to the test file it is editing as it will not ask you for permission for each change.

Available Tools

Environment Tools

List environments defined in the project’s momentic.config.yaml file.Usage: Returns a JSON array of all configured environments with their settings and configurations.Parameters: NoneExample: momentic_environment_list - Returns all available test environments

Module Tools

List all modules in your project.Usage: Returns basic metadata for each module (ID, name, description, and paths). Use this to discover available modules.Parameters: NoneExample: momentic_module_list - Returns all project modulesNote: Parameters are not included in this list. Use momentic_module_get to inspect parameter requirements before inserting modules into a test.

Session Tools

Start a granular browser session for a specific test.Usage: Creates a session bound to a test and returns session metadata.Parameters:
  • testId (required): Test ID to target
  • envName (optional): Environment override (matches CLI --env)
  • projectConfigPath (optional): Path to momentic.config.yaml
  • projectNameFilter (optional): Project name filter for workspace configs
  • headfulBrowser (optional): Launch a headful browser
Example: momentic_session_start --testId "test-uuid"

Test Tools

List all tests in your project.Usage: Returns comprehensive test information including metadata, labels, and file paths.Parameters: NoneExample: momentic_test_list - Returns all project tests

Test Session Interaction Tools (Granular)

Execute a step without adding it to the test.Usage: Runs a single step in the current session without modifying the test.Parameters:
  • sessionId (required): Session ID to use
  • step (required): Step definition to execute
Example: momentic_preview_step --sessionId "session-uuid" --step { ... }