MCP iOS Simulator Screenshot

MIT License
  • Apple

Integrations

  • Captures screenshots from iOS Simulator devices and saves them to a specified directory with options for output filename, directory, image resizing, and selecting specific simulator devices.

  • Runs on macOS to capture iOS Simulator screenshots, requiring macOS as the underlying operating system to access the iOS Simulator environment.

  • Leverages Xcode Command Line Tools to interact with iOS Simulator devices and capture screenshots through the xcrun simctl command.

MCP iOS Simulator Screenshot

A server that captures screenshots from iOS Simulator using the Model Context Protocol (MCP).

Overview

This project implements an MCP protocol server that captures the current screen of the iOS Simulator and saves it to a specified directory.

Setup

  1. Installation:
# Global installation npm install -g mcp-ios-simulator-screenshot # Or, install in your project npm install mcp-ios-simulator-screenshot # Or, clone from repository git clone https://github.com/yorifuji/mcp-ios-simulator-screenshot.git cd mcp-ios-simulator-screenshot npm install npm run build
  1. MCP Client Configuration:

Add the server information to your MCP client configuration file as follows:

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "mcp-ios-simulator-screenshot" } } }

Environment Variables

This server does not use environment variables.

Command Line Arguments

This server does not use command line arguments.

Advanced Configuration

MCP Client Configuration by Installation Method

When Installed Globally

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "mcp-ios-simulator-screenshot" } } }

When Installed Locally

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "node", "args": [ "/path/to/node_modules/mcp-ios-simulator-screenshot/build/index.js" ] } } }

When Cloned from Repository

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "node", "args": ["/path/to/mcp-ios-simulator-screenshot/build/index.js"] } } }

When Using npx

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "npx", "args": ["mcp-ios-simulator-screenshot"] } } }

When Using Docker

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "docker", "args": ["run", "-i", "mcp-ios-simulator-screenshot"] } } }

Troubleshooting

  • If you cannot capture screenshots:
    • Check if iOS Simulator is running
    • Check if Xcode Command Line Tools are installed
    • Check if the xcrun simctl io booted screenshot command can be executed directly
  • If permission errors occur:
    • Check if you have write permissions for the output directory

Project Structure

./ ├── src/ │ ├── index.ts # Entry point │ ├── config.ts # Configuration │ ├── types.ts # Type definitions │ └── services/ │ └── screenshot-service.ts # Screenshot service ├── build/ # Build output ├── .screenshots/ # Default output directory └── package.json # Project configuration

Tools

get_ios_simulator_screenshot

Captures a screenshot from the iOS Simulator and saves it to the specified directory.

Parameters

Parameter NameTypeDescriptionDefault Value
output_filenamestringOutput filenamesimulator_[timestamp].png
output_directorystringOutput directory.screenshots
resizebooleanWhether to resize the imagetrue
max_widthintegerMaximum width for resizing (pixels)640
device_idstringSpecify a simulator device (e.g., iPhone15,2)Booted device (booted)

Output Format

On success:

{ "success": true, "message": "iOS Simulator screenshot saved successfully", "filePath": ".screenshots/simulator_2025-04-10T16-51-16-755Z.png", "metadata": { "width": 1170, "height": 2532, "format": "png", "size": 382946, "timestamp": "2025-04-10T16:51:16.755Z" } }

On error:

{ "success": false, "message": "Error capturing iOS Simulator screenshot: [error message]", "error": { "code": "ENOENT", "command": "xcrun simctl io booted screenshot --type=png -", "stderr": "No matching devices found." } }

Requirements

  • Node.js 16.0.0 or higher
  • macOS (iOS Simulator required)
  • Xcode Command Line Tools

Technology Stack

  • TypeScript
  • Node.js
  • MCP SDK (@modelcontextprotocol/sdk)

License

MIT

Other Languages

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

A server that captures screenshots from iOS Simulator using the Model Context Protocol (MCP) and saves them to a specified directory.

  1. Overview
    1. Setup
      1. Environment Variables
        1. Command Line Arguments
          1. Advanced Configuration
            1. MCP Client Configuration by Installation Method
          2. Troubleshooting
            1. Project Structure
              1. Tools
                1. get_ios_simulator_screenshot
              2. Requirements
                1. Technology Stack
                  1. License
                    1. Other Languages
                      ID: vz30wisdsx