mcp -macos-use
AI agent that controls computer with OS-level tools, MCP compatible, works with any model
claude mcp add --transport stdio mediar-ai-mcp-server-macos-use ./.build/debug/mcp-server-macos-use
How to use
The mcp-server-macos-use is a Swift-based MCP server that exposes tooling to control macOS applications via the MacosUseSDK. It listens for MCP commands over standard input/output (stdio) and provides tools to open or activate applications, interact with their UI via simulated clicks and keystrokes, and traverse the accessibility tree for inspection. Through the available tools—macos-use_open_application_and_traverse, macos-use_click_and_traverse, macos-use_type_and_traverse, macos-use_press_key_and_traverse, and macos-use_refresh_traversal—you can automate UI tasks, gather UI state, and integrate with MCP clients like Claude Desktop. Each tool accepts parameters to target a specific application (by name, PID, bundle ID, or file path) and perform actions that are followed by a traversal of the accessibility hierarchy, enabling structured results for clients to consume.
To use the server, ensure it is running and connect your MCP client to its stdio interface. Invoke one of the available tools via the CallTool MCP method, supplying the required parameters (and optional action modifiers) as described in the README. The server will perform the requested action through MacosUseSDK and return the traversal results, enabling you to inspect UI structure, element properties, and current state after the action.
How to install
Prerequisites:
- macOS machine with Swift toolchain installed (swift build).
- Access to MacosUseSDK (as a Swift package) referenced by the project.
Installation steps:
- Clone the repository containing the mcp-server-macos-use source.
- Install dependencies (as appropriate for the project, typically via Swift Package Manager).
- Build the server in debug or release mode:
swift build -c debug
- Run the server binary that is produced:
./.build/debug/mcp-server-macos-use
- Configure your MCP client (e.g., Claude Desktop) to connect to the server by specifying the path to the executable in the mcpServers section, for example:
{
"mcpServers": {
"mcp-server-macos-use": {
"command": "/path/to/your/project/mcp-server-macos-use/.build/debug/mcp-server-macos-use"
}
}
}
Ensure MacosUseSDK is properly linked and available to the built binary at runtime.
Additional notes
Tips and considerations:
- The server relies on the MacosUseSDK for controlling macOS UI elements; ensure the SDK is correctly linked and accessible to the binary.
- The tools perform an accessibility tree traversal after actions by default; you can modify behavior with optional ActionOptions such as traverseBefore, traverseAfter, and onlyVisibleElements if supported by your build.
- When using macos-use_click_and_traverse, provide precise coordinates relative to the target window; for macos-use_type_and_traverse and macos-use_press_key_and_traverse, PID targeting is required.
- If you encounter permissions issues, ensure the running process has accessibility permissions granted in macOS System Settings for Automation.
- Use macos-use_refresh_traversal to fetch current UI state without taking any action, which is useful for polling UI state in automation loops.
Related MCP Servers
swift-sdk
The official Swift SDK for Model Context Protocol servers and clients.
memory
A Model Context Protocol server that provides knowledge graph management capabilities.
Claude-Project-Coordinator
Claude Project Coordinator is a Swift-powered MCP (Model Context Protocol) server designed to streamline multi-project Xcode development. It lets you track project status, auto-detect frameworks, search code patterns, and maintain a structured development knowledge base — all locally, with Claude Desktop as your assistant.
shortcuts
Shortcuts + MCP = ♥️
macPilotCli
MacPilot CLI is a mcp server, It provides a collection of system tools that allow AI assistants to perform various operations on macOS systems.
riffmcp
Native macOS MCP server that lets LLMs compose and play music