MCP Server for iOS Simulator

MCP Server for iOS Simulator

Enables LLM-powered natural language control of iOS simulators.

275
Stars
23
Forks
275
Watchers
5
Issues
MCP Server for iOS Simulator provides a protocol-compliant bridge between large language models and iOS simulators, allowing seamless control via natural language commands. It offers comprehensive simulator management, application lifecycle handling, advanced UI interaction, and extensive debugging capabilities. Designed for macOS, the server integrates directly with existing MCP ecosystems, supporting development, testing, and automation workflows.

Key Features

Create and manage iOS simulator sessions
Install, launch, terminate, and uninstall iOS applications
Interact with the simulator UI using natural language
Capture screenshots and system logs
Monitor and manage simulator and app states
Execute actions like taps, swipes, and text input
Record videos of UI interactions
Simulate device features such as location and media injection
Handle app permissions and configurations
Integration with LLM assistants for automated workflows

Use Cases

Automating iOS app testing using large language models
Managing and controlling iOS simulators via natural language
Performing UI testing and validation with LLM-driven commands
Capturing device logs, screenshots, and videos for QA purposes
Debugging iOS applications in a simulated environment
Simulating user actions and interactions for app demonstrations
Managing app installations in CI/CD pipelines
Testing location-based app features with simulated GPS data
Handling app permissions and settings programmatically
Injecting media and managing device databases for comprehensive testing

README

๐Ÿ“ฑ MCP Server for iOS Simulator

MCP Server

A Model Context Protocol (MCP) server that enables LLMs to interact with iOS simulators through natural language commands.

โ„น๏ธ Overview

This MCP server provides a bridge between Large Language Models (LLMs) and iOS simulators, offering comprehensive control through natural language commands. Here's what it can do:

For detailed usage, see the Installation guide and Supported Commands sections. You can use this server either through direct MCP integration or as a standalone library.

Check out the Architecture section to understand how the components work together to enable natural language control of iOS simulators.

demo

๐ŸŽฎ Simulator Control

  • Create and manage simulator sessions
  • Boot, shutdown, and monitor simulator states
  • List available and running simulators
  • Focus simulator windows

๐Ÿ“ฑ Application Management

  • Install and manage iOS applications
  • Launch, terminate, and uninstall apps
  • Monitor app states and verify installations
  • Handle app permissions and configurations

๐Ÿ–ฑ๏ธ UI Interaction & Testing

  • Interact with the simulator UI
  • Execute tap, swipe, and button press actions
  • Input text and key sequences
  • Access accessibility elements for UI testing
  • Record videos of UI interactions

๐Ÿ› ๏ธ Development & Debugging

  • Capture screenshots and system logs
  • Debug applications in real-time
  • Monitor and analyze crash logs
  • Install dynamic libraries and manage app data

โšก Advanced Features

  • Additional functionality includes:
    • Location simulation
    • Media injection
    • URL scheme handling
    • Contact database management
    • Keychain operations

For detailed usage, see the Installation guide and Supported Commands sections. You can use this server either through direct MCP integration or as a standalone library.

Check out the Architecture section to understand how the components work together to enable natural language control of iOS simulators.

๐Ÿ“‹ Requirements

  • macOS: Required for iOS simulator support
  • Node.js: v14.0.0 or higher
  • Homebrew: Required for installing dependencies
  • XCode: With iOS simulators installed

๐Ÿš€ Installation

The easiest way to install this server is through Cline:

  1. Simply ask Cline:
Add this mcp to cline https://github.com/InditexTech/mcp-server-simulator-ios-idb
  1. Cline will handle the installation process automatically, including dependency management and configuration.

Alternatively, you can install it manually:

bash
# Clone the repository
git clone https://github.com/InditexTech/mcp-server-simulator-ios-idb.git
cd mcp-server-simulator-ios-idb

# Create and activate Python virtual environment
python3 -m venv venv
source venv/bin/activate  # On Unix/macOS

