Baepsae

io.github.oozoofrog由 GitHub 账号 oozoofrog 发布v6.3.0更新于 Oct 24, 2026

Local MCP server for iOS Simulator and macOS app automation with a native Swift bridge

已验证STDIO仅桌面浏览器自动化开发者工具

概览

AI 生成的概览

本地 MCP 服务器,通过原生 Swift 桥接让助手检查和操作 iOS 模拟器与 macOS 应用。

可以做什么
检查并查询 UI 无障碍树,按标识符或标签执行点击、输入、滑动、滚动、拖拽和设值,支持切换标签页、检测对话框、等待 UI 变化,并用 run_steps 串联多步操作。发送键盘输入、按键序列与组合键、触摸输入,并列出或切换输入源。管理模拟器:列出设备、截图、录制或串流视频、打开网址,以及安装、启动、终止或卸载应用。操作 macOS 应用与窗口:列出应用和窗口、激活或聚焦窗口、截取应用画面、右键、使用上下文菜单和菜单操作、读取剪贴板、监听通知。运行诊断:提供帮助、版本和 doctor 环境检查工具。
适用场景
适合在模拟器中开发或测试 iOS 应用、或在 Mac 上自动化 macOS 应用时使用,让助手检查界面、执行点击与输入、截图或录屏,并管理应用的安装与启动。仅支持 macOS,Linux 和 Windows 上无法使用。
运行要求
需要 macOS 14 或更高版本,并安装 Xcode 或 Xcode 命令行工具(用于 xcrun simctl 及 Swift 6+ 编译原生二进制),以及 Node.js 18 或更高版本;可通过 npx 或 npm 安装。必须为启动它的终端、MCP 客户端或运行时进程(node)授予辅助功能权限,授权后可能需要重启该进程。模拟器功能需要已启动的模拟器。
安装前请注意
该服务器可通过辅助功能 API 控制 Mac 的鼠标键盘并与任意应用交互,因此只应向可信进程授予权限。它可以在模拟器上安装、启动、终止和卸载应用;在 macOS 目标上输入时会临时覆盖宿主剪贴板再恢复。它在本机运行,未声明任何身份验证或 API 密钥。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Baepsae,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-baepsae

[baepsae]

Baepsae (Vinous-throated Parrotbill) — A tiny Korean bird. Round, chubby, and constantly hopping around chirping. Known for its grit — even when a little bird tries to keep up with a stork, it never gives up. This project is small too, but it pecks away at your simulators tirelessly.

Local MCP server for iOS Simulator and macOS app automation with a TypeScript MCP layer and a Swift native bridge.

한국어 문서는 README-KR.md를 참고하세요.

Table of Contents

Prerequisites

  • macOS 14+
  • Xcode + iOS Simulator
  • Node.js 18+
  • Swift 6+

Platform Support

PlatformSupportedNotes
macOSYesPrimary platform. Required for iOS Simulator and Accessibility APIs.
LinuxNoNative binary depends on AppKit, CoreGraphics, and Accessibility frameworks.
WindowsNoNative binary depends on AppKit, CoreGraphics, and Accessibility frameworks.

Why macOS only?

The Swift native bridge (baepsae-native) uses macOS-specific frameworks (AppKit, CoreGraphics, Accessibility) to interact with iOS Simulator and macOS applications. These frameworks are not available on Linux or Windows. The TypeScript MCP layer also relies on xcrun simctl, which is part of Xcode Command Line Tools and only available on macOS.

Requirements summary:

  • macOS 14 or later -- required for iOS Simulator automation and Accessibility API access.
  • Xcode or Xcode Command Line Tools -- required for Swift 6+ compilation of the native binary and xcrun simctl commands.
  • Node.js >= 18.0.0 -- required to run the TypeScript MCP server.

Permissions

Accessibility permission is required for UI inspection and input automation features (use unified generic tools such as analyze_ui, tap, right_click).

