MCP server for controlling macOS features (volume, mail) via AppleScript
npm install macos-mcpA comprehensive Model Context Protocol (MCP) server that provides tools for controlling macOS system features via AppleScript. Control your Mac's applications, system settings, and more through a simple interface.
get_volume_settings - Get all volume settings (output, input, alert, mute status)get_volume - Get current output volume (0-100)set_volume - Set output volume levelis_muted - Check if audio is mutedmute - Mute audio outputunmute - Unmute audio outputtoggle_mute - Toggle mute statebeep - Play system beep soundcalendar_list_calendars - List all calendarscalendar_list_events - List calendar events with date filteringcalendar_create_event - Create new calendar events with location, notes, and morecalendar_delete_event - Delete calendar events by titlechrome_get_all_tabs - List all tabs across all Chrome windowschrome_get_active_tab - Get the currently active tabchrome_open_url - Open a URL in a new tabchrome_close_tab - Close a specific tabchrome_reload_tab - Reload a specific tabchrome_execute_javascript - Execute JavaScript in a tabchrome_get_windows - List all Chrome windowschrome_scroll - Scroll a page by pixels or to top/bottomcontacts_list_people - List all contactscontacts_create_contact - Create a new contact with name, email, phone, organizationcontacts_delete_contact - Delete a contactcontacts_list_groups - List all contact groupscontacts_search - Search contacts by name, email, or organizationcontacts_update - Update existing contact informationcontacts_add_to_group - Add a contact to a groupfinder_open_path - Open files or folders in Finderfinder_new_window - Open a new Finder windowfinder_get_selection - Get currently selected itemsfinder_get_current_path - Get the current Finder directoryfinder_set_view - Change Finder view modefinder_search - Search for files in Finderfinder_move_to_trash - Move files to trashfinder_empty_trash - Empty the trashfinder_create_folder - Create a new folderget_mail_accounts - List configured Apple Mail accountsget_mails - Get emails from inboxcompose_mail - Compose new email with recipients, subject, bodysearch_mails - Search emails by subject, sender, or contentcheck_mail - Check for new mailget_unread_count - Get unread counts per mailboxget_total_unread_count - Get total unread countnotes_list_folders - List all Notes foldersnotes_list_notes - List notes from a foldernotes_create_note - Create a new note (supports HTML)notes_delete_note - Delete a notenotes_update - Update note contentnotes_search - Search notes by title or contentnotes_create_folder - Create a new foldernotes_move - Move a note to a different foldernotes_get - Get details of a specific notenotes_delete_folder - Delete a foldernotes_get_folder_info - Get folder informationnotes_search_in_folder - Search within a specific foldernotes_search_by_title - Search by title onlyreminders_get_lists - Get all reminder listsreminders_get_reminders - Get reminders from a listreminders_create_reminder - Create a new reminder with due date and priorityreminders_complete_reminder - Mark a reminder as completedreminders_delete_reminder - Delete a reminderreminders_update - Update reminder detailsreminders_create_list - Create a new reminder listreminders_delete_list - Delete a reminder listreminders_search - Search reminders by title or bodysafari_get_all_tabs - List all tabs across all Safari windowssafari_get_active_tab - Get the currently active tabsafari_open_url - Open a URL in a new tabsafari_close_tab - Close a specific tabsafari_reload_tab - Reload a specific tabsafari_execute_javascript - Execute JavaScript in a tabsafari_get_windows - List all Safari windowssafari_navigate - Navigate to a URL in the current tabsafari_search_web - Perform a web searchsafari_go_back - Navigate back in historysafari_go_forward - Navigate forward in historyterminal_get_windows - List all Terminal windowsterminal_get_tabs - List tabs in a windowterminal_execute_command - Execute a command in a tabterminal_new_window - Create a new Terminal windowterminal_new_tab - Create a new tabterminal_close_tab - Close a specific tabterminal_get_current_directory - Get current working directoryterminal_get_contents - Get terminal output contentsterminal_clear - Clear the terminal screen``bash`
npm install -g macos-mcpor
bunx macos-mcp
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
`json`
{
"mcpServers": {
"macos": {
"command": "bunx",
"args": ["macos-mcp"]
}
}
}
Or if installed globally:
`json`
{
"mcpServers": {
"macos": {
"command": "macos-mcp"
}
}
}
Add to your Claude Code MCP settings (~/.claude/settings.json):
`json`
{
"mcpServers": {
"macos": {
"command": "bunx",
"args": ["macos-mcp"]
}
}
}
`bashWith bun
bun run macos-mcp
$3
The project also includes an interactive CLI for testing and manual control:
`bash
Run the CLI
bun run cliOr with npm
npm run cli
`See cli/README.md for more details on the interactive CLI.
$3
`bash
npx @modelcontextprotocol/inspector bunx macos-mcp
`Permissions
This MCP server uses AppleScript to control macOS features. You may need to grant permissions:
1. Accessibility: System Settings > Privacy & Security > Accessibility
2. Automation: System Settings > Privacy & Security > Automation
3. Application Permissions: When first accessing apps (Mail, Calendar, Contacts, Notes, Reminders), macOS will prompt for permission
Project Structure
`
cli/ # Interactive CLI interface
├── audio.ts # Audio controls
├── calendar.ts # Calendar management
├── chrome.ts # Chrome browser control
├── contacts.ts # Contacts management
├── finder.ts # Finder operations
├── mail.ts # Mail operations
├── notes.ts # Notes management
├── reminders.ts # Reminders management
├── safari.ts # Safari browser control
├── terminal.ts # Terminal control
└── index.ts # CLI entry pointmcp/ # MCP server
├── index.ts # Tool definitions and handlers
├── macos-mcp.ts # MCP server entry point
├── tools/ # Tool definitions
└── handlers/ # Tool handlers
src/ # Core functionality
├── audio/ # Audio control functions
├── calendar/ # Calendar functions
├── chrome/ # Chrome automation
├── contacts/ # Contacts management
├── finder/ # Finder operations
├── mail/ # Apple Mail functions
├── notes/ # Notes functions
├── reminders/ # Reminders functions
├── safari/ # Safari automation
└── terminal/ # Terminal control
`Development
$3
`bash
Clone the repo
git clone https://github.com/kartikk-k/macos-mcp.git
cd macos-mcpInstall dependencies
bun installRun the MCP server
bun run startRun the interactive CLI
bun run cliTest with inspector
bun run inspector
`$3
1. Add your function to the appropriate module in
src/
2. Export it from the module's index.ts
3. Add the tool definition to mcp/tools/{module}.ts
4. Add the handler in mcp/handlers/{module}.ts
5. (Optional) Add CLI interface in cli/{module}.ts`See CLAUDE.md for detailed development guidelines.
MIT