Simulator MCP
Simulator MCP
MCPプロトコルを通じてAIがiOSシミュレーターを操作できるようにします。デバイスの起動、スクリーンショット、タップ、テキスト入力、パケットキャプチャ、APIのモックなどが可能です。
機能概要
分類 | ツール | 説明 |
デバイス管理 |
| 全てのシミュレーターをリストアップ(状態、UDID、ランタイム) |
| シミュレーターの起動 / 終了 | |
| .appパッケージのインストール | |
| アプリの起動( | |
| URLまたはディープリンクを開く(起動中のシミュレーターを自動選択) | |
スクリーンショット |
| スクリーンショットを撮影し、base64画像としてAIに返却(視覚分析をサポート) |
UI操作 |
| 指定したiOS座標をタップ( |
| 始点から終点までスワイプ | |
| 現在フォーカスされている入力フィールドにテキストを入力 | |
| ハードウェアボタンを押す( | |
| UIアクセシビリティツリーを取得(JSON形式) | |
| テキストで要素をマッチングし、その中心座標をタップ | |
ネットワークインターセプト |
| mitmproxyプロキシを起動(デフォルトポート8080) |
| プロキシを停止 | |
| パケットキャプチャログを確認(URL、メソッドによるフィルタリングをサポート) | |
| モックルールを追加(URL正規表現マッチング) | |
| モックルールを削除 |
合計 18個のツール があり、デバイス管理、UI自動化、ネットワークインターセプトの3つの主要シナリオをカバーしています。
Related MCP server: Shotter
前提条件
依存関係 | 用途 | インストール方法 |
Xcode |
| Mac App Store |
idb-companion | fb-idbのネイティブデーモン(UI自動化) |
|
Python >= 3.11 | ランタイム |
|
uv(推奨) | パッケージ管理 |
|
現在のリポジトリに組み込まれている
proxy-dylib/libproxy_inject.dylibはarm64用のプリコンパイル済みバイナリです。Intel Macの場合は、x86_64またはユニバーサルバイナリとして再コンパイルする必要があります。
インストール
cd simulator-mcp
# 方式一:uv(推荐)
uv venv && uv pip install -e .
# 方式二:pip
python -m venv .venv && source .venv/bin/activate && pip install -e .Pythonの依存関係(自動インストール):
mcp >= 1.0— MCPプロトコル SDK(stdio JSON-RPC)mitmproxy >= 10.0— HTTP(S) プロキシfb-idb— iOSシミュレーターUI自動化
Claude Codeへの設定
~/.claude.json の mcpServers に以下を追加します:
{
"mcpServers": {
"simulator": {
"command": "/path/to/simulator-mcp/.venv/bin/simulator-mcp"
}
}
}Claude Desktopへの設定
~/Library/Application Support/Claude/claude_desktop_config.json に以下を追加します:
{
"mcpServers": {
"simulator": {
"command": "/path/to/simulator-mcp/.venv/bin/simulator-mcp"
}
}
}
/path/to/simulator-mcpを実際のプロジェクトの絶対パスに置き換えてください。
使用例
設定完了後、AIは直接シミュレーターを操作できます:
用户: 打开模拟器,截图看看当前页面
AI: 调用 list_devices → boot_device → take_screenshot
"当前页面显示的是 iOS 主屏幕..."
用户: 打开微博,点击注册按钮
AI: 调用 launch_app → take_screenshot → tap_element(text="注册")
"已点击注册按钮,进入了注册页面"
用户: 抓包看看注册接口返回了什么
AI: 调用 start_network_proxy → launch_app(proxy=true) → get_network_log(url_pattern="register")
"注册接口返回了 200,响应体是..."
用户: Mock 掉登录接口,返回自定义数据
AI: 调用 add_mock_rule(url_pattern="api/login", response_body='{"token":"fake"}')
"已添加 Mock 规则 mock_1"ネットワークキャプチャに関する説明
使用フロー
プロキシの起動:
start_network_proxy(port=8080)バックグラウンドスレッドでmitmproxyを自動起動します。
現在起動中のシミュレーターがある場合、mitmproxy CA証明書のインストールを試みます。
プロキシ経由でのアプリ起動:
launch_app(udid="xxx", bundle_id="com.example.app", proxy=true)DYLD_INSERT_LIBRARIESを通じてlibproxy_inject.dylibを注入します。NSURLSessionConfigurationをSwizzleし、すべてのHTTP(S)トラフィックをプロキシに転送します。「プロキシを先に起動し、後からシミュレーターを起動する」際にHTTPSキャプチャが失敗するのを防ぐため、対象シミュレーターに対して再度CA証明書のインストールを実行します。
リクエストの確認/モック:
get_network_log(url_pattern="api/user")— URLの部分一致でフィルタリングadd_mock_rule(url_pattern="api/login", response_body="...")— URL正規表現マッチング
技術的原理
App 启动 → dylib 注入 → swizzle NSURLSessionConfiguration
→ 所有 NSURLSession 流量 → mitmproxy (127.0.0.1:8080)
→ MockEngine 检查规则 → 命中则返回假数据 / 未命中则转发真实服务器
→ NetworkLog 记录请求/响应(内存环形缓冲,最多 1000 条)
→ 同时落盘:
- `/tmp/proxy_requests.log`:摘要日志
- `/tmp/proxy_requests.jsonl`:结构化明细日志
- `/tmp/proxy_request_bodies/`:超大 body 的分流文件プロジェクト構造
simulator-mcp/
├── pyproject.toml # 项目配置、依赖、入口定义
├── README.md # 本文件
├── ARCHITECTURE.md # 技术架构详细文档
├── diagrams/ # Mermaid 源文件 + PNG 架构图
├── proxy-dylib/
│ ├── proxy_inject.m # DYLD 注入源码 (Objective-C, 95 行)
│ └── libproxy_inject.dylib # 编译产物 (当前为 arm64)
└── src/simulator_mcp/
├── __init__.py # 入口: main() → asyncio.run(server.main())
├── __main__.py # python -m simulator_mcp 入口
├── server.py # MCP Server: 18 个工具注册 + call_tool 分发
├── simulator/
│ ├── simctl.py # xcrun simctl 异步封装 (设备管理 + 截图)
│ └── idb_client.py # fb-idb 异步封装 (UI 交互 + tap_element)
├── tools/
│ ├── device.py # 设备管理工具 (参数解析 + proxy 注入逻辑)
│ ├── screenshot.py # 截图工具 (PNG → base64)
│ ├── ui.py # UI 交互工具 (参数解析 → idb_client)
│ └── network.py # 网络工具 (参数解析 → proxy_server)
└── proxy/
├── proxy_server.py # mitmproxy 生命周期 + ProxyAddon + CA 证书安装
├── network_log.py # 请求日志: 内存环形缓冲 + 结构化落盘
└── mock_engine.py # Mock 规则引擎: 正则匹配, 首条命中dylibの再コンパイル(オプション)
proxy_inject.m を変更した場合:
cd proxy-dylib
clang -dynamiclib -framework Foundation \
-arch arm64 -arch x86_64 \
-o libproxy_inject.dylib \
proxy_inject.mアーキテクチャドキュメント
詳細な技術アーキテクチャ設計については ARCHITECTURE.md を参照してください。
This server cannot be installed
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
- AlicenseAqualityAmaintenanceEnables interaction with iOS simulators by providing tools to inspect UI elements, control UI interactions, and manage simulators through natural language commands.179,7002,136MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to automate iOS Simulator interactions including device management, UI element interaction (tap, swipe, type), screenshot capture, and execution of YAML-defined navigation workflows.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive control of iOS simulators and real devices through AI assistants, supporting app management, UI automation, screenshots, media operations, and location simulation for iOS development and testing workflows.5MIT
- AlicenseNot gradedqualityFmaintenanceAn MCP server that provides comprehensive tools for managing iOS simulators, including device control, app lifecycle management, and UI automation. It enables developers to boot devices, install apps, capture screenshots, and simulate user interactions through natural language commands.3MIT
Related MCP Connectors
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Live browser debugging for AI assistants — DOM, console, network via MCP.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
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/992429169/simulator-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server