Skip to main content
Glama

Simulator MCP

Allows AI to control iOS simulators via the MCP protocol — launch devices, take screenshots, tap, input text, capture network traffic, and mock interfaces.

Feature Overview

Category

Tool

Description

Device Management

list_devices

List all simulators (status, UDID, runtime)

boot_device / shutdown_device

Boot / Shutdown simulator

install_app

Install .app package

launch_app

Launch APP (supports proxy=true for network interception injection)

open_url

Open URL or deep link (automatically selects a booted simulator)

Screenshots

take_screenshot

Take a screenshot and return it to AI as a base64 image (supports visual analysis)

UI Interaction

tap

Tap specific iOS coordinates (supports long press via duration)

swipe

Swipe from start point to end point

input_text

Input text into the currently focused input field

press_button

Press hardware buttons (home / lock / siri)

get_ui_hierarchy

Get UI accessibility tree (JSON format)

tap_element

Match element by text and tap its center coordinates

Network Interception

start_network_proxy

Start mitmproxy (default port 8080)

stop_network_proxy

Stop proxy

get_network_log

View captured traffic (supports URL and method filtering)

add_mock_rule

Add mock rule (URL regex matching)

remove_mock_rule

Remove mock rule

A total of 18 tools, covering device management, UI automation, and network interception scenarios.

Related MCP server: Shotter

Prerequisites

Dependency

Purpose

Installation

Xcode

Provides xcrun simctl command

Mac App Store

idb-companion

Native daemon for fb-idb (UI automation)

brew install idb-companion

Python >= 3.11

Runtime

brew install python@3.11 or higher

uv (Recommended)

Package management

brew install uv

The proxy-dylib/libproxy_inject.dylib included in this repository is an arm64 pre-compiled artifact; Intel Mac users need to recompile for x86_64 or a universal version themselves.

Installation

cd simulator-mcp

# 方式一:uv(推荐)
uv venv && uv pip install -e .

# 方式二:pip
python -m venv .venv && source .venv/bin/activate && pip install -e .

Python dependencies (auto-installed):

  • mcp >= 1.0 — MCP protocol SDK (stdio JSON-RPC)

  • mitmproxy >= 10.0 — HTTP(S) proxy

  • fb-idb — iOS simulator UI automation

Configure for Claude Code

Add to mcpServers in ~/.claude.json:

{
  "mcpServers": {
    "simulator": {
      "command": "/path/to/simulator-mcp/.venv/bin/simulator-mcp"
    }
  }
}

Configure for Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "simulator": {
      "command": "/path/to/simulator-mcp/.venv/bin/simulator-mcp"
    }
  }
}

Replace /path/to/simulator-mcp with the actual absolute path to the project.

Usage Example

Once configured, AI can directly control the simulator:

用户: 打开模拟器,截图看看当前页面
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"

Network Capture Guide

Workflow

  1. Start Proxy: start_network_proxy(port=8080)

    • Automatically starts mitmproxy in a background thread

    • If a simulator is currently booted, it will attempt to install the mitmproxy CA certificate first

  2. Launch APP with Proxy: launch_app(udid="xxx", bundle_id="com.example.app", proxy=true)

    • Injects libproxy_inject.dylib via DYLD_INSERT_LIBRARIES

    • Swizzles NSURLSessionConfiguration to forward all HTTP(S) traffic to the proxy

    • Re-installs the CA certificate on the target simulator to prevent HTTPS capture failure when the proxy starts after the simulator

  3. View/Mock Requests:

    • get_network_log(url_pattern="api/user") — Filter by URL substring

    • add_mock_rule(url_pattern="api/login", response_body="...") — URL regex matching

Technical Principles

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 的分流文件

Project Structure

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 规则引擎: 正则匹配, 首条命中

Recompiling dylib (Optional)

If you modify proxy_inject.m:

cd proxy-dylib
clang -dynamiclib -framework Foundation \
  -arch arm64 -arch x86_64 \
  -o libproxy_inject.dylib \
  proxy_inject.m

Architecture Documentation

Detailed technical architecture design can be found in ARCHITECTURE.md.

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    2
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    An 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.
    3
    MIT

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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