Give Cursor an Android phone: an Android MCP server for Cursor's agent.
Set it up
1. Get a key. Paste this into Cursor's agent. It installs the Phonebox CLI and signs you in; the key is saved on your machine, not in the chat.
Read https://phonebox.dev/setup.md and set me up with Phonebox from here: get me signed in and ready, then find out what I want to use phones for and help me with that.2. Add the server for every project in ~/.cursor/mcp.json, with your key in place of pbx_…:
{
"mcpServers": {
"phonebox": {
"url": "https://phonebox.dev/mcp",
"headers": { "Authorization": "Bearer pbx_…" }
}
}
}Or for one project, commit .cursor/mcp.json and let each person's environment hold the key:
{
"mcpServers": {
"phonebox": {
"url": "https://phonebox.dev/mcp",
"headers": { "Authorization": "Bearer ${env:PHONEBOX_API_KEY}" }
}
}
}export PHONEBOX_API_KEY=$(phonebox token)Open Cursor's MCP settings and check that phonebox shows its 13 tools.
The loop Cursor gets
| Step | What happens |
|---|---|
| Build | The agent runs ./gradlew assembleDebug in Cursor's terminal |
| Install | create_app_upload gives a curl command; install_app waits until the phone lists the app |
| Look | observe returns the screen as numbered text elements, plus a screenshot |
| Act | act taps by visible text, types and swipes, then returns the new screen |
| Report | The agent quotes the exact screen text it saw when something is wrong |
| Park | park_phone stops billing; the app and test accounts stay for the next build |
Build the debug APK and install it on my Phonebox phone.
Walk through the onboarding and settings screens I changed in this branch.
Read the screen before every action. Report anything that looks broken,
with the screen text you saw. Park the phone when you finish.When a step needs a person, such as a one-time code sent to your own phone, the agent calls live_view_url and hands you a link to the phone.
Related
- Android MCP server: every tool, and how hosted compares with ADB-based servers.
- Give Codex an Android phone and the Claude Code setup video.
- Test your Android app with an AI agent.
Questions
Can Cursor control an Android phone or emulator?
Yes, through MCP. Add Phonebox's hosted Android MCP server, https://phonebox.dev/mcp, to ~/.cursor/mcp.json or a project's .cursor/mcp.json with an Authorization header. Cursor's agent can then create a cloud Android phone, read its screen, tap, type, install an APK and park it.
Do I need Android Studio for Cursor to test my Android app?
No. You need the Android SDK only to build the APK. The phone runs in Phonebox's cloud, so there's no emulator eating RAM on your laptop and nothing to keep running between sessions.
How do I keep the API key out of git?
Use the global ~/.cursor/mcp.json, or reference an environment variable in a project's .cursor/mcp.json with ${env:PHONEBOX_API_KEY} and set it with export PHONEBOX_API_KEY=$(phonebox token). Never commit a file that holds a pbx_ key.
What does it cost?
$0.06 per phone-minute while the phone runs, billed per second with a one-minute minimum. Parked phones are free and keep the installed app and its sign-ins. New accounts get $2 of credit with no card.