Get the FREE Ultimate OpenClaw Setup Guide →

swift -gui

MCP server that can execute commands such as keyboard input and mouse movement on macOS

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nakaokarei-swift-mcp-gui /Users/USERNAME/.swiftpm/bin/swift-mcp-gui

How to use

This MCP server exposes a Swift-based GUI controller for macOS that leverages SwiftAutoGUI to programmatically control the mouse, keyboard, and screen interactions. It provides a suite of tools that can be invoked by MCP clients to simulate user input, capture screen data, and query display information. The available tools include mouse movement (moveMouse), mouse clicks (mouseClick), keyboard input (sendKeys), scrolling (scroll), screen size (getScreenSize), pixel color sampling (getPixelColor), full-screen capture (captureScreen), region capture (captureRegion), saving screenshots (saveScreenshot), and AppleScript execution (executeAppleScript and executeAppleScriptFile). These tools enable automation tasks such as UI testing, automated workflows, and macro-like control of macOS applications via MCP clients.

How to install

Prerequisites:\n- macOS 15.0 or later\n- Swift 6.0 or later\n- Xcode 16.0 or later\n\nInstallation steps:\n1. Clone the repository:\nbash\ngit clone https://github.com/NakaokaRei/swift-mcp-gui.git\ncd swift-mcp-gui\n\n2. Install the package:\nbash\nswift package experimental-install\n\n3. Add command to your MCP client configuration as shown below. Replace USERNAME with your actual user name:\njson\n{\n "mcpServers" : {\n "swift-mcp-gui" : {\n "command" : "/Users/USERNAME/.swiftpm/bin/swift-mcp-gui"\n }\n }\n}\n

Additional notes

Notes:\n- This server requires macOS accessibility permissions to control the mouse and keyboard. Ensure you grant the proper permissions in System Settings (Security & Privacy) under Accessibility.\n- The SwiftMCP GUI server is designed for macOS environments and relies on SwiftAutoGUI for input automation.\n- If the binary path changes, update the mcp_config accordingly.\n- No additional environment variables are required by default, but you can extend environment settings in your MCP client as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers