Give Codex an Android phone: the Android MCP server for OpenAI Codex.
Set it up in two steps
1. Get a key. Paste this into Codex. It installs the Phonebox CLI and signs you in from the terminal; you never paste a key into 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. Put this in ~/.codex/config.toml, then export the key in the shell you start Codex from:
[mcp_servers.phonebox]
url = "https://phonebox.dev/mcp"
bearer_token_env_var = "PHONEBOX_API_KEY"export PHONEBOX_API_KEY=$(phonebox token)Codex reads the key from PHONEBOX_API_KEY and sends it as a bearer token, so the config file holds no secret and is safe to keep in your dotfiles. Restart Codex and the phonebox tools appear.
What Codex can do with the phone
| Task | Tools |
|---|---|
| Get a phone | create_phone, list_phones, get_phone, start_phone |
| See the screen | observe: the screen as numbered text elements, plus a screenshot |
| Use apps | act: up to 20 taps, types, swipes and key presses per call |
| Install your build | create_app_upload, complete_app_upload, install_app, list_apps |
| Hand off to a person | live_view_url: a link to watch and control the phone |
| Stop paying | park_phone; reboot_phone when an app hangs |
Because observe returns the screen as text with labels, Codex taps by what it reads, such as “Sign in”, instead of guessing coordinates from pixels.
A first task for Codex
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.Codex builds the APK in its own shell, uploads it with the curl command that create_app_upload returns, installs it and walks the screens. Phonebox never retries a write to the phone on its own, so a slow response can't turn into a double tap on “Place order”.
Related
- Android MCP server: every tool and how the hosted server compares with ADB-based ones.
- Give Cursor an Android phone and the Claude Code setup video.
- Test your Android app with an AI agent.
Questions
Can OpenAI Codex control an Android phone?
Yes. Add Phonebox's hosted MCP server to ~/.codex/config.toml with url = "https://phonebox.dev/mcp" and bearer_token_env_var = "PHONEBOX_API_KEY". Codex then gets 13 phone tools: it can create a cloud Android phone, read the screen as text, tap, type, install an APK, hand off to a person and park the phone.
Does Codex need ADB or an Android emulator?
No. The phone runs in Phonebox's cloud, so Codex only needs network access and an API key. Nothing Android-related runs on your machine, which also makes it work on remote dev boxes and CI runners.
How does Codex get the API key?
Paste the setup prompt into Codex: it installs the Phonebox CLI and signs you in from the terminal, and the key is saved on your machine. export PHONEBOX_API_KEY=$(phonebox token) puts it in the environment that Codex reads through bearer_token_env_var, so the key never sits in config.toml.
What does it cost to give Codex an Android phone?
$0.06 per phone-minute while the phone runs, billed per second with a one-minute minimum. Parked phones are free and keep their apps and sign-ins. New accounts get $2 of credit with no card.