Mobile Next MCP
repository·main·Indexed 26 days ago
https://github.com/mobile-next/mobile-mcpA Model Context Protocol (MCP) server providing a platform-agnostic API for automating iOS and Android devices, including simulators, emulators, and real hardware. It enables LLMs and Agents to perform device management, app lifecycle control, screen interactions (clicks, swipes, screenshots), input navigation, and crash report retrieval without requiring platform-specific expertise in XCUITest or Espresso.
What's inside @mobilenext/mobile-mcp
- Mobile Next is a Model Context Protocol (MCP) server designed for scalable mobile automation and development. It provides a platform-agnostic interface that allows LLMs and Agents to interact with iOS and Android devices (simulators, emulators, and real hardware) without requiring platform-specific expertise like XCUITest or Espresso. The server uses an accessibility-first approach, driving interactions through the native accessibility tree for speed and efficiency, falling back to coordinate-based interactions when necessary.
Install Mobile MCP in various IDEs and CLI tools
mainMobile MCP can be installed in several MCP-compatible clients. The standard configuration uses
npxto run@mobilenext/mobile-mcp@latest.Standard JSON Configuration
Use this for tools like Claude Desktop, Cline, or Windsurf:
{ "mcpServers": { "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] } } }Tool-Specific Installation Commands
- Amp CLI:
amp mcp add mobile-mcp -- npx @mobilenext/mobile-mcp@latest - Claude Code:
claude mcp add mobile-mcp -- npx -y @mobilenext/mobile-mcp@latest - Codex CLI:
codex mcp add mobile-mcp npx "@mobilenext/mobile-mcp@latest" - Gemini CLI:
gemini mcp add mobile-mcp npx -y @mobilenext/mobile-mcp@latest - Copilot CLI: Use
/mcp addinteractively. - Cursor: Use the Cursor MCP Install Link or manually add a
commandtype server withnpx -y @mobilenext/mobile-mcp@latest. - Goose: Add a custom extension with type
STDIOand commandnpx -y @mobilenext/mobile-mcp@latest. - Windsurf: Add a new server with
commandtype usingnpx @mobilenext/mobile-mcp@latest.
- Amp CLI:
Verify Mobile MCP installation
mainAfter adding the configuration, verify the installation by calling the
mobile_list_available_devicestool.- Success: The tool returns a list of connected simulators, emulators, and/or real devices.
- Failure (Empty list): Ensure a simulator or emulator is currently running, or that a physical device is connected and authorized.
mobile_list_available_devicesInstall Mobile MCP via npx
mainYou can run the Mobile MCP server using
npx. This is compatible with MCP-supported clients like Claude Code, Codex, Gemini, and GitHub Copilot.To install/run the latest version:
npx -y @mobilenext/mobile-mcp@latestInstall the Mobile MCP server
mainTo install Mobile MCP, add the server to your MCP configuration file (e.g.,
claude_desktop_config.jsonor your IDE's MCP settings). The server is executed vianpxand does not require a separate global installation.Prerequisites
- Node.js v20+
- Android targets: Android Platform Tools with
adbavailable on yourPATH. - iOS targets (macOS only): Xcode command line tools.
- Active target: At least one booted iOS Simulator, running Android emulator, or a connected real device must be available.
{ "mcpServers": { "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] } } }Run Mobile MCP in SSE Server Mode
mainBy default, Mobile MCP runs over
stdio. To run it as an SSE (Server-Sent Events) server, use the--listenflag. This allows clients to connect via HTTP.To bind to
localhost:3000:npx @mobilenext/mobile-mcp@latest --listen 3000To bind to a specific interface (e.g.,
0.0.0.0for network access):npx @mobilenext/mobile-mcp@latest --listen 0.0.0.0:3000Configure your MCP client to connect to
http://<host>:3000/mcp.Authenticate SSE server with Bearer tokens
mainThe SSE (Server-Sent Events) server supports optional Bearer-token authentication. To enable this, use the--listenflag when starting the server and provide the token via theMOBILEMCP_AUTHenvironment variable.Platform Support and Setup Requirements
mainMobile MCP supports the following targets:
Target Supported Setup Requirements iOS Simulator ✅ Xcode + a booted simulator ( xcrun simctl)iOS Real Device ✅ go-ios+WebDriverAgent+ tunnelAndroid Emulator ✅ Android SDK + running emulator ( adb)Android Real Device ✅ adb+ USB debugging enabled & authorizedGeneral Prerequisites:
- Node.js v20+
- Xcode command line tools
- Android Platform Tools
- An MCP-compatible client (e.g., Claude MCP, OpenAI Agent SDK, Copilot Studio)
Run Mobile MCP in Headless Mode
mainYou can run Mobile MCP with emulators or simulators running in the background.
Android
- Start an emulator using
avdmanageroremulatorcommands. - Run Mobile MCP with your desired flags.
iOS
- Ensure Xcode is installed.
- Boot a simulator instance using
xcrun simctl:xcrun simctl boot "iPhone 16" - Run Mobile MCP.
- Start an emulator using
Configure Authorization for SSE Server
mainTo secure an SSE server, set the
MOBILEMCP_AUTHenvironment variable. This requires all incoming requests to include a Bearer token in theAuthorizationheader.Example:
MOBILEMCP_AUTH=my-secret-token npx @mobilenext/mobile-mcp@latest --listen 3000Clients must then send the header:
Authorization: Bearer my-secret-token.Configure the mobilecli binary path
mainTheMobilecliclass attempts to auto-locate themobileclibinary innode_modules/mobilecli/bin/. You can override this behavior by setting theMOBILECLI_PATHenvironment variable to the absolute path of yourmobileclibinary.Configure iOS real devices
mainWhile iOS Simulators and Android devices work with the standard prerequisites, iOS real devices require additional setup beyond the basic installation. You must configure:
go-iosWebDriverAgent- A device tunnel