Skip to main content
Glama

MCP iOS Simulator Screenshot

by yorifuji

MCP iOS 模拟器截图

使用模型上下文协议 (MCP) 从 iOS 模拟器捕获屏幕截图的服务器。

概述

本项目实现了一个MCP协议服务器,可以抓取iOS模拟器的当前屏幕,并保存到指定的目录。

设置

克莱恩和鲁代码

对于 Cline 和 Roo 代码,基本格式是:

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

如果您克隆存储库,则可以使用以下配置:

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

光标,克劳德桌面

对于 Cursor 和 Claude Desktop,您需要指定--output-dir和输出目录:

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "npx", "args": [ "mcp-ios-simulator-screenshot", "--output-dir", "/path/to/your/output/directory" ] } } }

MCP 工具参数

获取屏幕截图

从 iOS 模拟器捕获屏幕截图并将其保存到指定目录。

范围类型描述默认值
输出文件名细绳输出文件名时间戳.png
输出目录名称细绳屏幕截图的子目录名称.截图
调整大小布尔值是否将图像调整为大约 VGA 尺寸真的
最大宽度整数调整大小的最大宽度(像素)640
设备 ID细绳指定模拟器设备启动设备

输出格式

成功时:

{ "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" }, "serverConfig": { "commandLineArgs": { "outputDir": "/Users/username/Desktop" // Only included when --output-dir is specified } } }

注意:仅当启动服务器时指定了--output-dir参数时, serverConfig.commandLineArgs.outputDir字段才会包含在响应中。

{ "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." } }

故障排除

  • 如果您无法截取屏幕截图
    • 检查 iOS 模拟器是否正在运行
    • 检查是否安装了 Xcode 命令行工具
    • 检查是否可以直接执行xcrun simctl io booted screenshot命令
  • 如果发生权限错误
    • 检查您是否具有输出目录的写入权限

要求

  • Node.js 16.0.0 或更高版本
  • macOS(需要 iOS 模拟器)
  • Xcode 命令行工具

技术堆栈

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

执照

麻省理工学院

其他语言

You must be authenticated.

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

local-only server

The server can only run on the client's local machine because it depends on local resources.

使用模型上下文协议 (MCP) 从 iOS 模拟器捕获屏幕截图并将其保存到指定目录的服务器。

  1. 概述
    1. 设置
      1. 克莱恩和鲁代码
      2. 光标,克劳德桌面
    2. MCP 工具参数
      1. 获取屏幕截图
    3. 输出格式
      1. 故障排除
        1. 要求
          1. 技术堆栈
            1. 执照
              1. 其他语言

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that provides AI vision capabilities for analyzing UI screenshots, offering tools for screen analysis, file operations, and UI/UX report generation.
                  Last updated -
                  26
                  1
                  JavaScript
                  ISC License
                  • Linux
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  An official MCP server implementation that allows AI assistants to capture website screenshots through the ScreenshotOne API, enabling visual context from web pages during conversations.
                  Last updated -
                  1
                  6
                  TypeScript
                  MIT License
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A lightweight Model Context Protocol (MCP) server that enables your LLM to capture screenshots of any specified URL and return only the access URL for the captured image. This tool simplifies the process of generating and sharing webpage snapshots, making it perfect for integrating visual capture ca
                  Last updated -
                  1
                  Python

                View all related MCP servers

                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/yorifuji/mcp-ios-simulator-screenshot'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server