mcp-server-ios-simulator
by: atom2ueki
Model Context Protocol (MCP) implementation for iOS simulators
πOverview
Purpose: To provide a standardized communication layer between iOS simulators and the Model Context Protocol (MCP), enabling programmatic control of simulators.
Overview: This framework is designed to bridge the gap between iOS simulators and the MCP, utilizing the appium-ios-simulator and MCP TypeScript SDK. By leveraging stdio for communication, it allows seamless integration with MCP-compatible clients, such as Claude Desktop.
Key Features:
- Simulator Management: Start, stop, and manage multiple iOS simulator instances easily.
- Application Control: Install, launch, and terminate applications on simulators, with capabilities to take screenshots and perform user interactions.
π± MCP Server for iOS Simulator
A server that implements the Model Context Protocol (MCP) for iOS simulators, built on top of appium-ios-simulator and utilizing the MCP TypeScript SDK.
π Overview
This project provides a bridge between iOS simulators and the Model Context Protocol, enabling standardized communication and programmatic control of iOS simulators. It uses stdio as its transport mechanism, making it ideal for integration with Claude Desktop and other MCP-compatible clients.
ποΈ Architecture
The server consists of three main components:
- Simulator Management Layer - Handles iOS simulator lifecycle and interactions
- MCP Protocol Implementation - Implements the Model Context Protocol using the TypeScript SDK with stdio transport
- Logger Component - Provides file-based logging without interfering with the stdio transport
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β MCP Protocol β β Stdio β β Simulator β
β Implementation βββββββ€ Transport βββββββ€ Management β
β β β β β Layer β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β² β²
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β MCP Client β β iOS Simulator β
β (e.g. Claude) β β β
βββββββββββββββββββ βββββββββββββββββββ
β¨ Features
- Start, stop, and manage iOS simulator instances
- Boot and shutdown simulators
- Install and launch applications on simulators
- Take screenshots of simulator screens
- Perform taps on coordinates
- Support for multiple concurrent simulator sessions
- Comprehensive file-based logging without console output
- Error-resilient operation
π Prerequisites
- Node.js (v16 or later)
- macOS (required for iOS simulators)
- Xcode with iOS simulators installed
- TypeScript 4.5+
π§ Installation
# Clone the repository
git clone https://github.com/atom2ueki/mcp-server-ios-simulator.git
cd mcp-server-ios-simulator
# Install dependencies
npm install
βοΈ Configuration
Configure via the src/config.ts
file:
const config = {
simulator: {
defaultDevice: process.env.SIMULATOR_DEFAULT_DEVICE || 'iPhone 16',
defaultOS: process.env.SIMULATOR_DEFAULT_OS || '18.2',
timeout: parseInt(process.env.SIMULATOR_TIMEOUT || '30000', 10),
}
};
Set environment variables to customize:
SIMULATOR_DEFAULT_DEVICE=iPhone 16
SIMULATOR_DEFAULT_OS=18.2
SIMULATOR_TIMEOUT=30000
π Usage
Building and Starting the Server
# Build the project
npm run build
# Start the server
npm start
MCP Tools
The server offers two approaches for controlling iOS simulators:
Direct Simulator Management (Recommended)
Works directly with simulator UDIDs, no sessions needed:
list-available-simulators
β List all available simulators with UDIDsboot-simulator-by-udid
β Boot a simulator using its UDIDshutdown-simulator-by-udid
β Shutdown a simulator using its UDIDlist-booted-simulators
β List all currently booted simulators
Use this to boot, use, and shut down simulators directly.
Session-Based Management (Advanced)
Uses a session layer with custom session IDs:
list-simulator-sessions
β List all active sessionscreate-simulator-session
β Create a new sessionterminate-simulator-session
β Terminate a session (shuts down and cleans up)create-and-boot-simulator
β Create session and boot itboot-simulator
β Boot simulator for a sessionshutdown-simulator
β Shutdown simulator for a session
Use this when tracking metadata or managing simulators by custom IDs.
Application Management
install-app
β Install an app on a simulatorlaunch-app
β Launch an app on a simulatorterminate-app
β Terminate a running app on a simulator
Interaction Tools
take-screenshot
β Take a screenshot of the simulator screentap-coordinate
β Perform a tap at specified coordinates
Example Usage with Claude Desktop
- Configure Claude Desktop with this server as an MCP tool, specifying the command and path to
dist/index.js
. - Control iOS simulators directly from Claude Desktop via:
Direct UDID Approach (Recommended):
- "Show me all available iOS simulators"
- "Boot the iOS simulator with UDID
" - "Shut down the simulator with UDID
"
Session-Based Approach (Advanced):
- "Create a new simulator session for iPhone 16 Pro with iOS 18.2"
- "Boot the simulator for session
" - "Take a screenshot of the simulator for session
" - "Terminate the simulator session
"
π¨βπ» Development
Project Structure
src/
βββ simulator/ # Simulator management layer
βββ mcp/ # MCP protocol implementation
βββ bridge/ # Bridge component
βββ utils/ # Utility functions including logger
βββ config.ts # Configuration handling
βββ index.ts # Entry point
Building the Project
# Install dependencies
npm install
# Build
npm run build
π License
This project is licensed under the MIT License.
π Acknowledgments
- appium-ios-simulator for iOS simulator interaction
- Model Context Protocol for protocol and SDK