# Install dependencies
npm install

# Build the project
npm run build

# Start the project
npm start

# Run tests
npm test

The installation process will automatically:

  1. Check if you're running macOS
  2. Install idb-companion via Homebrew
  3. Install fb-idb via pip in the virtual environment

Note: Make sure to keep the virtual environment activated while using the server. If you close your terminal and come back later, you'll need to reactivate the virtual environment with the source venv/bin/activate command before running npm start.

๐Ÿ”Œ MCP Integration

To use this server with Claude or other LLM assistants:

  1. Add the server to your MCP settings in Claude Desktop:
json
{
  "mcpServers": {
    "ios-simulator": {
      "command": "node",
      "args": ["/path/to/mcp-server-simulator-ios-idb/dist/index.js"],
      "env": {}
    }
  }
}
  1. The LLM can now use natural language commands to control iOS simulators:
create a simulator session with iPhone 14
install app /path/to/my-app.ipa
launch app com.example.myapp
tap at 100, 200
take a screenshot

๐Ÿ“š Usage as a Library

You can also use this package as a library in your own projects:

๐Ÿ”ฐ Basic Usage

typescript
import { createMCPServer } from 'mcp-server-simulator-ios-idb';

async function main() {
  // Create an instance of the MCP server
  const { orchestrator } = createMCPServer();
  
  // Process natural language commands
  
  // Create a simulator session
  const sessionResult = await orchestrator.processInstruction('create session');
  console.log(`Session created: ${sessionResult.data}`);
  
  // Interact with the simulator
  await orchestrator.processInstruction('tap at 100, 200');
  
  // Capture a screenshot
  const screenshotResult = await orchestrator.processInstruction('take screenshot');
  console.log(`Screenshot saved at: ${screenshotResult.data}`);
}

main().catch(console.error);

๐Ÿš€ Advanced Usage

You can also use the individual components directly:

typescript
import { 
  IDBManager, 
  NLParser, 
  MCPOrchestrator,
  ParserToOrchestrator,
  OrchestratorToIDB
} from 'mcp-server-simulator-ios-idb';

// Create instances
const idbManager = new IDBManager();
const parser = new NLParser();
const orchestrator = new MCPOrchestrator(parser, idbManager);

// Use the components directly
const sessionId = await idbManager.createSimulatorSession({
  deviceName: 'iPhone 12',
  platformVersion: '15.0'
});

await idbManager.tap(sessionId, 100, 200);

๐Ÿ—๏ธ Project Structure

mcp-server-simulator-ios-idb/
โ”œโ”€โ”€ src/                      # Source code
โ”‚   โ”œโ”€โ”€ adapters/             # Adapter components
โ”‚   โ”œโ”€โ”€ idb/                  # IDB manager implementation
โ”‚   โ”œโ”€โ”€ mcp/                  # MCP server implementation
โ”‚   โ”œโ”€โ”€ orchestrator/         # Command orchestrator
โ”‚   โ”œโ”€โ”€ parser/              # Natural language parser
โ”‚   โ””โ”€โ”€ index.ts             # Main entry point
โ”œโ”€โ”€ types/                   # TypeScript type definitions
โ”œโ”€โ”€ scripts/                 # Installation scripts
โ”œโ”€โ”€ package.json            # Project configuration
โ””โ”€โ”€ tsconfig.json          # TypeScript configuration

๐ŸŽฏ Supported Commands

The NLParser supports the following natural language commands:

๐ŸŽฎ Simulator Management

Command Description Example
Create session Creates a new simulator session "create session", "create simulator iPhone 12"
Terminate session Terminates the current session "terminate session", "close simulator"
List simulators Lists available simulators "list simulators", "show simulators"
List booted simulators Lists running simulators "list booted simulators", "show running simulators"
Boot simulator Boots a simulator by UDID "boot simulator 5A321B8F-4D85-4267-9F79-2F5C91D142C2"
Shutdown simulator Shuts down a simulator "shutdown simulator 5A321B8F-4D85-4267-9F79-2F5C91D142C2"
Focus simulator Brings simulator window to front "focus simulator", "bring simulator to front"
List simulator sessions Lists active simulator sessions "list simulator sessions", "show active sessions"