The important detail is that permission usually needs to be granted to the automation host / runtime process, not to the target app you are automating.

Which process usually needs permission?

  • Direct native binary invocation
    • Example: baepsae-native ...
    • Most relevant entry: the baepsae-native binary itself, plus the terminal/shell app that launched it
  • Node / npx MCP runtime
    • Example: node dist/index.js, npx -y mcp-baepsae@latest
    • Most relevant entry: the runtime process (node), plus the terminal or MCP client app that launched it
  • Desktop / CLI MCP clients
    • Example: Claude Code, Codex CLI/Desktop, Gemini CLI
    • Relevant entries can include the MCP client app, the terminal host, and the runtime process depending on launch path

Recommended setup flow

  1. Open System Settings > Privacy & Security > Accessibility.
  2. Enable the terminal or MCP client app you actually use.
  3. Enable the runtime process if listed (node, bun, etc.).
  4. For direct native invocation, also enable the baepsae-native binary entry if it appears separately.
  5. If an entry is missing, click + and add it manually.

Important note

After granting permission, the launching process may need to be restarted before macOS applies the change.
If the error persists, quit and relaunch the terminal, MCP client, or runtime process that started mcp-baepsae.

For simulator targets, selector-based actions (tap / right_click with id or label) search in-app content by default. Set all: true to include Simulator chrome UI.

Install

Option A) npm (easiest)

bash
# Run directly without installingnpx mcp-baepsae@latest
# Or install globallynpm install -g mcp-baepsae

On macOS, the Swift native binary is built automatically during install. If Swift is not available, the server still works with simctl-based features.

If you plan to use UI inspection or input automation right away, grant Accessibility permission to the terminal / MCP client / runtime process you will actually launch the server with.

Option B) From source

bash
git clone https://github.com/oozoofrog/mcp-baepsae.gitcd mcp-baepsaenpm installnpm run build

MCP Setup (Recommended)

Use the installer script that calls each client's MCP install flow directly.

bash
bash scripts/install.sh --tool all

Client Matrix

ClientInstall PathScript TargetNotes
Claude Codeclaude mcp add--tool claude-codeSupports multi-scope via --claude-scope
Claude Desktopclaude mcp add --scope user--tool claude-desktopUser-level registration
Codex CLIcodex mcp add--tool codex-cliAlso works for Codex Desktop settings
Codex DesktopCodex CLI MCP config--tool codex-desktopUses same MCP registry as CLI
OpenCodeGlobal config (~/.config/opencode/opencode.json)--tool opencodeAuto-updated by installer
Geminigemini mcp add--tool geminiUser scope setup
Google AntigravityGemini-compatible MCP flow--tool antigravityUses Gemini MCP command path
GitHub Copilotcopilot or gh copilot session--tool copilotInteractive/session-based setup

For LLM

If you are an LLM agent setting up this MCP server, here is everything you need:

Before trying UI automation tools, remember that Accessibility permission usually belongs to the host/runtime process (node, terminal, MCP client), not the target app under automation.

Quick start (one command)

bash
# Register baepsae as an MCP server for all supported clientsbash scripts/install.sh --tool all

If you installed via npm instead of cloning the repo, use npx:

bash
# Claude Codeclaude mcp add baepsae -- npx -y mcp-baepsae@latest
# Codex CLIcodex mcp add baepsae -- npx -y mcp-baepsae@latest

Automation flags

bash
# Preview commands without executingbash scripts/install.sh --tool all --dry-run
# Verify environment and dependenciesbash scripts/install.sh --tool all --doctor
# Unregister from all clientsbash scripts/install.sh --tool all --uninstall

Runtime options

The installer supports multiple runtimes via --runtime:

FlagCommandWhen to use
--runtime node (default)node dist/index.jsLocal source build
--runtime npxnpx -y mcp-baepsae@latestnpm registry, no global install
--runtime bunxbunx mcp-baepsae@latestBun users
--runtime globalmcp-baepsaeAfter npm install -g mcp-baepsae

