ios-agent-driver

ios-agent-driver

An MCP server that lets an AI agent drive the iOS Simulator in a loop, enabling tapping, typing, swiping, reading the screen via the accessibility tree, and verifying app state.

Category
访问服务器

README

ios-agent-driver

An MCP server that lets an AI agent drive the iOS Simulator in a loop — so an agent can actually use your app: tap, type, swipe, read the screen, and verify what happened.

It bridges the gap between iOS development and agentic testing. The primitives to control a simulator exist (xcrun simctl, Meta's idb), but nothing packages them into tools an agent can call to close the perceive → decide → act → observe loop. This does.

  • Accessibility-tree-first perception. The agent reasons over labeled UI elements (describe_ui) and taps by label, not by guessing pixel coordinates — far more robust to layout changes.
  • Screenshot fallback. For custom-drawn views that don't expose accessibility, screenshot gives a vision fallback and a way to verify state.
  • Loud failures. A tap on a missing label returns the nearest labels on screen, not a silent no-op.

How it works

Agent (Claude / any MCP client)
   goal: "log a leg workout, confirm it appears in History"
        observe → decide → act → observe  (loop)
        │  MCP (stdio)
   ios-agent-driver
        │                         │
   xcrun simctl              idb (+ companion)
   lifecycle, screenshots    accessibility tree,
   deeplinks, permissions    tap / type / swipe by element

Requirements

  • macOS with Xcode (provides xcrun simctl)
  • idb for UI perception and actions:
    brew tap facebook/fb && brew trust facebook/fb
    brew install facebook/fb/idb-companion   # source build — needs current Xcode Command Line Tools
    pip3 install fb-idb                       # the `idb` CLI; use pipx/venv if pip is externally-managed
    idb list-targets                          # confirm it sees your booted sim
    
    If the companion build errors with “Command Line Tools are too outdated”, update them (System Settings › Software Update, or xcode-select --install). Lifecycle tools work without idb; describe_ui / tap / type_text / swipe require it and will tell you how to install it if it's missing.
  • Node.js ≥ 18

Install

git clone https://github.com/CodeJonesW/ios-agent-driver.git
cd ios-agent-driver
npm install      # builds via the prepare script

Register with Claude Code

Add to your MCP config (user-level ~/.claude.json, or a project .mcp.json):

{
  "mcpServers": {
    "ios-agent-driver": {
      "command": "node",
      "args": ["/absolute/path/to/ios-agent-driver/dist/server.js"]
    }
  }
}

Or with the Claude Code CLI:

claude mcp add ios-agent-driver -- node /absolute/path/to/ios-agent-driver/dist/server.js

Tools

Tool Backend Purpose
list_sims simctl List devices (udid, name, state, runtime).
boot_sim simctl Boot a sim (defaults to booted, else first iPhone).
install_app simctl Install a built .app bundle.
launch simctl Launch an app by bundle id.
terminate simctl Terminate a running app.
reset_app simctl Uninstall + reinstall for a clean state.
deeplink simctl Open a URL / universal link.
set_permission simctl Grant/revoke/reset a privacy permission.
describe_ui idb Primary perception — accessibility tree as JSON.
screenshot simctl PNG of the current screen (vision fallback).
tap idb Tap by accessibility label (preferred) or x,y.
type_text idb Type into the focused field.
swipe idb Swipe/scroll by direction or coordinates.
press_button idb Hardware buttons (HOME, LOCK, …).

The loop, by example

A typical agent goal runs as a bounded loop:

GOAL: "open Settings and confirm Notifications is enabled"
1. boot_sim
2. launch { bundle_id: "com.apple.Preferences" }
3. describe_ui            → see "Notifications" cell
4. tap { label: "Notifications" }
5. describe_ui            → assert the toggle state
   (re-read after each action; stop when the goal predicate holds
    or a step budget is exhausted)

The agent owns the loop and the success predicate; this server provides the primitives. That keeps the tool simple and the test logic where it belongs.

Development

npm run build     # compile TypeScript → dist/
npm start         # run the server on stdio

License

MIT © Will Jones (CodeJonesW)

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选