Overview
The MCP integration allows you to:- Run mobile automation tasks from AI coding assistants
- Use Mobilerun devices, tasks, workflows, and the assistant through MCP tools
- Integrate with any MCP-compatible client (Cursor, Claude Desktop, etc.)
Configuration
There are two ways to connect to the Mobilerun MCP server:API Key Authentication
Use your API key for direct authentication. This method is ideal for automated workflows and server-side integrations.dr_sk_YOUR_API_KEY with your actual API key from the API Keys tab.
OAuth Authentication
Use OAuth for interactive authentication through the browser. This method is recommended for personal use in IDEs and desktop applications.Available Tools
Once connected, the MCP server exposes tools for the main Mobilerun workflows:
Some tools create or cancel billed resources (for example
create_device, connect proxy purchases, or work the assistant does on your behalf). These are charged to the account behind the key.
Talk to the Mobilerun Assistant
Theassistant tool lets an MCP client chat with the hosted Mobilerun Assistant. It supports these operations: list_sessions, create_session, update_session, send_message, get_messages, abort, answer_question, reject_question, and answer_permission.
1
Create or pick a session
Use
create_session to start a new conversation, or list_sessions to continue an existing one.2
Send a message
Call
send_message. It waits up to about 45 seconds and returns the reply, or running if the turn takes longer.3
Poll for long turns
If the result is
running, poll get_messages until turnActive is false. Never resend the message.4
Answer questions
Answer pending questions (
pending.questions) with answer_question, or dismiss them with reject_question.5
Resolve approvals
Resolve approvals (
pending.permissions) with answer_permission using once or reject.Client Setup
Cursor
Add the MCP configuration to your Cursor settings:- Open Cursor Settings
- Navigate to the MCP section
- Add the Mobilerun server configuration
- Restart Cursor to connect
Claude Desktop
Add the configuration to your Claude Desktopclaude_desktop_config.json file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Usage Example
Once configured, you can interact with Mobilerun directly through your AI assistant:“Run a task on Mobilerun to open the Settings app and take a screenshot”
“Ask the Mobilerun assistant which of my devices are ready”The assistant will use the MCP tools to:
- List available devices
- Create and run the task
- Return the results
Choosing an Authentication Method
API Key
Best for automated systems, CI/CD pipelines, and server-side applications where you manage the credentials.
OAuth
Best for personal use in IDEs where you want to authenticate with your own account interactively.