axmcp

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 0 Imported by: 0

README

axmcp

axmcp is a macOS toolkit built around two complementary MCP servers:

  • cmd/axmcp for direct macOS Accessibility automation, OCR-assisted interaction, screenshots, and window control.
  • cmd/xcmcp for Xcode projects, builds, tests, simulators, devices, previews, and IDE-facing workflows.

The repository also includes companion CLIs built on the same packages:

  • cmd/ax for direct terminal access to the macOS Accessibility API.
  • cmd/xc for terminal access to Xcode, simulator, device, and UI workflows.
  • cmd/ascript and cmd/ascriptmcp for AppleScript dictionaries and scriptable applications.

If you need to drive native macOS apps, start with axmcp. If you need to inspect or operate on Xcode projects and Apple development tooling, start with xcmcp.

Requirements

  • macOS with Xcode installed.
  • Command Line Tools available through xcrun.
  • Go 1.26 or newer to build from source.
  • Accessibility permission for commands that drive the UI, including axmcp, ax, xcmcp, and xc.
  • A booted simulator or connected device for simulator and device workflows.

Install

Build the commands you need:

go install ./cmd/xcmcp ./cmd/xc ./cmd/ax ./cmd/axmcp ./cmd/ascript ./cmd/ascriptmcp

Or build everything in the module:

go build ./...

Quick Start

Run the Accessibility MCP server:

axmcp

axmcp exposes direct macOS UI automation tools, including AX tree inspection, text lookup, screenshots, OCR, pointer actions, keyboard input, and window operations.

Run the Xcode and simulator MCP server:

xcmcp

xcmcp starts with:

  • core project, build, test, simulator, and Xcode target tools
  • MCP resources
  • Xcode bridge tools via xcrun mcpbridge

Optional toolsets can be enabled at startup:

xcmcp --enable-ui-tools --enable-device-tools --enable-ios-tools

Or all at once:

xcmcp --enable-all

An MCP client configuration can register either server or both:

{
  "mcpServers": {
    "axmcp": {
      "command": "/absolute/path/to/axmcp"
    },
    "xcmcp": {
      "command": "/absolute/path/to/xcmcp",
      "args": [
        "--enable-ui-tools",
        "--enable-device-tools",
        "--enable-ios-tools"
      ]
    }
  }
}

Within a session, optional toolsets can also be enabled dynamically with list_toolsets and enable_toolset.

Commands

axmcp

axmcp is the Accessibility-first MCP server. It targets running macOS applications directly through the Accessibility API, with OCR and screenshot fallbacks for custom-drawn or partially inaccessible UIs.

Representative tools include:

  • ax_apps, ax_tree, ax_find, ax_focus
  • ax_click, ax_type, ax_menu, ax_set_value, ax_perform_action, ax_keystroke
  • ax_screenshot, ax_ocr, ax_ocr_diff, ax_action_screenshot, ax_ocr_action_diff
  • ax_window_click, ax_window_hover, ax_window_move, ax_window_raise, ax_window_action
xcmcp

xcmcp serves tools and resources over stdio.

Always-on native tools include:

  • discover_projects, list_schemes, show_build_settings
  • build, test
  • list_simulators, boot_simulator, shutdown_simulator
  • xcode_add_target
  • list_toolsets, enable_toolset

The Xcode bridge toolset is enabled by default and adds IDE-facing tools discovered from xcrun mcpbridge.

Optional toolsets include:

  • app: app lifecycle, install, uninstall, logs, and app listing
  • ui: UI tree, tap, inspect, query, screenshot, and wait
  • device: simulator orientation, privacy, location, appearance, and screenshots
  • ios: direct CoreSimulator-based accessibility tree and hit-testing
  • simulator_extras: open URL, add media, and app container lookup
  • physical_device: connected device inspection and app lifecycle actions
  • video: simulator recording
  • crash: crash report listing and reading
  • filesystem: file access helpers
  • dependency: Swift Package Manager helpers
  • asc: App Store Connect and altool helpers
xc

xc exposes the same building blocks as a direct CLI.

Examples:

xc sims list
xc build --scheme MyApp
xc test --scheme MyApp
xc app launch com.example.MyApp --udid booted
xc ui tree --bundle-id com.apple.finder
xc ios tree --udid booted
xc xcode add-target --template "Widget Extension" --product MyWidget
ax

ax is the direct CLI companion to axmcp.

Examples:

ax apps
ax tree com.apple.finder
ax find com.apple.dt.Xcode --role AXButton --title Build
ascript and ascriptmcp

These commands inspect scriptable applications and run AppleScript-backed operations.

Examples:

ascript list /Applications/Xcode.app
ascript classes /Applications/Finder.app
ascript script /Applications/Finder.app activate

Resources

xcmcp currently registers these MCP resources by default:

  • xcmcp://project
  • xcmcp://simulators
  • xcmcp://apps
  • xcmcp://apps/{bundle_id}/tree
  • xcmcp://apps/{bundle_id}/logs

