
Maestro MCP
MCPMCP built into the CLI of the Maestro mobile UI testing framework (maestro mcp): lets agents view the screen, tap, scroll and assert on iOS/Android simulators, Android devices or Chromium, and write and run YAML end-to-end flows. Needs the Maestro CLI and Java 17+. Official.
Maestro MCP Server
Overview
The Maestro MCP (Model Context Protocol) server enables LLM-driven automation and orchestration of Maestro commands and device management. It serves two primary functions for calling LLMs:
- enables LLMs to directly control and interact with devices using Maestro device capabilities
- enables LLMs to write, validate, and run Maestro code (flows)
The MCP server is designed to be extensible, maintainable, and easy to run as part of the Maestro CLI. It supports real-time device management, app automation, and more, all via a standardized protocol.
Features
- Exposes Maestro device and automation commands as MCP tools
- Supports listing, launching, and interacting with devices
- Supports running inline flow YAML, specific test files, or entire flow directories (syntax is validated on execution)
- Easily extensible: add new tools with minimal boilerplate
- Includes a test script and config for automated validation
Running the MCP Server
To use the MCP server as an end user, after following the maestro install instructions run:
maestro mcp
This launches the MCP server via the Maestro CLI, exposing Maestro tools over STDIO for LLM agents and other clients.
The command also starts Maestro Viewer as a local HTTP server in the same process and prints its URL to stderr:
mcp_viewer_ready http://127.0.0.1:<port>
Use maestro mcp --no-viewer to disable it, or maestro mcp --viewer-port 9999 to choose a fixed port.
Viewer development
The viewer is authored as a small React app in maestro-cli/mcp-viewer using npm, Vite, and Tailwind CSS v4.
For fast UI iteration without rebuilding the CLI or running the MCP server:
cd maestro-cli/mcp-viewer
npm install
npm run dev
For the CLI distribution, Gradle runs npm run build, which compiles the React app and inlines the generated JavaScript and CSS into one HTML resource at maestro-cli/mcp-viewer/build/raw/index.html.
The viewer accepts lightweight runtime events via POST /api/events and streams them to connected browsers with GET /api/events/stream. Keep this route payload small and generic until the MCP server and Maestro driver event boundaries are more settled.
Developing
Extending the MCP Server
To add a new tool:
- Create a new file in
maestro-cli/src/main/java/maestro/cli/mcp/tools/following the same patterns as the other tools. - Add your tool to the
addToolscall inMcpServer.kt - Build the CLI with
./gradlew :maestro-cli:installDist - Test your tool by running
./maestro-cli/src/test/mcp/test-single-mcp-tool.shwith appropriate args for your tool
Evals testing
When testing a Maestro MCP tool, it's important to test not only that it works correctly but that LLMs can call it correctly and use the output appropriately. This happens less frequently than is expected. Make sure to add relevant test cases to our evals framework in ./maestro-cli/src/test/mcp/maestro-evals.yaml, and then run the eval test suite with:
ANTHROPIC_API_KEY=<your_key> ./maestro-cli/src/test/mcp/run-mcp-server-evals.sh
Implementation Notes & Rationale
Using forked version of official kotlin MCP SDK
The official MCP Kotlin SDK can't be used directly because it requires Java 21 and Kotlin 2.x, while Maestro is built on Java 8 and Kotlin 1.8.x for broad compatibility. However, we want to be able to benefit from features added to the SDK since the MCP spec is changing rapidly. So we created a fork that "downgrades" the reference SDK to Java 8 and Kotlin 1.8.22.
Why Integrate MCP Server Directly Into maestro-cli?
- Dependency Management: The MCP server needs access to abstractions like
MaestroSessionManagerand other CLI internals. Placing it in a separate module (e.g.,maestro-mcp) would create a circular dependency betweenmaestro-cliand the new module. - Simplicity: Keeping all MCP logic within
maestro-cliavoids complex build configurations and makes the integration easier to maintain and review. - Extensibility: This approach allows new tools to be added with minimal boilerplate and direct access to CLI features.
Potential Future Improvements
- Shared Abstractions: If more MCP-related code or other integrations are needed, consider extracting shared abstractions (e.g., session management, tool interfaces) into a
commonorcoremodule. This would allow for a clean separation and potentially enable a standalonemaestro-mcpmodule. - Streamable HTTP: The MCP tool channel currently uses STDIO; the viewer-side HTTP server is unrelated. Adding a Streamable HTTP transport for MCP tool calls is still future work.
Ressources associées

Midscene Skills
SkillCross-platform UI automation skills built on Midscene.js visual recognition: control browsers, desktops, Android, iOS and HarmonyOS devices in natural language, and set up Vitest + Midscene E2E tests. Bring your own vision model API key; maintained by the Midscene team.
web-infra-dev/midscene-skills318
Mobile MCP
MCPLets agents control iOS and Android simulators and real devices: reads the accessibility tree first and falls back to screenshot coordinates, and can swipe, install and uninstall apps, record the screen and read device logs. Requires Xcode or Android platform tools.
mobile-next/mobile-mcp9.7k
MCP Appium
MCPAppium's official MCP server: lets agents start sessions on Android and iOS emulators and real devices, locate elements, tap, type and take screenshots, and generate Java/TestNG test code. Needs the Android SDK or Xcode.
appium/appium-mcp498
Maestro
CLIWrite end-to-end UI tests for Android, iOS and web apps in YAML. The CLI includes an MCP server (maestro mcp) so coding agents can tap, assert and generate tests on simulators. Requires Java 17+.
mobile-dev-inc/Maestro16.1k
agent-device
CLIFrom Callstack: lets coding agents drive and verify iOS, Android, HarmonyOS and desktop apps through accessibility snapshots, with taps, form filling, screenshots, logs and performance sampling, plus a built-in MCP server. Requires Node.js 22.12+.
callstack/agent-device5k
Expo CLI
CLIExpo's official CLI: starts the React Native dev server, runs prebuild to generate native folders, runs apps locally on iOS and Android, and installs version-compatible dependencies. Ships with the expo package; call it with npx expo inside a project.
expo/expo52.8k