A Model Context Protocol (MCP) server that allows controlling macOS through SwiftAutoGUI. This server provides tools for programmatically controlling the mouse and keyboard through MCP clients. - macOS 15.0 or later - Swift 6.0 or later - Xcode 16.0 or later 1. Clone this repository: 3. Add command to your MCP client. The server provides the following tools for controlling macOS: - Tool name: move
Add this skill
npx mdskills install NakaokaRei/swift-mcp-guiComprehensive macOS automation server with 11 well-documented tools for GUI control and screen capture
1# Swift MCP GUI Server23A Model Context Protocol (MCP) server that allows controlling macOS through [SwiftAutoGUI](https://github.com/NakaokaRei/SwiftAutoGUI). This server provides tools for programmatically controlling the mouse and keyboard through MCP clients.45## Requirements67- macOS 15.0 or later8- Swift 6.0 or later9- Xcode 16.0 or later1011## Installation12131. Clone this repository:14```bash15git clone https://github.com/NakaokaRei/swift-mcp-gui.git16cd swift-mcp-gui17```18192. Install20```bash21swift package experimental-install22```23243. Add command to your MCP client.25```json26{27 "mcpServers" : {28 "swift-mcp-gui" : {29 "command" : "/Users/USERNAME/.swiftpm/bin/swift-mcp-gui"30 }31 }32}3334```3536## Available Tools3738The server provides the following tools for controlling macOS:3940### 1. Mouse Movement41- Tool name: `moveMouse`42- Input:43 - `x`: number (x-coordinate) - accepts integers, doubles, or string representations44 - `y`: number (y-coordinate) - accepts integers, doubles, or string representations45- Moves the mouse cursor to the specified coordinates4647### 2. Mouse Clicks48- Tool name: `mouseClick`49- Input:50 - `button`: string ("left" or "right")51- Performs a mouse click at the current cursor position5253### 3. Keyboard Input54- Tool name: `sendKeys`55- Input:56 - `keys`: array of strings (key names)57- Sends keyboard shortcuts or key combinations58- Example keys: "command", "control", "option", "shift", "return", "space", "a", "1", etc.5960### 4. Scrolling61- Tool name: `scroll`62- Input:63 - `direction`: string ("up", "down", "left", "right")64 - `clicks`: number (number of scroll clicks)65- Performs scrolling in the specified direction6667### 5. Screen Size68- Tool name: `getScreenSize`69- Returns the main screen dimensions (width and height)7071### 6. Pixel Color72- Tool name: `getPixelColor`73- Input:74 - `x`: number (x-coordinate) - accepts integers, doubles, or string representations75 - `y`: number (y-coordinate) - accepts integers, doubles, or string representations76- Returns the RGBA color values (0-255) of the pixel at the specified coordinates7778### 7. Capture Screen79- Tool name: `captureScreen`80- Input:81 - `quality`: number (optional, 0.0-1.0, default: 0.5) - JPEG compression quality82 - `scale`: number (optional, 0.1-1.0, default: 0.25) - Scale factor for image size83 - `output`: string (optional, "path" or "image", default: "path") - Output format84- `output: "path"` (default): Saves to a temporary file and returns the file path with dimensions. Reduces token consumption.85- `output: "image"`: Returns inline image content for AI vision (e.g. Claude)8687### 8. Capture Region88- Tool name: `captureRegion`89- Input:90 - `x`: number (x-coordinate of the region)91 - `y`: number (y-coordinate of the region)92 - `width`: number (width of the region)93 - `height`: number (height of the region)94 - `quality`: number (optional, 0.0-1.0, default: 0.5) - JPEG compression quality95 - `scale`: number (optional, 0.1-1.0, default: 0.25) - Scale factor for image size96 - `output`: string (optional, "path" or "image", default: "path") - Output format97- `output: "path"` (default): Saves to a temporary file and returns the file path with dimensions. Reduces token consumption.98- `output: "image"`: Returns inline image content for AI vision (e.g. Claude)99100### 9. Save Screenshot101- Tool name: `saveScreenshot`102- Input:103 - `filename`: string (path to save the screenshot)104 - `x`: number (optional, x-coordinate of the region)105 - `y`: number (optional, y-coordinate of the region)106 - `width`: number (optional, width of the region)107 - `height`: number (optional, height of the region)108 - `quality`: number (optional, 0.0-1.0, default: 0.1) - JPEG compression quality109 - `scale`: number (optional, 0.1-1.0, default: 0.25) - Scale factor for image size110- Captures the screen or a region and saves it to a file111- File format is determined by the filename extension (.jpg, .jpeg, .png)112- Quality parameter only affects JPEG files113114### 10. Execute AppleScript115- Tool name: `executeAppleScript`116- Input:117 - `script`: string (AppleScript code to execute)118- Executes AppleScript code directly and returns the result119- Returns "AppleScript Result: <result>" if the script returns a value120- Returns "AppleScript executed successfully (no result returned)" if the script completes without returning a value121122### 11. Execute AppleScript File123- Tool name: `executeAppleScriptFile`124- Input:125 - `path`: string (path to the AppleScript file)126- Executes an AppleScript from a file and returns the result127- Returns "AppleScript Result: <result>" if the script returns a value128- Returns "AppleScript file executed successfully (no result returned): <path>" if the script completes without returning a value129130## Security Considerations131132This server requires full accessibility permissions in System Preferences to control your mouse and keyboard. Be careful when running it and only connect trusted MCP clients.133134## License135136MIT License137
Full transparency — inspect the skill content before installing.