Skip to main content
Glama
macos-computer-use-mcp

macos-computer-use-mcp

by Zooeyii

macos-computer-use-mcp

A standalone MCP server providing native macOS computer control — mouse, keyboard, screenshots, and app management — for any MCP-compatible agent.

Demo

https://github.com/user-attachments/assets/130bee07-1f87-4291-8483-fc47ec51e493

Screenshot & Click in action — The MCP server grants app access, captures a 2560×1664 native screenshot, clicks on-screen elements, and opens URLs — all orchestrated through standard MCP tool calls from a coding agent.

Related MCP server: macos-desktop-control

Compatibility

Works with any client that supports the Model Context Protocol, including:

  • Claude Code (claude mcp add)

  • OpenAI Codex (~/.codex/config.toml)

  • Cursor (~/.cursor/mcp.json)

  • Any other MCP-compatible agent or IDE

How It Works

The server exposes macOS system control as MCP tools. Under the hood it uses macOS native modules for low-level input simulation and system APIs:

  • @ant/computer-use-input — Low-level mouse and keyboard event injection

  • @ant/computer-use-swift — macOS native APIs for display management, app control, and screenshots

The MCP server process communicates over stdio, so any agent can spawn it as a subprocess and call its tools via the standard JSON-RPC protocol.

Available Tools (24)

Tool

Description

request_access

Request Accessibility permission for an app

screenshot

Capture the full screen

zoom

Zoom into a screen region

left_click

Left-click at coordinates

right_click

Right-click at coordinates

middle_click

Middle-click at coordinates

double_click

Double-click at coordinates

triple_click

Triple-click at coordinates

type

Type a string of text

key

Press a key or key combination

cursor_position

Get current mouse position

mouse_move

Move the cursor to coordinates

scroll

Scroll at coordinates

drag

Drag from one point to another

left_click_drag

Left-click and drag

get_display_size

Get screen dimensions

list_displays

List all connected displays

get_frontmost_app

Get the currently active application

list_installed_apps

List all installed applications

open_app

Open an application by name or bundle ID

close_app

Close an application

focus_app

Bring an application to the foreground

get_screen_content

Get accessibility tree for screen content

wait

Wait for a specified duration

Installation

curl -fsSL https://raw.githubusercontent.com/Zooeyii/macos-computer-use-mcp/main/install.sh | bash

Or manually:

git clone https://github.com/Zooeyii/macos-computer-use-mcp.git ~/.local/share/macos-computer-use-mcp
cd ~/.local/share/macos-computer-use-mcp
npm install
npm run build

Configuration

Claude Code

claude mcp add -s user computer-use-standalone node $HOME/.local/share/macos-computer-use-mcp/dist/cli.js

Or add to ~/.claude/mcp.json:

{
  "computer-use-standalone": {
    "type": "stdio",
    "command": "node",
    "args": ["$HOME/.local/share/macos-computer-use-mcp/dist/cli.js"]
  }
}

OpenAI Codex

Add to ~/.codex/config.toml:

[mcp_servers.computer-use-standalone]
command = "node"
args = ["$HOME/.local/share/macos-computer-use-mcp/dist/cli.js"]

Or via CLI:

codex mcp add computer-use-standalone -- node $HOME/.local/share/macos-computer-use-mcp/dist/cli.js

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "computer-use-standalone": {
      "command": "node",
      "args": ["$HOME/.local/share/macos-computer-use-mcp/dist/cli.js"]
    }
  }
}

Requirements

  • macOS (Darwin) — macOS-only due to native module dependencies

  • Node.js 18+

  • Accessibility Permission — Required for mouse/keyboard control

    • System Settings → Privacy & Security → Accessibility

  • Screen Recording Permission — Required for screenshots

    • System Settings → Privacy & Security → Screen Recording

Architecture

MCP Client (Claude Code / Codex / Cursor / any agent)
      │
      │  stdio (JSON-RPC / MCP protocol)
      │
      ▼
macos-computer-use-mcp (this server)
      │
      ├── MCP Server
      │     └── Tool handler
      │
      ├── Tool Definitions
      │     ├── Input tools (click, drag, scroll, type, key)
      │     ├── Screen tools (screenshot, zoom, display info)
      │     └── App tools (open, close, focus, list)
      │
      └── Executor
            │
            ├── @ant/computer-use-input.node
            │     └── Mouse / keyboard event injection
            │
            └── @ant/computer-use-swift
                  └── macOS native APIs
                        ├── App management
                        ├── Display control
                        └── Screenshot capture

Project Structure

macos-computer-use-mcp/
├── src/
│   ├── cli.ts          # MCP server entry point
│   ├── tools.ts        # Tool definitions
│   └── executor.ts     # Platform implementations
├── install.sh          # One-line installer
├── package.json
├── tsconfig.json
├── tsup.config.ts
└── README.md

Development

# Install dependencies
npm install

# Build
npm run build

# Run directly
node dist/cli.js

# Type-check only
npm run typecheck

Disclaimer

This project is for educational and research purposes.

Native module interfaces are based on publicly observable runtime behavior.

Use at your own risk. Only run in trusted environments — computer use grants full control of your mouse, keyboard, and screen.

License

MIT

Available Tools

24 tools
computer_batchA

Execute a sequence of actions in ONE tool call. Each individual tool call requires a model→API round trip (seconds); batching a predictable sequence eliminates all but one. Use this whenever you can predict the outcome of several actions ahead — e.g. click a field, type into it, press Return. Actions execute sequentially and stop on the first error. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. The frontmost check runs before EACH action inside the batch — if an action opens a non-allowed app, the next action's gate fires and the batch stops there. Mid-batch screenshot actions are allowed for inspection but coordinates in subsequent clicks always refer to the PRE-BATCH full-screen screenshot.

