# android

This MCP server lets an AI agent control Android devices and emulators through ADB. Use it to inspect app screens, automate UI actions, or review logs.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 68
- Author: martingeidobler
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/martingeidobler/android-mcp-server
- Updated: 2026-03-18
- HTML: https://affpapa.org/en/nevibecode/mcp/android

## What it does

The server exposes tools for capturing screenshots, reading the UI hierarchy, and targeting elements by text or `resource-id`. An agent can tap, swipe, type, press keys, install APKs, launch apps, and inspect `logcat` with filters for package, level, or time. Device listing and emulator startup are included too.

You need Node.js 18+, the Android SDK with `platform-tools` and ADB, plus a running emulator or connected device. On macOS, the server looks for the SDK at `~/Library/Android/sdk`; otherwise it uses `ANDROID_HOME`. If the SDK lives elsewhere, set that variable in the MCP configuration. Without ADB access, its device controls cannot run.

Add it to Claude Code with `claude mcp add`. You can target a device by ID, and `tap_and_wait` combines a tap, a wait for the UI to settle, and a fresh UI-tree result. The app itself needs no SDK integration or code changes; the server works through ADB.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `ANDROID_HOME` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env ANDROID_HOME=<ANDROID_HOME> --transport stdio android -- npx -y android-mcp-server
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add android --env ANDROID_HOME=<ANDROID_HOME> -- npx -y android-mcp-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "android": {
            "command": "npx",
            "args": [
                "-y",
                "android-mcp-server"
            ],
            "env": {
                "ANDROID_HOME": "<ANDROID_HOME>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "android": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "android-mcp-server"
            ],
            "env": {
                "ANDROID_HOME": "<ANDROID_HOME>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ANDROID_HOME=<ANDROID_HOME> android npx -y android-mcp-server
```
Replace <…> with your own values

## When to use it
- inspect the elements shown on an Android screen
- tap a control by its text or `resource-id`
- enter text and step through a UI flow
- capture a screenshot and inspect `logcat`
- start an emulator to check an app

## Example prompts
- Inspect the Android screen and tell me which controls are visible.
- Tap the “Sign in” button and check the updated screen.
- Capture a screenshot of the app and look for errors in `logcat`.

## Similar
- [mobile-mcp](https://affpapa.org/en/nevibecode/mcp/mobile-mcp.md) — MCP server · ★ 9946
- [mobilerun](https://affpapa.org/en/nevibecode/mcp/mobilerun.md) — MCP server · ★ 9751
- [e2e](https://affpapa.org/en/nevibecode/mcp/e2e.md) — MCP server · ★ 11912
- [XcodeBuildMCP](https://affpapa.org/en/nevibecode/mcp/xcodebuildmcp.md) — MCP server · ★ 6505
- [ShipSwift](https://affpapa.org/en/nevibecode/mcp/shipswift.md) — MCP server · ★ 3244
- [agent-device](https://affpapa.org/en/nevibecode/mcp/agent-device.md) — MCP server · ★ 5149

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
