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
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.
git clone https://github.com/NakaokaRei/swift-mcp-gui.git
cd swift-mcp-gui
swift package experimental-install
{
"mcpServers" : {
"swift-mcp-gui" : {
"command" : "/Users/USERNAME/.swiftpm/bin/swift-mcp-gui"
}
}
}
The server provides the following tools for controlling macOS:
moveMousex: number (x-coordinate) - accepts integers, doubles, or string representationsy: number (y-coordinate) - accepts integers, doubles, or string representationsmouseClickbutton: string ("left" or "right")sendKeyskeys: array of strings (key names)scrolldirection: string ("up", "down", "left", "right")clicks: number (number of scroll clicks)getScreenSizegetPixelColorx: number (x-coordinate) - accepts integers, doubles, or string representationsy: number (y-coordinate) - accepts integers, doubles, or string representationscaptureScreenquality: number (optional, 0.0-1.0, default: 0.5) - JPEG compression qualityscale: number (optional, 0.1-1.0, default: 0.25) - Scale factor for image sizeoutput: string (optional, "path" or "image", default: "path") - Output formatoutput: "path" (default): Saves to a temporary file and returns the file path with dimensions. Reduces token consumption.output: "image": Returns inline image content for AI vision (e.g. Claude)captureRegionx: number (x-coordinate of the region)y: number (y-coordinate of the region)width: number (width of the region)height: number (height of the region)quality: number (optional, 0.0-1.0, default: 0.5) - JPEG compression qualityscale: number (optional, 0.1-1.0, default: 0.25) - Scale factor for image sizeoutput: string (optional, "path" or "image", default: "path") - Output formatoutput: "path" (default): Saves to a temporary file and returns the file path with dimensions. Reduces token consumption.output: "image": Returns inline image content for AI vision (e.g. Claude)saveScreenshotfilename: string (path to save the screenshot)x: number (optional, x-coordinate of the region)y: number (optional, y-coordinate of the region)width: number (optional, width of the region)height: number (optional, height of the region)quality: number (optional, 0.0-1.0, default: 0.1) - JPEG compression qualityscale: number (optional, 0.1-1.0, default: 0.25) - Scale factor for image sizeexecuteAppleScriptscript: string (AppleScript code to execute)executeAppleScriptFilepath: string (path to the AppleScript file)This 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.
MIT License
Install via CLI
npx mdskills install NakaokaRei/swift-mcp-guiSwift MCP GUI Server is a free, open-source AI agent skill. 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
Install Swift MCP GUI Server with a single command:
npx mdskills install NakaokaRei/swift-mcp-guiThis downloads the skill files into your project and your AI agent picks them up automatically.
Swift MCP GUI Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.