Inputs: actions (required).

cursor_positionA

Get the current mouse cursor position. Returns image-pixel coordinates relative to the most recent screenshot, or logical points if no screenshot has been taken.

Inputs: no named parameters.

double_clickA

Double-click at the given coordinates. Selects a word in most text editors. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required), text.

hold_keyA

Press and hold a key or key combination for the specified duration, then release. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. System-level combos require the systemKeyCombos grant.

Inputs: text (required), duration (required).

keyA

Press a key or key combination (e.g. "return", "escape", "cmd+a", "ctrl+shift+tab"). The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. System-level combos (quit app, switch app, lock screen) require the systemKeyCombos grant — without it they return an error. All other combos work.

Inputs: text (required), repeat.

left_clickA

Left-click at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required), text.

left_click_dragA

Press, move to target, and release. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required), start_coordinate.

left_mouse_downA

Press the left mouse button at the current cursor position and leave it held. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Use mouse_move first to position the cursor. Call left_mouse_up to release. Errors if the button is already held.

Inputs: no named parameters.

left_mouse_upA

Release the left mouse button at the current cursor position. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Pairs with left_mouse_down. Safe to call even if the button is not currently held.

Inputs: no named parameters.

list_granted_applicationsA

List the applications currently in the session allowlist, plus the active grant flags and coordinate mode. No side effects.

Inputs: no named parameters.

middle_clickA

Middle-click (scroll-wheel click) at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required), text.

mouse_moveA

Move the mouse cursor without clicking. Useful for triggering hover states. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required).

open_applicationA

Bring an application to the front, launching it if necessary. The target application must already be in the session allowlist — call request_access first.

Inputs: app (required).

read_clipboardA

Read the current clipboard contents as text. Requires the clipboardRead grant.

Inputs: no named parameters.

request_accessA

Request user permission to control a set of applications for this session. Must be called before any other tool in this server. The user sees a single dialog listing all requested apps and either allows the whole set or denies it. Call this again mid-session to add more apps; previously granted apps remain granted. Returns the granted apps, denied apps, and screenshot filtering capability.

Inputs: apps (required), reason (required), clipboardRead, clipboardWrite, +1 more.

right_clickA

Right-click at the given coordinates. Opens a context menu in most applications. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required), text.

screenshotA

Take a screenshot of the primary display. On this platform, screenshots are NOT filtered — all open windows are visible. Input actions targeting apps not in the session allowlist are rejected. Returns an error if the allowlist is empty. The returned image is what subsequent click coordinates are relative to.

Inputs: save_to_disk.

scrollA

Scroll at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required), scroll_amount (required), scroll_direction (required).

switch_displayA

Switch which monitor subsequent screenshots capture. Use this when the application you need is on a different monitor than the one shown. The screenshot tool tells you which monitor it captured and lists other attached monitors by name — pass one of those names here. After switching, call screenshot to see the new monitor. Pass "auto" to return to automatic monitor selection.

Inputs: display (required).

triple_clickA

Triple-click at the given coordinates. Selects a line in most text editors. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.

Inputs: coordinate (required), text.

typeA

Type text into whatever currently has keyboard focus. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Newlines are supported. For keyboard shortcuts use key instead.

Inputs: text (required).

waitA

Wait for a specified duration.

Inputs: duration (required).

write_clipboardA

Write text to the clipboard. Requires the clipboardWrite grant.

Inputs: text (required).

zoomA

Take a higher-resolution screenshot of a specific region of the last full-screen screenshot. Use this liberally to inspect small text, button labels, or fine UI details that are hard to read in the downsampled full-screen image. IMPORTANT: Coordinates in subsequent click calls always refer to the full-screen screenshot, never the zoomed image. This tool is read-only for inspecting detail.

Inputs: region (required), save_to_disk.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 24 tools

    Disambiguation5/5

    Each tool targets a distinct action (e.g., click types, keyboard, screenshots, clipboard, application control). The many click tools are clearly differentiated by modifiers (double, triple, right, drag, press/release), and composite actions like computer_batch occupy their own niche.

    Naming Consistency5/5

    All tool names use lowercase with underscores for multi-word names (e.g., left_click_drag, list_granted_applications). Simple actions use short single words (key, type, wait). The pattern is uniform and predictable.

    Tool Count4/5

    24 tools is on the higher end, but each tool covers a necessary primitive for computer control (clicks, keyboard, screenshots, clipboard, app management, batching). The count is justified given the breadth of actions an agent might need.

    Completeness5/5

    The tool set covers all major interaction primitives: mouse, keyboard, screenshots (full and zoomed), display switching, clipboard, application launching, permissions management, and batching. There are no obvious gaps for basic computer use tasks.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for reliable native macOS desktop control from AI agents, providing 72 tools for screenshots, mouse, keyboard, scroll, clipboard, window management, and more.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides native macOS desktop automation for AI agents, enabling screen capture, mouse/keyboard control, window management, and iOS/Android simulator control in both foreground and background modes without focus stealing.
      6
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to control macOS desktop apps via screenshots, mouse clicks, keyboard input, accessibility queries, and AppleScript.
      11
      11 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides 146 MCP tools for AI agents to control macOS, including screenshots, mouse, keyboard, window management, app automation, file system, OCR, and built-in app semantics like Calendar, Mail, Safari, Music, Messages. Enables full control over macOS through natural language.
      2
      MIT

    Appeared in Searches