Manual Setup (Fallback)

Use this when you do not want to run scripts/install.sh.

Using npx (recommended for npm users)

bash
# Claude Codeclaude mcp add baepsae -- npx -y mcp-baepsae@latest
# Codex CLIcodex mcp add baepsae -- npx -y mcp-baepsae@latest
# Gemini CLIgemini mcp add --scope user --transport stdio baepsae npx -y mcp-baepsae@latest

When using npx, the relevant Accessibility entry is commonly the spawned node runtime plus the terminal / MCP client that launched it.

Using local build

bash
# Claude Code (project)claude mcp add --scope project --env="BAEPSAE_NATIVE_PATH=/ABS/PATH/native/.build/release/baepsae-native" baepsae -- node /ABS/PATH/dist/index.js
# Codex CLIcodex mcp add baepsae --env BAEPSAE_NATIVE_PATH=/ABS/PATH/native/.build/release/baepsae-native -- node /ABS/PATH/dist/index.js
# Gemini CLIgemini mcp add --scope user --transport stdio -e BAEPSAE_NATIVE_PATH=/ABS/PATH/native/.build/release/baepsae-native baepsae node /ABS/PATH/dist/index.js

When using a local build, check permission on both the runtime (node) and the app that launched it.
If you invoke baepsae-native directly for debugging, check permission on the native binary entry itself as well.

Project Structure

  • MCP server entry point: src/index.ts
  • Tool modules: src/tools/ (info, simulator, ui, input, media, system)
  • Shared utilities: src/utils.ts, src/types.ts
  • Native binary entry point: native/Sources/main.swift
  • Native command handlers: native/Sources/Commands/
  • Native binary output: native/.build/release/baepsae-native
  • TS tests: tests/mcp.contract.test.mjs, tests/unit.test.mjs, tests/mcp.real.test.mjs
  • Swift tests: native/Tests/BaepsaeNativeTests/

Commands

bash
npm run build       # Build TypeScript + native Swift binarynpm test            # Contract/integration testsnpm run test:real   # Real simulator smoke test (requires booted simulator)npm run test:real:preflight  # Environment diagnostics onlynpm run test:real:sim        # iOS simulator phases only (skips Phase 4)npm run test:real:mac        # macOS Safari phase onlynpm run verify      # test + test:realnpm run setup:mcp   # Alias for scripts/install.sh

MCP Tool Status

43 tools implemented end-to-end.

Official public MCP surface: unified generic tools

The public API surface is intentionally single-scheme: use unified generic tools with a target argument, rather than sim_* / mac_* names.

CategoryTools
UIanalyze_ui, query_ui, tap, tap_tab, type_text, swipe, scroll, drag_drop, wait_for_ui, detect_dialog, read_ui_value, set_ui_value, read_ui_param, hit_test, enumerate_ui
Inputkey, key_sequence, key_combo, touch, input_source, list_input_sources
Workflowrun_steps
Systemlist_windows, activate_app, screenshot_app, right_click, focus_window, context_menu_action, watch_notification
Simulator-onlylist_simulators, screenshot, record_video, stream_video, open_url, install_app, launch_app, terminate_app, uninstall_app, button, gesture
macOS/systemlist_apps, menu_action, get_focused_app, clipboard
Utilitybaepsae_help, baepsae_version, doctor

Target routing is explicit in the arguments: udid for simulator, bundleId / appName for macOS.

type_text policy

type_text accepts exactly one input source: text, stdinText, or file.

  • method: "auto" resolves to:
    • paste for simulator targets
    • keyboard for macOS targets
  • method: "paste" uses the simulator pasteboard for simulator targets and a temporary host clipboard replace/restore flow for macOS targets.
  • method: "keyboard" always types character-by-character.

