> ## 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-mobile mcp

> Run the Momentic mobile MCP server for coding agents.

Starts the Momentic mobile MCP server over stdio so coding agents can author,
run, and triage iOS and Android tests. See the
[MCP integration guide](/integrations/mcp-server) for editor-specific setup. By
default, sessions open a `localhost` page with a remote control UI for viewing
and interacting with the emulator.

```bash theme={null}
npx momentic-mobile 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>

## Toolchain

<ParamField path="--android-home <path>" type="string">
  Set `ANDROID_HOME` for the current MCP process. Env: `ANDROID_HOME`.
</ParamField>

<ParamField path="--java-home <path>" type="string">
  Set `JAVA_HOME` for the current MCP process. Env: `JAVA_HOME`.
</ParamField>

## Session

<ParamField path="--headful [true|false]" type="string">
  Whether the remote control browser opens with a visible UI by default.
  Defaults to `true`.
</ParamField>

<ParamField path="--supports-file-output [supportsFileOutput]" type="boolean">
  Allow MCP tool responses to include file output references. Defaults to
  `true`. Disable for clients that cannot resolve file references.
</ParamField>

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

## Caching

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

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

<ParamField path="--daemon" type="boolean">
  Create a persistent local daemon so mobile 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 device sessions and other state.

  <Warning>
    Daemon mode is not yet available on Windows. Use the standard stdio mode
    on Windows for now.
  </Warning>
</ParamField>

## Examples

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

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

Run with custom Android and Java toolchain paths:

```bash theme={null}
npx momentic-mobile mcp --android-home ~/Library/Android/sdk --java-home /opt/homebrew/opt/openjdk@17
```
