macos-mcp-automation

macos-mcp-automation

Enables macOS system automation, window management, and productivity tools for AI agents, including running AppleScripts, opening apps, retrieving browser tabs, taking screenshots, and controlling system settings.

Category
访问服务器

README

macOS MCP Automation Server (macos-mcp-automation)

A Model Context Protocol (MCP) server providing rich macOS system automation, window management, and productivity tools.

Designed for AI agents, it allows tools like Claude Desktop to interact with your Mac, run AppleScripts, open applications, retrieve browser tabs, take silent screenshots, search files via Spotlight, adjust system settings, and more.

Quick Start (npx)

You can run this server directly via npx without installing it permanently:

{
  "mcpServers": {
    "macos-automation": {
      "command": "npx",
      "args": ["-y", "macos-mcp-automation"]
    }
  }
}

Add the configuration above to your client configuration file, for example:

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Cursor: Settings > Features > MCP

CLI Usage (Direct Terminal Commands)

In addition to starting an MCP server, this package works as a direct macOS desktop automation CLI. Running any command other than mcp triggers the action directly in your shell.

Examples:

  • Lock Screen: npx macos-mcp-automation lock
  • Volume control: npx macos-mcp-automation volume 50 (or npx macos-mcp-automation volume to print current volume)
  • Notification: npx macos-mcp-automation notify "Job complete!" "Build Agent"
  • Take Screenshot: npx macos-mcp-automation screenshot (saves to your Desktop)
  • Open App: npx macos-mcp-automation open "Spotify"
  • Fetch active window: npx macos-mcp-automation active-window
  • Show help guide: npx macos-mcp-automation help

macOS Security & Permissions

Because this tool simulates keystrokes and controls applications:

  1. When you run tools like type_text, press_key_combination, or get_active_window for the first time, macOS will show a permission popup asking to grant the terminal/client Accessibility or Automation permissions.
  2. Grant these permissions in System Settings > Privacy & Security > Accessibility and Automation for your terminal or Claude Desktop.

Available Tools

The server exposes 17 high-level tools:

System & Window Automation

  • run_applescript: Execute any raw AppleScript on your system.
  • open_app: Launch or focus any macOS application by name (e.g., "Safari", "Spotify", "Terminal").
  • quit_app: Quits or force-quits an application by name (e.g., "Safari").
  • list_apps: Returns a list of all currently open running applications.
  • get_active_window: Retrieves the name of the active frontmost application and its window title.
  • type_text: Simulates typing text character-by-character at the current cursor position.
  • press_key_combination: Synthesizes key strokes and shortcuts (e.g., ["command", "ctrl"] + "q" to lock).

System Controls

  • take_screenshot: Captures a full screenshot silently (no sound) and returns it directly to the LLM agent as a base64-encoded PNG image content block.
  • get_volume: Gets the current output volume percentage.
  • set_volume: Sets the output volume percentage (0-100).
  • adjust_brightness: Adjusts screen brightness up or down by a set number of steps.
  • lock_screen: Instantly locks the macOS screen.
  • sleep_mac: Puts the Mac to sleep.
  • display_notification: Displays a native macOS banner notification with title, subtitle, and body text.

Productivity & Clipboard

  • clipboard_get: Reads the text content currently stored in the system clipboard.
  • clipboard_set: Writes text content to the system clipboard.
  • spotlight_search: Searches files instantly using native macOS Spotlight (mdfind) with optional directory restriction.

Browser Control

  • get_browser_tabs: Fetches titles and URLs of all open tabs from Google Chrome, Safari, or both.
  • open_browser_url: Opens a URL in the system default browser or specifically Safari / Chrome.

Development & Local Testing

If you want to build and run the project locally:

1. Clone & Install Dependencies

git clone <repository-url>
cd macos_mcp
npm install

2. Build the Project

We use tsup to bundle TypeScript into a single-file executable ESM bundle inside dist/index.js:

npm run build

3. Run Locally (via absolute path)

Configure your MCP client to point to the local built file:

{
  "mcpServers": {
    "macos-automation-local": {
      "command": "node",
      "args": ["/Users/YOUR_USER/path/to/macos_mcp/dist/index.js"]
    }
  }
}

License

This project is licensed under the MIT License.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选