Skip to main content
Start the MCP (Model Context Protocol) server over stdio so coding assistants can create, edit, and run Momentic tests. For full setup instructions see MCP. By default, starting an MCP session opens a localhost page with a remote control UI that allows you to view and interact with the emulator. All options below can be passed as flags or, where noted, set via environment variables. CLI flags override environment variables.
npx momentic-mobile mcp [options]

Options

SettingFlagEnvironment variableDescription
Momentic API key--api-key <key>MOMENTIC_API_KEYAuthenticates the MCP server with Momentic APIs.
Config file path-c, --config <path>Points to the momentic.config.yaml file used to load project tests, modules, and environments.
Android SDK root--android-home <path>ANDROID_HOMESets ANDROID_HOME for the current MCP process.
Java home--java-home <path>JAVA_HOMESets JAVA_HOME for the current MCP process.
Headful browser--headful [true or false]Sets whether the remote control browser opens with a visible UI by default. Defaults to true if omitted.
Session idle timeout--session-idle-timeout-minutes <minutes>MOMENTIC_SESSION_IDLE_TIMEOUT_MINUTESIdle timeout for MCP sessions in minutes. Sessions inactive for this duration are terminated automatically. Defaults to 5 minutes.

--api-key <key>

Momentic API key.
npx momentic-mobile mcp --api-key your-api-key

-c, --config <path>

Path to the momentic.config.yaml file. Required when run from an MCP client; use an absolute path so the server can resolve it correctly.
npx momentic-mobile mcp --config /absolute/path/to/momentic.config.yaml
If your MCP client does not inherit your shell environment, include the Android SDK and JDK paths directly:
npx momentic-mobile mcp --config /absolute/path/to/momentic.config.yaml --android-home /absolute/path/to/Android/sdk --java-home /absolute/path/to/java-home

--session-idle-timeout-minutes <minutes>

Session idle timeout in minutes. MCP sessions that remain idle for this duration are automatically terminated. Defaults to 5 minutes. Can also be set via the MOMENTIC_SESSION_IDLE_TIMEOUT_MINUTES environment variable.
npx momentic-mobile mcp --session-idle-timeout-minutes 5

--headful [true|false]

Default headful mode for the momentic_session_start tool when the agent does not manually specify a value. Setting this to false will prevent Momentic from starting a remote control UI.
npx momentic-mobile mcp --headful false

--android-home <path>

Path to the Android SDK root. This sets ANDROID_HOME for the current MCP process.

--java-home <path>

Path to the Java home directory. This sets JAVA_HOME for the current MCP process.