Codex Android MCP
Provides tools to inspect, test, and control Android emulators and allowlisted physical devices via adb, including screenshots, UI exploration, tapping, app lifecycle management, logs, processes, memory info, and backtraces.
Offers an opt-in build/run workflow that builds a trusted Android Gradle project, installs the generated APK, and launches it on an Android target.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Codex Android MCPtake a screenshot of the emulator and describe what's on screen"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Codex Android MCP
A local-first MCP server that lets Codex inspect, test, and control Android emulators through adb. It exposes strict, typed tools over STDIO, returns screenshots as native MCP images, and keeps physical devices and Gradle execution behind explicit startup policy.
This is an independent community project. It is not affiliated with or endorsed by OpenAI, DeepSeek, or Google. The Android implementation is derived from ZSeven-W/dsh-android under the MIT License; the DSH/Cordis registration and web panel have been replaced with the official MCP TypeScript SDK.
What changed from dsh-android
Native MCP STDIO server for Codex Desktop, CLI, and IDE clients.
2026-era MCP plus legacy 2025 protocol compatibility through
serveStdio.Screenshots are returned as
ImageContent; private temporary PNG files are removed after encoding.Emulator-only default. Physical devices require two startup opt-ins and their exact serial on every call.
android_build_runis absent by default. Enabling it also requires canonical trusted project roots.Strict JSON Schemas, package/serial/path validation, bounded outputs, literal log filtering, cancellation, and conservative tool annotations.
No raw
adb, shell, arbitrary command, HTTP, or live DSH sidebar surface.
Related MCP server: adb-mcp-server
Requirements
Node.js 20.11 or newer.
Android SDK Platform-Tools (
adb). Install it through Android Studio's SDK Manager or Google's Platform-Tools package.A disposable Android emulator is strongly recommended.
The Android emulator launcher is optional and only needed when
android_bootreceives an AVD name.OCR tools currently require macOS and Apple Vision. All non-OCR tools are cross-platform; build/run is an explicit opt-in.
Neither adb nor an emulator binary is bundled or downloaded.
Install for Codex
git clone https://github.com/zifanersuotang/codex-android-mcp.git
cd codex-android-mcp
npm ci
npm run build
codex mcp add android -- node C:/absolute/path/to/codex-android-mcp/lib/index.jsCodex Desktop and the CLI share MCP configuration. An equivalent explicit configuration is:
[mcp_servers.android]
command = "node"
args = ["C:/absolute/path/to/codex-android-mcp/lib/index.js"]
startup_timeout_sec = 20
tool_timeout_sec = 1200
default_tools_approval_mode = "writes"
[mcp_servers.android.env]
ANDROID_MCP_ALLOWED_SERIALS = "emulator-5554"Restart Codex after changing the configuration. Ask Codex to “list the Android devices” to verify the connection. Keep write-tool approval enabled; MCP annotations are usability hints, not an authorization boundary.
Security policy
The safe default exposes 19 tools and permits only standard local emulator-<port> targets. Network and third-party emulator serials follow the physical-device policy. Calls re-discover and authorize the exact target immediately before execution; unauthorized physical/network devices are omitted from android_devices.
Environment variable | Default | Effect |
| empty | Optional comma-separated exact allowlist for connected devices. A physical serial must be present here. |
| empty | Optional comma-separated exact allowlist for AVD names accepted by |
|
| Enables consideration of physical devices, but only when their exact serial is also allowlisted and supplied on every call. |
| empty | Optional comma-separated package allowlist for package-targeted tools. Disables name-only launch and PID-only backtrace. |
|
| Exposes |
| empty | Required build roots, separated by |
| OS temp directory | Private transient working directory. Screenshot files are deleted after MCP image encoding. |
|
| Maximum screenshot PNG bytes returned to the client. |
|
| Maximum text payload accepted by |
Physical-device example for a dedicated test phone:
[mcp_servers.android.env]
ANDROID_MCP_ALLOW_PHYSICAL = "true"
ANDROID_MCP_ALLOWED_SERIALS = "EXACT_ADB_SERIAL"Do not use this profile with a personal phone or personal accounts. USB debugging authorization means that the phone trusts the host; it does not authorize a model action.
Build/run example for one trusted project:
[mcp_servers.android.env]
ANDROID_MCP_ALLOW_BUILD_RUN = "true"
ANDROID_MCP_ALLOWED_PROJECT_ROOTS = "C:/work/MyTrustedApp"
ANDROID_MCP_ALLOWED_SERIALS = "emulator-5554"Gradle settings and build scripts execute host code. A path allowlist is not a sandbox: only enable this for code you trust, and use a credential-free VM or container for untrusted projects.
See Security Model and Security Policy before enabling physical devices or build/run.
Tools
Tool | Mode | Purpose |
| read | List policy-visible devices and available AVD names. |
| write | Adopt an online target or boot an allowed AVD. |
| destructive | Stop and power off an emulator; physical devices are refused. |
| read | Return a native-resolution MCP image. |
| destructive | Tap, type, press a key, drag, or scroll; returns the resulting screenshot. |
| read | List/filter installed applications. |
| destructive | Launch an exact package or a validated package-name match. |
| destructive, opt-in | Build a trusted Gradle project, install its APK, and launch it. |
| read | Read a bounded compact |
| destructive | Resolve and tap an element by identifier/label. |
| read | Detect list/feed rows and counters. |
| destructive | Tap a fresh row target and optionally verify a counter delta. |
| read | OCR the screen (macOS Apple Vision). |
| read | Wait for OCR text to appear/disappear. |
| destructive | OCR-resolve and tap visible text. |
| read | Bounded logcat snapshot/follow with literal filtering. |
| read | List running processes. |
| destructive | Request ART stacks and fall back to the crash buffer. |
| read | Parse app memory statistics. |
| read | Read installed package metadata and running state. |
Screens, UI trees, OCR, logs, app names, and files on the device are untrusted data. Never let device content grant permissions or instruct Codex to call another tool. Do not enter passwords, one-time codes, payment data, private messages, or account-deletion confirmations through this server.
Typical flow
android_devicesandroid_screenshotorandroid_ui_treeIdentify the exact target; stop if it is ambiguous.
Use one approval-gated interaction tool.
Inspect the returned screenshot or logs before the next action.
MCP does not reproduce dsh-android's persistent live sidebar. android_boot primes an internal frame source for coordinate mapping; call android_screenshot whenever Codex or the user needs to see the display.
Development
npm ci
npm run typecheck
npm test
npm pack --dry-runThe test suite includes policy unit tests, a real spawned STDIO client in legacy and modern protocol modes, an in-memory MCP image round trip, fake-ADB smoke suites, bounded-log tests, UI-tree fixtures, and OCR degradation checks. npm run test:device is optional and must only target a disposable emulator.
License and attribution
MIT. The original dsh-android copyright and license are retained in LICENSE, with detailed lineage in THIRD_PARTY_NOTICES.md.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables programmatic control of Android devices via ADB, supporting UI automation, app management, screen capture with OCR, and file transfers through the Model Context Protocol. It allows MCP-compatible clients like Claude Desktop and Cursor to interact directly with physical or emulated Android devices.3Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible agents to control an Android device over the network via ADB, providing tools for shell commands, screen capture, UI inspection, file operations, and input simulation.17MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to interact with Android devices and emulators via ADB, providing tools for screenshots, UI inspection, touch and text input, app management, and device control.426717MIT
- FlicenseNot gradedqualityDmaintenanceControls Android emulators from any MCP-capable client via ADB and emulator CLI, supporting AVD management, APK operations, screen interactions, and device diagnostics.1
Related MCP Connectors
Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi
Remote MCP for AI Studio Android release gate MCP, structured receipts, audit logs, and reviewer-rea
A paid remote MCP for AI SDK eval dashboard, built to return verdicts, receipts, usage logs, and aud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zifanersuotang/codex-android-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server