Internal Layout

This module is command-first. The reusable helper packages live under internal/ and are not intended as a public import surface.

The main internal packages are:

  • internal/project: discover Xcode projects and inspect schemes and build settings
  • internal/xcodebuild: build and test wrappers
  • internal/simctl: simulator management through xcrun simctl
  • internal/devicectl: physical device management
  • internal/ui: macOS Accessibility access and UI screenshots
  • internal/screen: screen capture helpers
  • internal/crash: crash report listing and reading
  • internal/resources: MCP resource registration
  • internal/sdef: parser for AppleScript scripting definitions
  • internal/altool and internal/asc: App Store Connect helpers

Notes

  • This repository targets macOS. Many packages use AppKit, Accessibility, or Apple developer tools directly.
  • The repository name is axmcp, but it intentionally contains both axmcp and xcmcp. They cover different layers of the same workflow surface.
  • UI automation depends on macOS Accessibility permission and on the target app being reachable through the Accessibility tree.
  • Some simulator and Xcode automation features rely on private or implementation-defined behavior and are best treated as developer tooling rather than a stable public protocol.
  • The supported entry points are the commands in cmd/. The internal packages may change without notice.

Documentation

Overview

Package axmcp documents the axmcp module.

axmcp is a macOS-focused toolkit built around two complementary MCP servers:

  • cmd/axmcp, for direct macOS Accessibility automation
  • cmd/xcmcp, for Xcode, simulator, device, and project workflows

The module also includes matching CLIs and tools for AppleScript automation. It is organized around command packages and internal implementation libraries rather than a single top-level API.

Commands

The main entry points are:

  • cmd/axmcp, a stdio MCP server for macOS Accessibility automation
  • cmd/xcmcp, a stdio MCP server for project inspection, build and test, simulator control, device control, UI inspection, and Xcode integration
  • cmd/xc, a direct CLI built on the same packages
  • cmd/ax, a direct CLI for the macOS Accessibility API
  • cmd/ascript and cmd/ascriptmcp, tools for scriptable macOS applications

Internal Packages

The main implementation packages are:

  • internal/project, for discovering Xcode projects and schemes
  • internal/xcodebuild, for build and test execution
  • internal/simctl, for simulator management through xcrun simctl
  • internal/devicectl, for physical device management
  • internal/ui, for macOS Accessibility access and UI screenshots
  • internal/screen, for screen capture helpers
  • internal/crash, for crash report inspection
  • internal/resources, for MCP resource registration

Environment

axmcp targets macOS and assumes Xcode and the simulator tooling are installed. Packages that drive the UI require Accessibility permission. Simulator and device features also depend on the corresponding runtime state, such as a booted simulator or a connected device.

This package exists to document the module as a whole. The supported entry points are the commands under cmd/. Most library code lives in internal/ packages and is not intended as a public import surface.

Directories

Path Synopsis
cmd
ascript command
Command ascript is a CLI for exploring and running AppleScript commands against scriptable macOS applications.
Command ascript is a CLI for exploring and running AppleScript commands against scriptable macOS applications.
ascriptmcp command
Command ascriptmcp is an MCP server that dynamically exposes scriptable macOS applications as MCP tools by parsing their sdef (scripting definition).
Command ascriptmcp is an MCP server that dynamically exposes scriptable macOS applications as MCP tools by parsing their sdef (scripting definition).
ax command
Command ax is a CLI for macOS Accessibility API navigation with dynamic tab completion.
Command ax is a CLI for macOS Accessibility API navigation with dynamic tab completion.
axmcp command
Command axmcp is an MCP server for macOS Accessibility API automation.
Command axmcp is an MCP server for macOS Accessibility API automation.
xc command
xcmcp command
Command xcmcp is a MCP server that exposes various tools for interacting with Xcode projects, simulators, devices, and related resources.
Command xcmcp is a MCP server that exposes various tools for interacting with Xcode projects, simulators, devices, and related resources.
internal
altool
Package altool wraps xcrun altool for app upload and validation.
Package altool wraps xcrun altool for app upload and validation.
asc
Package asc wraps the asc CLI for App Store Connect API operations.
Package asc wraps the asc CLI for App Store Connect API operations.
devicectl
Package devicectl provides wrappers around xcrun devicectl for physical device management.
Package devicectl provides wrappers around xcrun devicectl for physical device management.
purego/coresim
Package coresim provides purego bindings for CoreSimulator.framework.
Package coresim provides purego bindings for CoreSimulator.framework.
purego/objc
Package objc provides Objective-C runtime bindings using purego.
Package objc provides Objective-C runtime bindings using purego.
sdef
Package sdef parses macOS scripting definition (sdef) XML and generates AppleScript runners from the parsed definitions.
Package sdef parses macOS scripting definition (sdef) XML and generates AppleScript runners from the parsed definitions.
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL