Skip to main content

MCP Server for interacting with macOS Desktop.

Project description

🍎 macOS-MCP

License Python Platform: macOS 12+ Last Commit

Overview

macOS-MCP is a lightweight, open-source Model Context Protocol server that bridges AI agents and the macOS operating system. It enables seamless automation of macOS through LLMs via tasks such as file navigation, application control, UI interaction, browser automation, and system operations.

Supported Operating Systems

  • macOS 12 (Monterey)
  • macOS 13 (Ventura)
  • macOS 14 (Sonoma)
  • macOS 15 (Sequoia)

Key Features

  • Works with Any LLM (Vision Optional)
    Unlike traditional automation tools, macOS-MCP doesn't require computer vision, fine-tuned models, or specialized setup. Works seamlessly with any LLM—Claude, GPT, Gemini, or others.

  • Native macOS Integration
    Interacts natively with macOS UI elements using the Accessibility API. Opens apps, controls windows, simulates user input, and captures desktop state without workarounds.

  • Rich Toolset for Automation
    Complete toolkit for keyboard/mouse operations, window management, UI state capture, interactive element extraction from the accessibility tree, and AppleScript execution.

  • Lightweight and Open-Source
    Minimal dependencies with full source code available under MIT license. Easy setup and deployment.

  • Smart Context Awareness
    Automatically detects application state (Launchpad, Control Center, Spotlight). Scans menu bar, dock, desktop, and system UI elements intelligently.

  • Customizable and Extensible
    Easily extend with custom tools or modify behavior to suit your specific automation needs.

Installation

Prerequisites

  • Python: 3.11 or later
  • UV Package Manager: Install with pip install uv or curl -LsSf https://astral.sh/uv/install.sh | sh
  • macOS: 12 (Monterey) or later
  • Accessibility Permissions: Required for UI element interaction

Quick Start

Run the server directly:

uvx macos-mcp

Grant Required Permissions

macOS-MCP requires Accessibility and Screen Recording permissions to function properly.

Accessibility Permissions

  1. Open System SettingsPrivacy & SecurityAccessibility
  2. Click the lock icon and authenticate
  3. Add the following applications:
    • Your terminal application (Terminal, iTerm2, VS Code, etc.)
    • Python (typically /usr/bin/python3 or the Python version managed by UV)
    • UV (~/.local/bin/uv if installed locally, or the Python environment UV manages)
  4. Restart the terminal after granting permissions

For uvx users: Grant permissions to your terminal application and Python, as uvx runs Python packages from UV's cache.

Screen Recording Permissions

The Snapshot tool requires Screen Recording permissions to capture screenshots:

  1. Open System SettingsPrivacy & SecurityScreen Recording
  2. Click the lock icon and authenticate
  3. Add the same applications as above (terminal, Python, UV)
  4. Restart the terminal after granting permissions

Note: If the Snapshot tool fails, verify both permissions are granted in System Settings.

Integration Options

Claude Desktop
  1. Install Claude Desktop

  2. Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "macos-mcp": {
      "command": "uvx",
      "args": ["macos-mcp"]
    }
  }
}
  1. Restart Claude Desktop
Gemini CLI
  1. Install Gemini CLI:
npm install -g @google/gemini-cli
  1. Navigate to ~/.gemini and open settings.json

  2. Add the server config:

{
  "theme": "Default",
  "mcpServers": {
    "macos-mcp": {
      "command": "uvx",
      "args": ["macos-mcp"]
    }
  }
}
  1. Restart Gemini CLI
Claude Code
  1. Install Claude Code

  2. Add to your project configuration or use the MCP marketplace integration

Pi Agent

Pi does not ship with built-in MCP support, but macOS-MCP can be installed as a Pi package. The package starts this MCP server over stdio and exposes convenient Pi tools that wrap the existing macOS-MCP tools.

One-line global setup:

pi install git:github.com/CursorTouch/MacOS-MCP

After install, restart Pi or run:

/reload

Try without installing:

pi -e git:github.com/CursorTouch/MacOS-MCP

Local checkout setup:

git clone https://github.com/CursorTouch/MacOS-MCP.git
cd MacOS-MCP
uv sync
npm install
pi

If you copied only the extension into another Pi project, run Pi from the macOS-MCP checkout or set:

export MACOS_MCP_ROOT=/path/to/MacOS-MCP

The extension exposes these Pi tools:

Pi Tool Purpose
mac_snapshot Read current macOS UI state through the existing Snapshot tool.
mac_app Launch, switch, move, or resize macOS applications/windows.
mac_click Click coordinates returned by mac_snapshot.
mac_type Type text at coordinates returned by mac_snapshot.
mac_shortcut Run keyboard shortcuts such as command+c or command+space.
mac_scroll Scroll at the current pointer or coordinates.
mac_wait Wait for UI changes/loading.

