macos-computer-use-mcp
Provides native macOS computer control tools including mouse and keyboard simulation, screenshot capture, and application management for MCP-compatible agents. It enables AI assistants to directly interact with the macOS operating system and installed apps through standard tool calls.
README
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.
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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。