Ghost in the Droid
Give any LLM agent a real Android phone or iPhone: 66 MCP tools, reusable app skills that replay without LLM calls, and human-in-the-loop captcha steps.
- Source repo
- ghost-in-the-droid/android-agent
- Stars
- ★ 439
- Last updated
- 19d ago
- FARS reviewed
- Dec 03, 2026
- License
- MIT
- Primary language
- Python
- FA score
- 53/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformCodex · Claude Code · OpenAI API · Claude API
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- QA and automation engineers who need scheduled regression runs across a batch of real phones or a Docker+KVM emulator pool, using the Scheduler and the per-device Tests tab with recording playback
- Not a fit if
- Teams that want a fully managed hosted service rather than a server they run
- Teams automating real iPhones without a Mac and Xcode
- Managed-fleet environments where USB debugging cannot be enabled
- Website
- ghostinthedroid.com ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-15
- Source review
- 53/100 · Major gaps 1 safety controls not found
What does this agent do, and when should you use it?
Ghost in the Droid (repo android-agent) is an MIT-licensed Python framework that turns a physical Android phone or iPhone into a body for any LLM agent. A FastAPI server on port 5055 exposes device control, skills, bot scheduling and live streaming, a Vue 3 dashboard ships alongside it, and an in-process MCP server publishes 66 tools that Claude Code, Codex, Cursor, VS Code Copilot and Windsurf can call directly. Android devices are driven over ADB (USB, Wi-Fi, or Docker+KVM emulator pools); refs of the form ios:<udid> route to Appium XCUITest/WebDriverAgent instead. Known workflows compile into skills - YAML element maps plus Python action and workflow classes - that replay with zero LLM calls, and the Skill Hub registry distributes them through a ghost skill CLI with hash-checked installs. The brain is swappable: Claude subscription login, Anthropic/OpenAI/OpenRouter APIs, local Ollama or vLLM, or a model running inside the phone via llama.cpp, MediaPipe or MLX, so the same 66-tool body survives every model upgrade.
The core is a routing layer keyed on device ref: bare serials go to bots/common/adb.py (the ADB backend), ios:<udid> goes to bots/common/ios.py (Appium/WDA). It reads the screen as Android UIAutomator XML or a normalized XCTest accessibility tree and returns screenshot, screenshot_annotated, screenshot_cropped, get_elements, get_screen_tree and get_screen_xml. Actions cover tap, tap_element, swipe, long_press, type_text, type_unicode, press_back, press_home, press_key, plus app-level launch_app, search_apps, force_stop, launch_intent and list_packages. Understanding tools include get_phone_state, classify_screen, find_on_screen, ocr_screen, ocr_region and extract_visible_text; browser and iOS tools include open_url, browser_back, get_current_url, read_news, extract_articles and wait_for_text. Skills are first-class calls: list_skills, run_workflow, run_action, create_skill, explore_app, with run_flow/chain collapsing a multi-step recipe into one server-side call so N round-trips become 1. Device and diagnostics add list_devices, clipboard_get/set, get_notifications, device_health, list_crashes, get_crash, web_search, screen recording, camera and TTS. The dashboard organizes all of it into Phone Agent, Scheduler, Skill Hub, Skill Creator, Skill Miner (BFS app-state discovery), Manual Run, Tests, Emulators and Tracing tabs, and a multi-device phone farm keeps a per-device job queue.
- QA and automation engineers who need scheduled regression runs across a batch of real phones or a Docker+KVM emulator pool, using the Scheduler and the per-device Tests tab with recording playback
- A solo developer who wants Claude Code, Codex or Cursor to operate a spare Android phone on the desk, e.g. ghost "check reddit" --device asus
- Teams already building agents in LangChain or LlamaIndex that need a mobile tool surface without rewriting their device layer
- Privacy-sensitive users who run the whole loop on-device with llama.cpp/MediaPipe on Android or llama.cpp on Metal and MLX on iPhone, in airplane mode
- Skill authors packaging skill.yaml, elements.yaml, actions and workflows and publishing through ghost skill validate/submit so others can install them hash-checked from the hub
- iOS teams already on macOS, Xcode and Appium who want the same 66-tool surface for a trusted iPhone or a booted simulator
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
uvx ghost-in-the-droid doctor # preflight: python, adb on PATH, devices, ports, LLM keysuvx ghost-in-the-droid login # sign in with your Claude subscription, no API key neededuvx ghost-in-the-droid up # server + dashboard at http://localhost:5055 (API docs at /docs)pipx install ghost-in-the-droid
- Ports
5055·6175·4723- Environment variables
IOS_DEVICE_UDIDIOS_APPIUM_URLIOS_BUNDLE_IDIOS_MJPEG_SERVER_PORTOPENAI_API_KEYANTHROPIC_API_KEY- Config files
.env~/.ghost/skills- Runtime
- Python 3.10+ · Node.js 18+
- Install notes cover
- macOS · Android
How do you install or deploy this agent?
Requirements: Python 3.10+; an Android phone with USB debugging enabled and adb devices listing it; Node.js 18+ only if you run the frontend dev server. The zero-install path uses uvx:
uvx ghost-in-the-droid doctor # preflight: python, adb on PATH, devices, ports, LLM keys
uvx ghost-in-the-droid login # sign in with your Claude subscription, no API key needed
uvx ghost-in-the-droid up # server + dashboard at http://localhost:5055 (API docs at /docs)If you prefer pipx:
pipx install ghost-in-the-droidFrom a clone, for development:
git clone https://github.com/ghost-in-the-droid/android-agent.git
cd android-agent
pip install -e ".[all]"
android-agent doctor # preflight
android-agent up # start server + dashboard on :5055
# Frontend (separate terminal)
cd frontend && npm install && npx vite --host 0.0.0.0 --port 6175
# Dashboard at http://localhost:6175iOS support is opt-in and needs a Mac, because Appium uses Xcode's XCUITest/WebDriverAgent stack:
npm install -g appium
appium driver install xcuitest
appium --base-path /
xcrun xctrace list devices
xcrun simctl list devices booted
export GITD_ENABLE_IOS=1
export IOS_DEVICE_UDID="<udid>"
export IOS_APPIUM_URL="http://127.0.0.1:4723"
export IOS_BUNDLE_ID="com.google.chrome.ios"
export IOS_MJPEG_SERVER_PORT="9100" # use unique ports per iOS deviceModel credentials live in a .env file in the project root (OPENAI_API_KEY, ANTHROPIC_API_KEY or OPENROUTER_API_KEY), or are avoided entirely with the Claude subscription login or a local Ollama (ollama serve, ollama pull llama3.2:3b).
How do you use this agent?
The shortest integration is wiring the MCP server into an existing client - no clone, no venv:
claude mcp add android-agent -- uvx --from ghost-in-the-droid android-agent-mcp
codex mcp add android-agent -- uvx --from ghost-in-the-droid android-agent-mcpOnce the client has the 66 tools you talk to the phone in natural language (open an app, read the screen, tap an element, run a multi-step flow). You can also drive it straight from the terminal:
ghost "book a table" --device pixel
ghost "check reddit" --device asusCompiled skills are managed through the Skill Hub CLI:
ghost skill search calculator # search the hub registry
ghost skill info ghost/calculator # trust, quality tier, actions, tested-on device
ghost skill install ghost/calculator # hash-checked install into ~/.ghost/skills
ghost skill run ghost/calculator calculate --param expression='1234*5' --device <serial>
ghost skill list
ghost skill outdated
ghost skill validate ./my-skill/
ghost skill submit ./skillhub/<you>/<slug> --pushFor custom code, the FastAPI server publishes OpenAPI docs at /docs on port 5055 and the dashboard talks to it over /api/*; LangChain and LlamaIndex adapters wrap the same tools for framework agents. Multi-device work is queued, scheduled and monitored from the Scheduler and Manual Run tabs.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
FARS trust-control audit
- rollback or recovery path — Back up first, or work on a git branch or snapshot, so its changes can be undone.
What are this agent's strengths and limitations?
- Platform, brain and driver are three independent columns: Android ADB, Wi-Fi ADB, Docker+KVM emulator pools or iPhone WDA on one axis; Claude subscription, Anthropic, OpenRouter, Ollama, vLLM or on-device engines on the second; MCP, LangChain, LlamaIndex, CLI, web dashboard and REST API on the third
- Compiled skills replay deterministic YAML plus Python recipes with zero LLM calls, so repeated tasks cost no tokens - an explicit cost design, not an afterthought
- Zero-app by default: screen reads go through uiautomator and actions through adb shell input, with no root and no accessibility service; the Portal companion app that makes UI reads roughly 30x faster is opt-in
- A genuine on-device inference path - llama.cpp (JNI) and MediaPipe on Android, llama.cpp on Metal and opt-in MLX on iPhone - so the loop keeps working in airplane mode with nothing leaving the device
- One uvx command (claude mcp add or codex mcp add) drops all 66 tools into Claude Code, Codex, Cursor or Windsurf without cloning the repo or building a venv
- iOS is not install-and-go: it needs a Mac, Xcode, Appium 2 with the XCUITest driver, and WDA signing with an Apple development team, plus trust, Developer Mode and UI Automation permission on real devices
- You supply the hardware and the plumbing - a phone with USB debugging, adb on PATH, and a FastAPI server you run yourself; hacking on the UI also means a second Node.js 18+ Vite dev server
- Cross-platform parity is partial: shell, launch_intent, the Portal overlay, wireless ADB and Play Store helpers return stable platform errors on iOS, and skills need both elements.yaml and elements_ios.yaml
- The headline AndroidWorld figure (115 of 116, 99.1%) is labelled a preview with the methodology still unpublished, so it is not yet a citable capability claim
- Adding a new app skill means hand-writing skill.yaml, elements.yaml and Python Action/Workflow classes, or narrating to the LLM-assisted Skill Creator against a live stream
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Ghost in the Droid This agent | 53 · Major gaps | CLIFree + model costs | ★ 439 | 19d ago | Python | Codex · Claude Code · OpenAI API · Claude API |
| FIRERPA Android Control Platform | 56 · Major gaps | Self-hosted serviceFree | ★ 8.8k | 12d ago | Python | Claude.ai · OpenAI API |
| Buddy for Android | 53 · Major gaps | Desktop appFree | ★ 373 | 1d ago | Java | Codex · Claude Code |
| Mobilerun | 65 · Some gaps | CLIFree + model costs | ★ 10k | 1d ago | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
least_privilege: zero-app default, no root, no accessibility service, and a GHOST_MCP_PROFILE=skills-first reduced tool set are real mitigations, but the default surface still exposes shell, launch_intent, force_stop, clipboard and camera, and SECURITY.md itself states the API has no auth and binds 0.0.0.0:5055 — score 1. user_confirmation: SKILL.md and the skill schema require a confirm gate for destructive skills and support human gates (needs_input/run_skill_resume), but the core tap/type_text/shell tools enforce no confirmation, so this is guidance rather than control — score 1. data_flow_transparency: README clearly states local-first, cloud-optional, on-device mode and when prompts leave the network — score 2. sensitive_data_handling: SECURITY.md says API keys are never logged and SKILL.md says not to persist credentials or screen contents, but there is no code-level evidence and screenshots/traces are stored — score 1. dependency_security: dependencies are public PyPI packages and CI pins actions to SHAs, but there is no lockfile/hash pinning and no visible vulnerability scanning — score 1. external_effects: the skill schema declares side_effects/tos_risk, but tap/type can cause arbitrary external effects with no runtime interception — score 1. rollback: no undo or rollback mechanism is present; force_stop is not recovery — score 0. source_attribution: LICENSE, pyproject urls and skill author/generated_with fields are present, though the publisher is unverified — score 2.
self_consistency: README says 66 tools in one place and 'same 62-tool body' in another, and calls the release 1.3 while pyproject says 1.6.0 — score 1. dependency_availability: all dependencies are public PyPI packages with plausible lower bounds, but no lockfile — score 2. failure_messages: the doctor preflight prints fix hints, Android-only tools return stable platform errors on iOS, and TROUBLESHOOTING.md covers common failures — score 2.
audience_and_scenarios: covers MCP clients, LangChain/LlamaIndex, CLI, web dashboard and on-device scenarios — score 2. capability_boundaries: the platform support table spells out Android/iOS differences, Android-only tools return stable errors, and iOS is opt-in via GITD_ENABLE_IOS — score 2. trigger_precision: skills carry ref_prompt and find_skill natural-language matching with concrete trigger phrases — score 2. environment_fit: Python 3.10+, ADB, macOS/Xcode/Appium and Docker+KVM requirements are documented — score 2.
information_architecture: README, docs/, site/ and skillhub/ are clearly layered — score 2. install_notes: uvx/pipx/clone/iOS step-by-step install and an env-var table are present, though '.env.example (if provided)' is slightly vague — score 2. naming_stability: the package ships ghost, android-agent, gitd, ghost-in-the-droid and android-agent-mcp aliases, and the skill layout moved from v1 actions/ to v2 helpers.py — score 1. examples_and_faq: many examples, demo videos and a troubleshooting FAQ — score 2. known_limitations: iOS needs a Mac, Android-only tools are listed, the benchmark is labelled a non-citable preview, and the API is documented as unauthenticated — score 2. license: MIT LICENSE file matches pyproject — score 3. versioning_changelog: a version exists in pyproject but there is no CHANGELOG and the README version disagrees — score 1. maintenance_responsibility: SECURITY.md contact, Discord and Issues exist, but the publisher is unverified — score 1.
output_usability: MCP tools return structured results and skills carry end_state_validator/validator machinery — score 2. marginal_value: gives any LLM agent a real phone surface and zero-token skill replay, a distinct capability — score 2. cost_benefit: skill replay costs zero LLM calls and local-first saves cloud spend, but initial setup (ADB/Appium/WDA signing) is heavy — score 2.
claim_traceability: the AndroidWorld 115/116 benchmark is self-described as 'methodology still cooking' and is not traceable, and the 66-tool count cannot be fully checked from the packet — score 1. cross_source_corroboration: the 66-tool figure is corroborated across README and SKILL.md, but the 62-tool caption and 1.3 vs 1.6.0 mismatch weaken it — score 1. fact_inference_separation: README mixes marketing language with facts; the benchmark is explicitly flagged as a preview (a plus), but the overall fact/inference boundary is blurred — score 1.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- SECURITY.md states the API has no authentication and binds 0.0.0.0:5055; exposing it to a network hands ADB device control to anyone who can reach it — add reverse-proxy auth or bind to localhost before deployment.
- The default tool set includes shell, launch_intent, force_stop, clipboard and camera, and tap/type_text enforce no confirmation; prefer GHOST_MCP_PROFILE=skills-first and restrict the device scope.
- The Skill Hub executes community-submitted Python; controls such as APK sha256 pinning and automatic Tier 3 rejection are still marked [planned] in security.md, so review third-party skills manually before installing.
- There is no rollback or undo mechanism; a mis-tap, mis-sent message or mis-payment cannot be automatically recovered, so rely on human gates and external backups.
- The AndroidWorld 115/116 benchmark is self-described as having unfinished methodology and is not citable; the README also contradicts itself on 66 vs 62 tools and 1.3 vs 1.6.0, so treat marketing numbers with caution.
- Publisher identity is unverified, so maintenance responsibility and the update path cannot be independently confirmed.
FAQ
Do I have to buy an API key?
Does it root the phone or install an accessibility service?
Can it run fully offline?
What happens when a captcha or judgement call blocks the run?
Can iOS be driven without a Mac?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.