When paste is used, simulator targets update the simulator pasteboard without touching the host clipboard, while macOS targets temporarily overwrite the host clipboard and restore it after submission. Successful responses report the input source, target kind, requested method, used method, paste transport, and any auto fallback that was applied.

tap_tab policy

tap_tab is semantic-first, geometry-last.

  • First it tries actionable descendants exposed under the tab bar.
  • If SwiftUI/Simulator does not expose real tab button descendants, it can use a semantic proxy row (for example, app-provided top navigation buttons that map cleanly to the same tabs).
  • Only if neither semantic path exists does it fall back to tab-bar geometry.

This matters because SwiftUI TabView in Simulator may expose the tab bar as a generic AXGroup text="Tab Bar" without actionable child buttons.

Usage Examples

Switch tabs by index with semantic-first fallback:

javascript
// Prefer this when your app exposes a real tab bar but individual tab buttons// are not consistently addressable via query_ui/tap selectors.tap_tab({ udid: "...", index: 1, tabCount: 3 })

Unified simulator app accessibility quickstart (inside app UI):

javascript
// 1) Launch your app in the target simulatorlaunch_app({ udid: "...", bundleId: "com.example.app" })
// 2) Inspect or search accessibility tree (in-app content scope by default)analyze_ui({ udid: "..." })query_ui({ udid: "...", query: "Login" })
// 3) Interact by accessibility identifier/labeltap({ udid: "...", id: "login-button" })
// Optional: include Simulator chrome/system UI in selector lookuptap({ udid: "...", label: "Home", all: true })

Open a URL (iOS Simulator):

javascript
// Open Naver Mobileopen_url({ udid: "...", url: "https://m.naver.com" })

Manage Apps (iOS Simulator):

javascript
// Install an appinstall_app({ udid: "...", path: "/path/to/App.app" })
// Launch Safarilaunch_app({ udid: "...", bundleId: "com.apple.mobilesafari" })
// Terminate Safariterminate_app({ udid: "...", bundleId: "com.apple.mobilesafari" })

macOS App Automation:

javascript
// List running macOS appslist_apps({})
// Take screenshot of a macOS appscreenshot_app({ bundleId: "com.apple.Safari" })

Troubleshooting

Accessibility permission checklist

  • The permission target is usually the automation host/runtime process, not the target app.

  • Run doctor first to inspect host process, parent process, native binary, booted simulator availability, and accessibility readiness in one place.

  • Check the error message for:

    • current host process
    • parent process
    • inferred launch mode
  • If you launched through npx / node, grant permission to the runtime and the launching terminal / MCP client.

  • If you launched baepsae-native directly, grant permission to the native binary entry and the launching terminal / shell app.

  • After changing permission, restart the launching process before retrying.

  • Invalid environment variable format on Claude setup:

    • Use current script (scripts/install.sh) or claude mcp add --env="KEY=value" ... format.
  • Missing native binary error:

    • Run npm run build and confirm native/.build/release/baepsae-native exists.
  • Accessibility permission error is ambiguous:

    • Current versions include host/parent process diagnostics and inferred launch mode in the error text so you can see which executable path likely needs permission.
  • Real smoke test diagnostics:

    • Run npm run test:real:preflight to print environment and capability diagnostics without executing the full suite.
    • Run npm run test:real:sim to focus on simulator-capability coverage, or npm run test:real:mac for the macOS Safari subset.
  • Multiple Simulator windows are open and selectors hit the wrong device:

    • Current versions scope simulator selectors to the target udid window first.
    • If you intentionally need Simulator chrome/system UI, use all: true.
  • OpenCode does not show baepsae:

    • Re-run bash scripts/install.sh --tool opencode --skip-install --skip-build and check ~/.config/opencode/opencode.json.
  • Copilot not auto-registered:

    • Copilot MCP flow is interactive/session-based. Re-run installer with --interactive.
  • Real smoke test skipped:

    • Boot an iOS simulator first, then run npm run test:real.

来源:README.md,提交 4e36492

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v6.3.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分