The goal is to create a comprehensive Model Context Protocol (MCP) server for full macOS system control through AppleScript. This server provides both raw AppleScript execution capabilities and structured tools for common macOS operations like window management, system information, and application control.
Originally forked from peakmojo/applescript-mcp, but the intention is to expanded towards a full-fledged macOS automation platform with dedicated modules for commonly used applications and system functions.
- Full macOS System Control: Comprehensive automation of macOS through AppleScript
- Modular Architecture: Dedicated modules for specific applications
- Structured Tools: High-level tools for common operations alongside raw AppleScript access
- Raw AppleScript Execution: Run any AppleScript code for maximum flexibility
- Structured Window Management: Dock windows horizontally using percentage bounds
- System Information: Get screen resolution, system specs, and window details
- Application Control: Foreground applications and manage processes
- Dynamic Screen Detection: Automatically fetch screen dimensions for precise positioning
- Modular Design: Easy to extend with new application-specific modules
applescript_execute: Execute raw AppleScript code for maximum flexibilityget_screen_resolution: Get current screen resolution and display informationget_system_info: Get macOS version, computer name, and memory informationget_window_info: Get position and size information for windows
dock_window_horizontal: Position windows using percentage bounds- Example:
dock_window_horizontal("iTerm", 0, 50)- dock iTerm to left half - Example:
dock_window_horizontal("Safari", 50, 100)- dock Safari to right half - Example:
dock_window_horizontal("Code", 25, 75)- dock VSCode to middle 50%
- Example:
foreground_window: Bring a specific application to the foreground
Dock iTerm to the left half of my screen
Position Safari on the right third of my screen
Move VSCode to take up the middle 60% of my screen
What's my current screen resolution?
Show me my system information
Get the position and size of the frontmost window
Create a new note in Apple Notes with today's date
Get my current battery percentage
List all running applications
- macOS system
- Python 3.10+
- uv package manager
-
Install uv:
brew install uv
-
Clone this repository:
git clone <repository-url> cd applescript-mcp
-
The server will automatically install dependencies when run with uv.
Add this to your Claude Desktop mcp.json configuration:
{
"mcpServers": {
"macos-control": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/your/applescript-mcp",
"python",
"-m",
"src.applescript_mcp"
],
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}Replace /path/to/your/applescript-mcp with the actual path to your cloned repository.
The server uses a modular architecture located in src/applescript_mcp/:
tools/macos.py- Core macOS system toolsutils/applescript.py- AppleScript execution utilitiesserver.py- Main MCP server
To add new application-specific modules, create new files in the tools/ directory following the same pattern as macos.py.