Problem: Developing Mobile Apps is slow – even with AI Agents.
Solution: The solutions is giving Claude direct access to the simulator. That’s where MCP servers come in. MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems. Using MCP, AI applications like Claude can connect to data sources (e.g. local files, databases), tools (e.g. search engines, calculators) and workflows (e.g. specialized prompts) – enabling them to access key information and perform tasks. In a way, MCP is a smart API. We are going to use “mobile-mcp” project.
MCP in 30 Seconds
- You tell Claude what to do
- Claude asks the MCP server how to do it
- The MCP server translates that into commands
- Claude executes them
MCP server that wraps mobile device simulator control. Using it, Claude can tap, swipe, read the screen, and run tests, etc. automatically without human intervention.
Teaching Claude
Having the MCP server is step one. The next step is teaching Claude how to use them effectively is where the magic happens. This goes in your project’s CLAUDE.md file. Here’s a simplified example of what can be inside it:
# Expo + mobile-mcp Testing Guide (`claude.md`)
This document defines **how to test this Expo React Native app using mobile-mcp**.
It assumes the app is run via **Expo (dev client or Expo Go)** and controlled through **mobile-mcp simulator tools**.
Follow these rules strictly to ensure deterministic, repeatable tests.
## Environment Assumptions
- App is built and run using **Expo**
- Simulator/emulator is controlled via **mobile-mcp**
- Navigation uses **React Navigation**
- App supports **accessibility labels / testIDs**
## Permissions (Camera, Notifications, Location)
- Handle permission dialogs explicitly
- Assert whether permission was:
- Requested
- Granted
- Denied
- Capture screenshots of system dialogs when relevant
## Core Principles
1. **Accessibility-first (required)**
- Prefer `accessibilityLabel`, `accessibilityRole`, or visible text
- Coordinates are a last resort only
2. **State-aware testing**
- Expo preserves state across reloads — always confirm state explicitly
3. **Deterministic navigation**
- Use only documented flows from `sitemap.md`
4. **Fail fast**
- If an expected element is missing, stop immediately
5. **Evidence-based**
- Screenshots are mandatory for UI verification
## Standard Test Workflow (Required)
When asked to test a feature or UI change, follow this sequence **exactly**.
### 1. Start the Expo App
### 2. Launch the App in Simulator
### 3. Normalize App State
### 4. Navigate Using Semantics Only
### 5. Verify UI State (Mandatory)
### 6. Capture Screenshots
### 7. Report Results
If I ask Claude to “test the commenting flow,” Claude builds the app, launches the simulator, takes a screenshot, taps on a post, takes a screenshot, taps on the comment button, takes screenshot, adds a comment and presses submit, reads the screen state, and tells me whether it worked. If something’s broken, it shows me the screenshot and proposes a fix. In some cases it’ll see the visual inconsistency and will fix it immediately just like it would fix a compiler error.
What My Agentic Workflow Looks Like Now
Before:
- Open and start simulator
- Make a change
- Build and deploy (automatically) the change
- Navigate to the feature
- Test the feature
- Take a screenshot
- Find file in file system
- Drag into the agent e.g. Claude
- Explain what I am expecting vs observed
- Ask for a new change and repeat
After:
- Describe what I want
- Claude builds, tests, and confirms
New improved workflow means that Claude makes a change and then accomplishes the given goal without user intervention, which means that several manual steps are omitted and skipped for fast execution: agent like Claude can see its own change, which speeds up the iterative and incremental changes.
Mobile MCP Setup Guide
The guide can be used for both Android and iOS development. The goal is to enable agent (Claude) to make changes to React-Native app and then visually get feedback about the done change. Also, the user can provide feedback about the change via agent CLI.
Complete Setup Guide for Mobile MCP with Expo Android
This guide shows you how to give Claude Code visual control over your Android emulator, enabling it to see screenshots, read UI elements, and interact with your React Native Expo app automatically.
1. Prerequisites
Make sure you have these installed:
-
Node.js v22+ – Check with: node –version
-
Android Debug Bridge (ADB) – Check with: adb version
-
Android SDK – Verify (often it is ~/Android/Sdk): echo $ANDROID_HOME
-
Claude Code installed – Check with: claude –version
2. Install Mobile MCP in Claude Code
Navigate to your Expo project and add Mobile MCP (@mobilenext/mobile-mcp@latest):
cd /path/to/your/expo-project
claude mcp add mobile-mcp — npx -y @mobilenext/mobile-mcp@latest
3. Start Your Android Emulator
Some basics first. dev-client flag tells Expo to use a development build, A dev client is your actual app, but with special debugging tools built in. A development build is a debug build of your app that contains expo-dev-client library. It helps you iterate as quickly as possible and provides a more flexible, reliable, and complete development environment than Expo Go. You can install any native library and configure or apply changes to a native project using app config or by creating a config plugin. You can create a development build locally or use EAS Build to create a build in the cloud.
expo run:android / expo run:ios (Build + Run)
What it does:
- Builds the native app
- Installs it on simulator/emulator
- Starts Metro bundler automatically
- Launches the app
List available emulators:
emulator -list-avds
Start your emulator:
emulator -avd YOUR_AVD_NAME &
Or use Expo to build and run (starts emulator automatically):
npx expo run:android # or ‘npm run android’ if in package.json
4. Verify Connection
Check connected devices:
adb devices
5. Start Claude Code and Test
Start Claude Code in your project:
claude
Test the connection with these prompts:
-
“List all available devices”
-
“Take a screenshot of the current screen”
6. Create CLAUDE.md Configuration
Create a CLAUDE.md file in your project root to teach Claude about your app:
Project Information
-
Framework: React Native with Expo
-
Package name from app.json
-
Build command: npx expo run:android
Testing Workflow
-
Build the app – Run build command and wait for success
-
Launch in emulator – Use launch_app with bundle ID
-
Take screenshot – Capture initial state
-
Navigate – Use accessibility labels or coordinates
-
Verify state – List elements and compare
-
Report back – Share screenshots and findings
7. Add Accessibility Labels to Your Components
Update your React Native components with accessibility labels for reliable testing:
<Button
onPress={handleLogin}
accessibilityLabel=”login-button”
testID=”login-button”
>
8. Available Mobile MCP Commands
Claude can automatically use these tools:
|
Category |
Commands |
|
Device Management |
list_available_devices, get_screen_size, get_orientation, set_orientation |
|
App Control |
list_apps, launch_app, terminate_app, install_app |
|
UI Interaction |
take_screenshot, list_elements_on_screen, click_on_screen_at_coordinates, double_tap, long_press, swipe |
|
Input |
type_keys, press_button (BACK, HOME, etc.), open_url |
9. Example Usage
Here are some example prompts you can give Claude:
-
“Build and launch the app, then take a screenshot of the home screen”
-
“Test the login flow with email [email protected] and password test123”
-
“Navigate through all bottom tabs and verify they load correctly”
-
“Find the settings screen and toggle dark mode”
10. Pro Tips
-
Always use accessibility labels – Makes testing 10x more reliable than coordinates
-
Document flows in sitemap.md – The more context, the smarter Claude gets
-
Start simple – Begin with basic screenshots to verify everything works
-
Use dev builds – Faster iteration than release builds
-
Keep emulator running – Don’t close it between test runs
11. Debugging
If Mobile MCP isn’t working:
-
Start Claude Code with debug logging: claude –mcp-debug
-
Check devices: adb devices
-
Verify tools: Type /mcp in Claude Code
What You’ve Accomplished
You’ve now given Claude Code complete visual control over your Android emulator. Claude can:
-
See what’s on screen via screenshots and accessibility tree
-
Interact with your app by tapping, swiping, and typing
-
Test complete user flows automatically
-
Verify that features work as expected
-
Report issues with screenshots and detailed findings
This transforms Claude Code into a powerful automated testing assistant that works just like a human tester! 🎉
Additional Resources
-
Mobile MCP GitHub: https://github.com/mobile-next/mobile-mcp
-
Claude Code Documentation: https://docs.claude.com/
-
Expo Documentation: https://docs.expo.dev/
- Crypto module for instance for HMAC: https://github.com/margelo/react-native-quick-crypto