A Model Context Protocol (MCP) server that allows controlling macOS through SwiftAutoGUI. This server provides tools for programmatically controlling the mouse and keyboard via MCP clients.
shell
git clone https://github.com/NakaokaRei/swift-mcp-gui.git
cd swift-mcp-gui
shell
swift package experimental-install
json
{
"mcpServers" : {
"swift-mcp-gui" : {
"command" : "/Users/USERNAME/.swiftpm/bin/swift-mcp-gui"
}
}
}
The server provides the following tools for controlling macOS:
moveMousex: double (x-coordinate)y: double (y-coordinate)mouseClickbutton: String ("left" or "right")sendKeyskeys: Array of strings (key names)scrolldirection: String ("up", "down", "left", "right")clicks: Integer (number of scroll clicks)This server has full control over your mouse and keyboard. Be cautious when running it and only connect trusted MCP clients.