> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# momentic mcp

> Run the Momentic MCP server for coding agents.

Starts the Momentic MCP server over stdio so coding agents can author, run, and
triage web tests. See the [MCP integration guide](/integrations/mcp-server) for
editor-specific setup.

```bash theme={null}
npx momentic mcp
```

CLI flags override environment variables.

## Common flags

<ParamField path="--api-key <key>" type="string">
  Authenticates the MCP server with Momentic APIs. Env: `MOMENTIC_API_KEY`.
</ParamField>

<ParamField path="-c, --config <path>" type="string">
  Path to the `momentic.config.yaml` file used to load project tests, modules,
  and environments.
</ParamField>

## Browser

<ParamField path="--headful-browser [true|false]" type="string">
  Whether browser sessions launch with a visible UI (`true`) or headless
  (`false`). Defaults to `true`. Env: `MOMENTIC_HEADFUL_BROWSER`.
</ParamField>

<ParamField path="--pixel-ratio <n>" type="string">
  Override the viewport device pixel ratio used for browser rendering. Defaults
  to `2` on macOS Retina and `1` elsewhere.
</ParamField>

<ParamField path="--video [true|false]" type="string">
  Record video of browser sessions by default. Defaults to `false`. The output
  directory path is returned when a session ends. Env: `MOMENTIC_VIDEO`.
</ParamField>

## Caching

<ParamField path="--save-cache" type="boolean">
  Always save updated step caches after successful sessions, even on protected
  Git branches.
</ParamField>

<ParamField path="--disable-cache" type="boolean">
  Disable step caches entirely. Sessions run without cached data and no caches
  are saved.
</ParamField>

## Session

<ParamField path="--session-idle-timeout-minutes <minutes>" type="string">
  Idle timeout for MCP sessions in minutes. Defaults to `5`. Sessions inactive
  for this duration are terminated automatically. Env:
  `MOMENTIC_SESSION_IDLE_TIMEOUT_MINUTES`.
</ParamField>

<ParamField path="--daemon" type="boolean">
  Create a persistent local daemon so browser sessions can be shared across
  multiple MCP server invocations. The daemon's working directory is set to the
  parent of the config file, so MCP servers launched from different directories
  share the same project home.
</ParamField>

## Examples

Start the MCP server using the project's `momentic.config.yaml`:

```bash theme={null}
npx momentic mcp
```

Run headless with a five-minute idle timeout:

```bash theme={null}
npx momentic mcp --headful-browser false --session-idle-timeout-minutes 5
```
