Setup
-
Set up a phone, install LangChain and its MCP adapter, and create a Mobilerun API key.
Install the adapter for the example’s language:
-
Configure the Mobilerun server (
@langchain/mcp-adaptersfor TypeScript,langchain-mcp-adaptersfor Python):
- Set
MOBILERUN_API_KEYand model credentials in the process environment. Use the example inside an async function and passtoolsto your LangChain agent. Keep keys server-side and configure action approvals.
First task
List my Mobilerun devices and take a screenshot of the ready device.See MCP Server for available tools. See LangChain’s MCP documentation for agent construction and session behavior.