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:
moveMouse
x
: double (x-coordinate)y
: double (y-coordinate)mouseClick
button
: String ("left" or "right")sendKeys
keys
: Array of strings (key names)scroll
direction
: 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.