Recommended agent workflow:

  • Call mac_snapshot first.
  • Use the coordinates returned by Snapshot with mac_click, mac_type, and mac_scroll.
  • Use screenshots/vision only when Accessibility data is missing or ambiguous.

The extension auto-detects the macOS-MCP checkout when installed as a Pi package. If you use a manually copied extension, set MACOS_MCP_ROOT=/path/to/MacOS-MCP.

Other Integrations

Any client supporting the Model Context Protocol can integrate macOS-MCP by configuring the uvx macos-mcp command in their MCP server settings.


MCP Tools

macOS-MCP provides a comprehensive toolset for desktop automation:

Tool Purpose
Click Click at coordinates with support for left, right, and double-click
Type Type text at cursor position, optionally clearing existing text
Scroll Scroll vertically or horizontally in focused window or regions
Move Move mouse pointer or drag to coordinates
Shortcut Press keyboard shortcuts (Cmd+C, Cmd+Tab, etc.)
App Launch applications, manage windows (resize/move), switch between apps. Supports app names and bundle IDs
Shell Execute commands or AppleScript. Use mode='osascript' for AppleScript
Scrape Extract and convert webpage content to Markdown format
Wait Pause execution for a defined duration

Limitations

  • Accessibility Requirements: Manual permission grant required in System Preferences
  • App Compatibility: Some applications have limited or no Accessibility API support
  • Performance Variance: Complex UIs with many elements may have slower traversal
  • Text Input: Some specialized input fields may not properly receive keystrokes
  • Authentication: Cannot interact with system authentication dialogs

Security

⚠️ Important Security Notice: macOS-MCP operates with full Accessibility API permissions and executes real system operations without sandboxing. It can perform permanent, irreversible actions.

Before using macOS-MCP:

  • ✅ Grant Accessibility permissions only to trusted applications
  • ✅ Understand that Shell commands execute with full user privileges
  • ✅ Review AI-generated action plans before execution
  • ✅ Use only in virtual machines or isolated environments with valueless data
  • ✅ Create backups before testing in production-like scenarios

⛔ Do NOT use on:

  • Systems with irreplaceable data
  • Production machines or shared systems
  • Compliance-regulated environments (HIPAA, PCI, etc.)

For detailed security guidance, see SECURITY.md.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Development setup and code standards
  • Testing requirements
  • Pull request process
  • Coding conventions (Ruff formatting, 100 char line length)

License

macOS-MCP is licensed under the MIT License - see LICENSE for details.

Acknowledgements

macOS-MCP is built with excellent open-source projects:

  • PyObjC - Python to Objective-C bridge
  • Pillow - Python Imaging Library
  • FastMCP - MCP framework
  • macOS Accessibility API (ApplicationServices)

Citation

If you use macOS-MCP in your research or project, please cite:

@software{macos-mcp,
  author       = {Jeomon George},
  title        = {macOS-MCP: Lightweight MCP Server for macOS Automation},
  year         = {2025},
  publisher    = {GitHub},
  url          = {https://github.com/Jeomon/macos-mcp}
}

Questions or Issues? Open an issue or check SECURITY.md for security concerns.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

macos_mcp-0.3.4.tar.gz (255.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

macos_mcp-0.3.4-py3-none-any.whl (79.2 kB view details)

Uploaded Python 3

File details

Details for the file macos_mcp-0.3.4.tar.gz.

File metadata

  • Download URL: macos_mcp-0.3.4.tar.gz
  • Upload date:
  • Size: 255.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for macos_mcp-0.3.4.tar.gz
Algorithm Hash digest
SHA256 80fb0c2ee5623c44c134da35e98ec6300f5bf113b5b36022ad491751a3d36ae6
MD5 64efae316274c955137c71ebf2a014e6
BLAKE2b-256 0db2706fa5150eb022352df124113d49a87b4c776733f6a024ca57ead2ace17d

See more details on using hashes here.

Provenance

The following attestation bundles were made for macos_mcp-0.3.4.tar.gz:

Publisher: publish.yml on CursorTouch/MacOS-MCP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file macos_mcp-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: macos_mcp-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 79.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for macos_mcp-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 de614a97772d6a89e8e853415bd9d04fe9d6d88265fd9c487a596b4fc0d55c42
MD5 4384eba3c7759505c7317258328eb368
BLAKE2b-256 9b18d41d4af6c8042c80d0998918a3cf1dd06bb8d289fce3bff0ce3e82ffb40b

See more details on using hashes here.

Provenance

The following attestation bundles were made for macos_mcp-0.3.4-py3-none-any.whl:

Publisher: publish.yml on CursorTouch/MacOS-MCP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page