lunatap
Enables AI agents to test and explore iOS apps on simulators or real iPhones/iPads, including screen observation, taps/typing/assertions, log and network capture, flow recording/replay, walkthrough videos, and autonomous task execution.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Lunatap
An AI agent that tests iOS apps. Point it at an iOS simulator or a real iPhone. Your AI IDE (Claude Code, Cursor, Codex) can then explore the app, reproduce bugs, check screens, and record flows that you replay on the next build. Or hand Lunatap a goal in plain English, and its own agent runs the task from start to finish.
uv run lunatap run "Open Settings, go to General > About, and report the iOS version" \
--platform ios --standalone --device-serial <SIMULATOR-UDID>Status: early (0.1.0). iOS only, macOS only. Lunatap is a fork of Artemis by Google, narrowed to iOS. It is an independent project, not affiliated with or endorsed by Google. See NOTICE.
Contents
Related MCP server: Mobile Pilot MCP
What you can do with it
You want to… | Use |
Explore an app, reproduce a bug, or check a screen while your IDE agent steers | Harness tools over MCP: |
See why a step failed |
|
Retest the same path on every build |
|
Show someone how the app works |
|
Hand off a whole task |
|
It works on:
Simulators: Xcode 15–26 through WebDriverAgent, and Xcode 27 through Apple's own device tools.
Real iPhones and iPads over the CoreDevice tunnel, through a WebDriverAgent runner you sign with your Apple team. A free personal team works.
The agent only taps what is actually visible. Elements hidden behind iOS 26 floating bars or scrolled off screen are not offered, and a tap is refused if the screen moved since the agent last looked.
Install
You need macOS with Xcode 15 or later, Python 3.12+, and uv.
git clone https://github.com/parvej-flight/lunatap.git && cd lunatap
uv sync --dev
bash scripts/setup_ios_env.sh # checks Xcode, simulators and paired devices
bash scripts/setup_ios_wda_simulator.sh # Xcode 15–26 only: builds WebDriverAgent once
uv run lunatap doctor # confirms everything is readyConnect it to your AI IDE:
uv run lunatap mcp --install claude # or: cursor, codex, windsurf, vscode, cline, roo, antigravity, allThis adds the lunatap MCP server and its usage rules to the IDE. Restart or reconnect the IDE's MCP servers afterwards.
The harness tools need no model key: your IDE's agent is the brain. The autonomous agent (example 6) needs one in .env. See Models.
Find a simulator's UDID with xcrun simctl list devices booted. If only one simulator is booted, you can leave the UDID out everywhere.
Examples
1. Explore an app from your AI IDE
Ask your IDE agent in plain language:
Open the Settings app on the booted simulator, go to General > About, and tell me the iOS version.
The agent drives the device through the harness tools. A typical sequence of calls:
mobile_observe() # numbered list of what's on screen + page title
mobile_act(action="open_app", app="Settings")
mobile_act(action="tap", target="General") # by visible text…
mobile_act(action="tap", target=7) # …or by element index from the last observation
mobile_assert(text="iOS Version", state="present")
mobile_release_device() # free the device when doneEvery mobile_act reply already contains the new screen, so the agent rarely needs a separate observe. Other actions are type, swipe, long_press, press_key (HOME, ENTER, …), open_link, wait, and alert (presses a system alert button such as "Allow While Using App"). mobile_do_step("Open General settings") lets Lunatap resolve and verify a simple step on its own.
2. Reproduce a bug with logs and network evidence
Start capturing logs and network for com.example.shop, add an item to the cart and check out. Tell me what the server said when checkout failed.
mobile_logs(action="start", bundle_id="com.example.shop")
mobile_net(action="start") # runs mitmproxy; the reply has the one-time phone proxy setup
mobile_act(action="open_app", app="com.example.shop")
mobile_act(action="tap", target="Add to cart")
mobile_act(action="tap", target="Checkout") # the reply counts this step's log lines and requests
mobile_logs(action="read", since_step=3, grep="error|403")
mobile_net(action="read", since_step=3, failed_only=True) # the failing call and the server's reason
mobile_net(action="read", host="api.example.com", summary=True) # endpoints, with ids collapsedEach step reports how many log lines and requests it caused, so a failing step comes with its own evidence. Network capture needs brew install mitmproxy. Setting the proxy and trusting the certificate on the phone is a one-time step for a person, which the agent relays to you.
3. Record a flow and replay it in CI
Record a flow called "login": sign in with the test account and check that the home screen says "Welcome back".
mobile_flow(action="record", name="login")
mobile_act(action="open_app", app="com.example.shop")
mobile_act(action="tap", target="Sign in")
mobile_act(action="type", target="Email", text="qa@example.com")
mobile_act(action="type", target="Password", text="••••••••")
mobile_act(action="tap", target="Continue")
mobile_assert(text="Welcome back")
mobile_flow(action="save")Replay it later, from the IDE with mobile_flow(action="run", name="login"), or from a terminal or CI job:
uv run lunatap flow list
uv run lunatap flow run login --device-serial <UDID>
uv run lunatap flow run flows/ # every flow in a folder; exits 1 on the first failureA replay checks the screen titles it recorded. A step that lands on the wrong screen fails, and a check that failed while recording is not saved. Flows are JSON files kept in flows/; set LUNATAP_FLOWS_DIR to keep them in your app's repository.
4. Make a walkthrough video to share
Make a walkthrough of signing up and creating a first project.
mobile_walkthrough(action="start", name="Sign up and create a project")
mobile_act(action="tap", target="Get started")
mobile_walkthrough(action="caption", text="Start from the welcome screen") # optional: reword the last step
mobile_act(action="type", target="Email", text="new@example.com")
mobile_act(action="tap", target="Create project")
mobile_walkthrough(action="stop")stop returns a folder (under walkthroughs/, or $LUNATAP_WALKTHROUGHS_DIR) containing:
walkthrough.mp4: the screen recording with a caption for each step, with idle stretches cut;a screenshot for each step;
steps.md: the steps as text, for docs or a ticket.
Waits and steps that changed nothing are left out of the video, but any detour you take while recording is in it. Walkthroughs currently record simulators only.
5. Tap pins on a map
Map pins and other custom-drawn views are not in the accessibility tree. Ask for them explicitly:
mobile_observe(detect="markers")
# adds Marker elements such as "grey pin (100%)", "green icon (90%)", "cluster of 57+ grey pins (76%)"
mobile_act(action="tap", target=41) # tap one by its indexEach marker has a confidence and a kind:
pin: a plain disc;icon: a symbol inside, such as a park or restaurant point of interest;cluster of N+: touching pins.N+is a lower bound, because pins hide under each other.
On satellite imagery the reply says so, and confidences deserve less trust there. Confirm with mobile_observe(screenshot=True).
6. Run a whole task unattended
Give Lunatap's own agent a goal, and it plans, acts and reports without you steering it. This needs a model key in .env (see Models).
# Flash: one model in a fast observe→act loop, a few seconds per step
uv run lunatap run "Turn on Dark Mode in Settings and confirm it is on" \
--platform ios --standalone --device-serial <UDID> --profile flash
# Pro: keeps a written plan, checks each action before it runs, verifies checkpoints
uv run lunatap run "Create an account with a fresh email, then log out and log back in" \
--platform ios --standalone --device-serial <UDID> --profile proFrom an IDE the same thing is mobile_run_task(task_desc="…", model="Flash"), which you follow with mobile_manage_task. Every run saves a trace with screenshots and a screen recording. Browse traces with uv run lunatap ui, a web console on port 8000, or uv run lunatap trace.
Use Flash for short, direct tasks. Use Pro when the task needs a persistent plan, verified checkpoints, or a written report.
7. Use it from Python
import asyncio
from lunatap.sdk import Agent
from lunatap.sdk.builders import AgentConfigBuilder
async def main():
agent = Agent(config=AgentConfigBuilder().for_ios_device("<SIMULATOR-UDID>").build())
try:
await agent.init()
result = await agent.run_task(goal="Open Settings and report the iOS version", profile="flash")
print(result)
finally:
await agent.clean()
asyncio.run(main())To submit tasks to Lunatap running on another Mac, use the dependency-free client in packages/artemis-client.
Models
Only the autonomous agent (example 6) and Lunatap's internal summarizers call a model. Copy .env.example to .env and choose one setup:
Setup |
|
Gemini (default) |
|
OpenAI |
|
Any OpenAI-compatible server (OpenRouter, LM Studio, vLLM, LiteLLM, …) |
|
Ollama on this machine |
|
Anthropic |
|
LUNATAP_LLM_MODELandLUNATAP_LLM_FALLBACK_MODELoverride any preset.Settings that name a single model also accept
"provider/model", for example"openai/gpt-5.4-nano".Whichever model you use must accept images and support tool calling.
Three features are tied to Gemini:
Google Search grounding is skipped on other providers.
On other providers, video analysis works from extracted keyframes.
Audio analysis hasn't been verified on other providers.
Real iPhones
Pair the phone in Xcode and turn on Developer Mode.
Build and sign the WebDriverAgent runner with your team (see the iOS guide).
On the phone, trust the developer certificate under Settings > General > VPN & Device Management.
Pass the phone's UDID explicitly. Lunatap never picks a physical device on its own.
A free team's signature expires every 7 days. mobile_diagnose (or uv run lunatap doctor) detects this and prints the exact command to re-sign. The iOS guide covers the simulator backends, first-run Xcode approval and the limits.
How it works
AI IDE (Claude Code, Cursor, …) CLI · Python SDK · web console
│ MCP │
harness tools: you steer autonomous agent: Lunatap steers
observe · act · assert · Flash: observe→act loop
logs · net · flow · walkthrough Pro: plan → safety check → act → verify
└───────────────┬──────────────────┘
iOS drivers (lunatap/drivers/ios)
WebDriverAgent (simulators on Xcode 15–26, real devices)
Xcode device tools (simulators on Xcode 27)Each observation combines the accessibility tree with on-device OCR (Apple Vision) into one numbered element list. Before a tap, Lunatap checks that the target is still where it was.
Map markers come from a shape detector that runs on the screenshot.
Every run keeps a trace in
traces/, with screenshots, actions and a screen recording.
The architecture notes for contributors are in CLAUDE.md.
Troubleshooting
Run uv run lunatap doctor, or ask your IDE agent to call mobile_diagnose. Either one checks Python, the config, model keys, the device and WebDriverAgent signing, and lists the fixes in order. mobile_diagnose(attempt_fix=true) also clears stale device locks. Common cases are covered in the iOS guide.
Development
make test # hermetic unit tests: no device or model key needed
make lint # ruff + quality ratchet
make typecheck # pyright
make test-device # end-to-end tests on a booted simulator or paired deviceSee CONTRIBUTING.md. Report security issues privately as described in SECURITY.md.
Roadmap
In 0.1
iOS-only codebase: the Android drivers, tooling and prompts are removed.
Simulators (Xcode 15–27) and real iPhones and iPads.
Harness MCP tools: observe/act with a pixel check before each tap, assertions, alerts, and per-step logs and network capture.
Recorded flows with CLI replay, captioned walkthrough videos, and map-marker detection.
An autonomous Flash or Pro agent on Gemini, OpenAI, OpenAI-compatible servers or Ollama.
Next
Install without cloning. Publish to PyPI so that
uvx lunatap mcp --install claudeworks from anywhere.Device setup in one command. Sign, install and trust WebDriverAgent on a phone; renew free-team signatures before the 7 days run out; configure the phone proxy for network capture.
CI template. A GitHub Actions workflow for macOS runners that boots a simulator, installs a build and replays
flows/, with JUnit output and screenshots of failures.Export flows as XCUITest. Turn a recorded flow into a native Swift UI test that you can keep in the app's repository.
Walkthroughs on real devices, plus vertical and GIF outputs for sharing.
Finish the rename. Retire the remaining Artemis names (
config/artemis.jsonc,~/.artemis,artemis-client) behind aliases for the old ones.
Later
Simulator pools for running flows in parallel.
Better map markers: tell icons from pins on grey markers, and read clusters' own count badges.
Visual diffs between builds: flag screens that changed since the last good run.
Ideas and pull requests are welcome. Open an issue.
Credits
Built on Artemis by Google LLC (Apache 2.0).
The initial iOS support comes from google/artemis#175 by banggaoo.
Includes code from Mobile-Use by Minitap, Inc. (Apache 2.0).
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Let your AI agent control real iPhones: screenshots, tap, swipe, type and open apps.
Cloud iPhone Simulators for AI agents: build the Xcode project, read the screen, tap by label, test.
Cloud iPhones and Macs with Xcode for AI agents: build, run and test iOS apps, use the screen.
Build, run, and inspect iOS apps in disposable hosted Simulators from cloud coding agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control real iPhones and simulators on macOS, allowing for UI interaction, testing, and automation.51 npm98MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to control iOS simulators through WebDriverAgent, supporting taps, swipes, typing, screenshots, recording, and app actions with a real-time dashboard for visual feedback.36Apache 2.0
- AlicenseNot gradedqualityDmaintenanceGives AI agents the ability to interact with iOS simulators through 21+ tools for mobile app testing.10,447 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to inspect and verify mobile UI hierarchies, nodes, styles, screenshots, and runtime attributes of iOS apps in simulators or on USB devices.2Apache 2.0