๐Ÿ“ฑ App Management

Command Description Example
Install app Installs an app on the simulator "install app /path/to/app.ipa"
Launch app Launches an app on the simulator "launch app com.example.app"
Terminate app Terminates a running app "terminate app com.example.app"
Uninstall app Uninstalls an app "uninstall app com.example.app"
List apps Lists installed applications "list apps", "show installed apps"
Check if app installed Checks if an app is installed "is app com.example.app installed"

๐Ÿ–ฑ๏ธ UI Interaction

Command Description Example
Tap Taps at specific coordinates "tap at 100, 200"
Swipe Performs a swipe gesture "swipe from 100, 200 to 300, 400"
Press button Presses a device button "press button HOME", "press button SIRI"
Input text Types text "input text Hello World"
Press key Presses a key by code "press key 4"
Press key sequence Presses a sequence of keys "press key sequence 4 5 6"

โ™ฟ Accessibility

Command Description Example
Describe elements Lists all accessibility elements "describe all elements", "show accessibility elements"
Describe point Describes element at coordinates "describe point 100, 200", "what's at 150, 300"

๐Ÿ“ธ Capture and Logs

Command Description Example
Take screenshot Captures a screenshot "take screenshot", "capture screen"
Record video Records screen activity "record video /path/output.mp4"
Stop recording Stops video recording "stop recording", "stop video recording"
Get logs Retrieves system or app logs "get logs", "get logs for com.example.app"

๐Ÿ› Debug

Command Description Example
Start debug Starts a debug session "debug app com.example.app", "start debug com.example.app"
Stop debug Stops a debug session "stop debug", "terminate debug session"
Debug status Gets debug session status "debug status", "show debug info"

๐Ÿ’ฅ Crash Logs

Command Description Example
List crash logs Lists available crash logs "list crash logs", "show crash logs"
Show crash log Shows content of a crash log "show crash log crash_2023-01-01"
Delete crash logs Deletes crash logs "delete crash logs", "clear crash logs"

๐Ÿ”ง Additional Commands

Command Description Example
Install dylib Installs a dynamic library "install dylib /path/to/library.dylib"
Open URL Opens a URL in the simulator "open url https://example.com"
Clear keychain Clears the simulator's keychain "clear keychain"
Set location Sets the simulator's location "set location 37.7749, -122.4194"
Add media Adds media to the camera roll "add media /path/to/image.jpg"
Approve permissions Approves app permissions "approve permissions com.example.app photos camera"
Update contacts Updates contacts database "update contacts /path/to/contacts.sqlite"

The interface supports all commands available in the idb CLI tool, providing a comprehensive set of operations for iOS simulator automation.

๐Ÿ” Architecture

The server consists of three main components:

  1. IDBManager: Low-level component that interacts directly with iOS simulators through idb.
  2. NLParser: Component that interprets natural language instructions and converts them into structured commands.
  3. MCPOrchestrator: Central component that coordinates interactions between the parser and the IDBManager.

These components are connected through adapters:

  • ParserToOrchestrator: Converts parser results into orchestrator commands.
  • OrchestratorToIDB: Translates orchestrator commands into IDBManager calls.

๐Ÿ”Œ MCP Integration

To use this server with the Model Context Protocol:

  1. Add the server to your MCP settings:
json
{
  "mcpServers": {
    "ios-simulator": {
      "command": "node",
      "args": ["/path/to/mcp-server-simulator-ios-idb/dist/index.js"],
      "env": {}
    }
  }
}
  1. Connect to the server in your LLM application:
typescript
const result = await useMcpTool({
  serverName: "ios-simulator",
  toolName: "process-instruction",
  arguments: {
    instruction: "create simulator session"
  }
});

๐Ÿ™ Acknowledgments

This project would not be possible without facebook/idb, which provides the underlying iOS simulator control capabilities. We extend our sincere gratitude to the Facebook/Meta team and all contributors to the idb project for creating and maintaining such a powerful and reliable tool.

๐Ÿ“„ License

This tool is available as open source under the terms of the Apache-2.0.

Star History

Star History Chart

Repository Owner

InditexTech
InditexTech

Organization

Repository Details

Language TypeScript
Default Branch main
Size 18,912 KB
Contributors 7
License Apache License 2.0
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
96.1%
JavaScript
2.75%
Shell
1.15%

Topics

claude cline ios macos mcp typescript

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • iOS Simulator MCP Server

    iOS Simulator MCP Server

    Programmatic control of iOS simulators via the Model Context Protocol

    iOS Simulator MCP Server implements the Model Context Protocol (MCP) to provide a standardized interface for managing iOS simulators. It enables users to list simulators, boot or shut them down, install application bundles, and launch apps by bundle ID. By conforming to the MCP specification, it allows seamless integration with tools that require structured simulator management.

    • โญ 46
    • MCP
    • JoshuaRileyDev/simulator-mcp-server
  • iOS Simulator MCP Server

    iOS Simulator MCP Server

    A Model Context Protocol server for controlling and automating iOS simulators.

    Provides a Model Context Protocol (MCP) server that enables interactions with iOS simulators. Allows users to obtain simulator information, automate UI interactions such as tapping, typing, swiping, and retrieve accessibility data. Designed for robust integration with automation, testing, and developer workflows via standardized MCP commands.

    • โญ 1,231
    • MCP
    • joshuayoes/ios-simulator-mcp
  • Mobile MCP

    Mobile MCP

    Platform-agnostic server for scalable mobile automation and development.

    Mobile MCP is a Model Context Protocol (MCP) server that enables scalable automation and interaction with native iOS and Android devices through a unified, platform-independent API. Designed to power agents and LLMs, it supports both simulator/emulator and real device environments, allowing access via structured accessibility snapshots or coordinate-based actions. The server facilitates multi-step user journeys, data extraction, and agent-based frameworks without requiring device-specific expertise.

    • โญ 2,436
    • MCP
    • mobile-next/mobile-mcp
  • Xcode MCP Server

    Xcode MCP Server

    Comprehensive Xcode integration server for AI assistants using the Model Context Protocol.

    Xcode MCP Server provides an MCP-compliant interface for AI agents to interact with Xcode projects on macOS. It supports project management, simulator control, CocoaPods and Swift Package Manager integration, and advanced file and build operations. Enhanced error handling and multi-project support enable seamless automation and context management for complex Xcode workflows.

    • โญ 330
    • MCP
    • r-huijts/xcode-mcp-server
  • ScreenPilot

    ScreenPilot

    Empower LLMs with full device control through screen automation.

    ScreenPilot provides an MCP server interface to enable large language models to interact with and control graphical user interfaces on a device. It offers a comprehensive toolkit for screen capture, mouse control, keyboard input, scrolling, element detection, and action sequencing. The toolkit is suitable for automation, education, and experimentation, allowing AI agents to perform complex operations on a userโ€™s device.

    • โญ 50
    • MCP
    • Mtehabsim/ScreenPilot
  • App Store Connect MCP Server

    App Store Connect MCP Server

    Conversational AI server for App Store Connect management via MCP

    App Store Connect MCP Server is a Model Context Protocol (MCP) compliant server that enables seamless interaction with Apple's App Store Connect API. It empowers users to manage apps, beta testers, devices, bundle IDs, app metadata, and capabilities through natural language. The server supports secure authentication, real-time analytics, and localization management, streamlining development, DevOps, and product workflows.

    • โญ 139
    • MCP
    • JoshuaRileyDev/app-store-connect-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results