AppleScript Automation MCP
The AppleScript Automation MCP server lets you control and automate your Mac through an AI assistant (like Claude) using AppleScript and macOS CLIs.
App & System Control
Launch or quit any application, identify the frontmost app, and list all running apps
Toggle Dark Mode, lock the screen, and run arbitrary AppleScript (with safety blocks preventing destructive operations like delete, erase, shutdown, restart, or trash)
Audio & Volume
Get, set, mute, or unmute system output volume
System Info
Check battery status, local IP address, current date/time, disk usage, and memory statistics
Clipboard
Read and set clipboard text
Notifications & Speech
Display macOS notification banners and speak text aloud via text-to-speech
Web & Search
Open any URL in the default browser; perform Google or YouTube searches
Screen
Take a full screenshot and save it locally
Communication
Compose pre-filled emails (opens compose window, does not auto-send), send iMessages, start FaceTime calls, and look up contacts by name
Productivity
Create notes in Apple Notes, create reminders in the Reminders app, and open Maps with directions
Photos & Media
Search the Photos library by keyword
Control Spotify (play by URI, play/pause, next/previous, now-playing) and the Music app (play/pause, next/previous, search library)
Shortcuts
List and run any installed Apple Shortcut by name, enabling Focus modes, HomeKit automations, timers, and more
Provides tools to control Apple apps (Messages, Music, Photos, Contacts, System Events, etc.) and macOS system functions (volume, dark mode, lock screen, clipboard, notifications, text-to-speech, etc.) via AppleScript.
Enables searching Google via the search_google tool, which opens a URL in the default browser or performs a search.
Allows sending iMessages via the send_imessage tool.
Allows running macOS Shortcuts by name via the run_shortcut tool, acting as an escape hatch for custom automation.
Enables searching YouTube via the search_youtube tool.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AppleScript Automation MCP Check my battery level"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AppleScript Automation MCP
A local MCP server that exposes macOS automation actions (AppleScript + a few CLIs) as tools, so any MCP client running on your Mac (Claude Desktop, Cursor, etc.) can drive them.
It runs locally over stdio — osascript needs the real machine, so this can't
be a remote/hosted server. Non-destructive only: no delete/erase/shutdown/trash.
Quickstart
macOS, Python 3.10+. Clone and run the installer — it sets up a venv and wires the server into Claude Desktop for you:
git clone https://github.com/anmolol117/applescript-automation-mcp.git
cd applescript-automation-mcp
bash install.shThen quit Claude Desktop completely (Cmd-Q) and reopen it. That's it — the rest of this README is for manual setup, HTTP mode, and permissions.
install.sh backs up your existing claude_desktop_config.json (to .bak) and
merges in the applescript server without touching other servers.
Related MCP server: macos-mcp
Install the skill (recommended)
The server gives Claude the ability to act on your Mac. The bundled
mac-control skill teaches it when and how — known-good AppleScript
recipes, the lookup-then-execute pattern for music, and when to confirm
before acting. The tools work without it, but Claude reaches for them
less reliably.
install.sh builds dist/mac-control.zip. In Claude Desktop, go to
Customize → Skills → "+" and upload it, then toggle it on. Skills
install at the account level, so it follows you to claude.ai too.
To package it by hand:
cd skills && zip -r ../dist/mac-control.zip mac-controlThe zip must contain mac-control/ at the top level — zipping from the
repo root buries it under skills/ and the upload will fail.
The installed skill is a copy, not a link: pulling a new version of this repo won't update it. Re-upload after an update.
Install (manual)
pip install -r requirements.txt # or: pip install "mcp>=1.2.0"
python server.py # sanity check; Ctrl-C to stopPython 3.10+.
Connect a client
Claude Desktop (local). Install into a venv, then point the config at that
venv's Python (Claude Desktop launches with a minimal environment, so bare
python3 usually won't find mcp):
python3 -m venv .venv
.venv/bin/pip install -r requirements.txtEdit ~/Library/Application Support/Claude/claude_desktop_config.json with
absolute paths for both the interpreter and the script:
{
"mcpServers": {
"applescript": {
"command": "/ABSOLUTE/PATH/applescript-automation-mcp/.venv/bin/python",
"args": ["/ABSOLUTE/PATH/applescript-automation-mcp/server.py"]
}
}
}Quit Claude Desktop completely and reopen it. Connection status and logs live under Settings → Developer. Restart after any config edit.
Other MCP clients (Cursor, etc.) take the same command/args shape.
Run as an HTTP URL
The same file can serve over HTTP instead of stdio, for URL-based clients:
MCP_TRANSPORT=streamable-http python3 server.py
# serves at http://127.0.0.1:8000/mcpOverride MCP_HOST / MCP_PORT if needed. This still runs on your Mac —
it's a local URL, not a hosted one.
Using with Claude connectors — read this first
Claude custom connectors expect a public HTTPS MCP endpoint. This server
controls your Mac via osascript, so it can only ever run on your Mac — a
hosted connector on Anthropic's servers would have no Mac to control and every
tool would fail. There is no way to make this a normal hosted connector.
Two real options:
Local client (recommended). Use the stdio config above with a client that runs on your Mac (Claude Desktop, Cursor). No URL, no tunnel, nothing exposed to the internet.
Tunnel the local HTTP server (advanced, risky). Run the HTTP mode and expose it with a tunnel (e.g.
cloudflared tunnel --url http://localhost:8000orngrok http 8000), then give Claude the public…/mcpURL. This works only while your Mac and the tunnel stay up, and it exposes full control of your Mac to a public URL — anyone who reaches it can run these tools. Only do this behind authentication you add yourself, and never leave it running.
Push to GitHub
git init && git add . && git commit -m "AppleScript automation MCP server"
git branch -M main
git remote add origin https://github.com/anmolol117/applescript-automation-mcp.git
git push -u origin mainThe repo is the source; users clone it and connect via stdio (option 1). A GitHub URL is not itself an MCP endpoint.
Permissions (required)
The first time a tool controls an app, macOS prompts for permission. Approve them, or pre-grant under System Settings → Privacy & Security:
Automation — the client app (or the terminal launching the server) must be allowed to control Messages, Notes, Mail, Spotify, Photos, Contacts, System Events, etc.
Accessibility — needed by tools that send keystrokes (
search_photos).Screen Recording — needed for
screenshot.
If a tool returns a permission error, it's one of these grants.
Tools
Actions: run_applescript, open_app, close_app, set_volume, mute,
unmute, toggle_dark_mode, lock_screen, set_clipboard, notify, say,
open_url, search_google, search_youtube, screenshot, compose_mail,
send_imessage, facetime_call, create_note, create_reminder,
maps_directions, search_photos, spotify_play, spotify_control,
run_shortcut.
Read-only: frontmost_app, list_running_apps, get_volume, is_muted,
battery_status, get_ip, get_datetime, disk_usage, memory_stats,
get_clipboard, lookup_contact, now_playing, list_shortcuts.
run_applescript is the primary tool — most actions are better expressed as a
script than as a wrapper. The wrappers exist for things AppleScript can't reach
directly (screenshot, battery_status, clipboard, Shortcuts) and for the
handful of recipes worth having pinned.
Music
Playback targets Spotify, not the Music app. spotify_play takes a Spotify
URI:
spotify_play(track_uri="spotify:track:3WFgRhgECxQYyy8Ldhk2PG")Resolve the URI first — the Spotify connector's search, or any Spotify client's
"Copy Spotify URI". spotify_control handles play/pause/next/previous, and
now_playing reports the current Spotify track.
Model guidance
Two things steer how a model uses this server:
The
INSTRUCTIONSstring inserver.py, returned on initialize and in context every session. It says the server is for executing, not describing, and that other connectors are for lookup while this one acts.Tool docstrings, written as triggers ("use when the user says play, put on, open…") rather than labels. This matters more than it looks — a model picks tools by matching intent against descriptions.
The bundled
mac-controlskill, which carries the longer recipes and user defaults that don't fit inINSTRUCTIONS. See Install the skill.
Safety
run_applescript refuses destructive constructs — delete, erase,
empty trash, shutdown, restart, sudo, rm -rf, diskutil. The check
strips string literals before matching, so an email body containing the word
"delete" is fine while delete note 1 is blocked.
This is a guardrail against accidents, not a security boundary. It can't see
inside do shell script, so a destructive shell command in a quoted string will
pass. Anyone who can reach this server can run arbitrary AppleScript on your
Mac — which is the whole point, and the reason not to expose it publicly.
Notes
run_shortcutis the escape hatch: build anything in the Shortcuts app — Focus modes, HomeKit, timers — and call it by name. Input passing isn't wired up; add-i <file>inrun_shortcutif a shortcut needs input. Names must match exactly; check withlist_shortcutsfirst.compose_mailopens a populated compose window via AppleScript and does not send. It used to build amailto:URL, which turned spaces into+and truncated long bodies.send_imessageuses the classicservice type = iMessageselector, which can break on some macOS versions if no iMessage account is active; check Messages is signed in if it errors.create_notewrites to the iCloud account's "Notes" folder. The Notesbodyis HTML, so line breaks are<div>wrapped rather than\n.All AppleScript string interpolation goes through
_as(), which keeps non-ASCII intact — plainjson.dumpsemits\uXXXXescapes that AppleScript doesn't decode, mangling accents and emoji.Every tool returns
{ok, output, error}and never hangs — subprocess calls time out instead of blocking the client.
Available Tools
39 toolsbattery_statusBRead-only
Battery charge and power source.
Inputs: no named parameters.
close_appA
Quit an application by name.
Inputs: name (required).
compose_mailA
Open a pre-filled mail compose window (does not send).
Inputs: cc, to, bcc, body, +1 more.
create_reminderC
Create a reminder in the Reminders app.
Inputs: title (required), notes.
disk_usageARead-only
Disk usage for the startup volume.
Inputs: no named parameters.
facetime_callA
Start a FaceTime call to a phone number or email.
Inputs: target (required).
frontmost_appBRead-only
Name of the app currently in the foreground.
Inputs: no named parameters.
get_clipboardARead-only
Read the current clipboard text.
Inputs: no named parameters.
get_datetimeARead-only
Current local date and time.
Inputs: no named parameters.
get_ipARead-only
Local IP address on en0.
Inputs: no named parameters.
get_volumeARead-only
Current system output volume (0-100).
Inputs: no named parameters.
is_mutedARead-only
Whether system output is muted (true/false).
Inputs: no named parameters.
list_running_appsARead-only
List visible (non-background) running application names.
Inputs: no named parameters.
list_shortcutsARead-only
List the names of the user's installed Apple Shortcuts.
Inputs: no named parameters.
lock_screenA
Lock the screen.
Inputs: no named parameters.
lookup_contactARead-only
Look up a contact by name; returns matching names with phones and emails.
Inputs: name (required).
maps_directionsC
Open Maps with directions to a destination.
Inputs: destination (required).
memory_statsARead-only
Virtual memory statistics (vm_stat).
Inputs: no named parameters.
music_nextA
Skip to the next track in the Music app.
Inputs: no named parameters.
music_playpauseA
Toggle play/pause in the Music app.
Inputs: no named parameters.
music_previousA
Go to the previous track in the Music app.
Inputs: no named parameters.
muteA
Mute system output.
Inputs: no named parameters.
notifyA
Show a macOS notification banner.
Inputs: title (required), message (required).
now_playingARead-only
Current track in the Music app, if playing.
Inputs: no named parameters.
open_appA
Launch/activate an application by name (e.g. "Safari").
Inputs: name (required).
open_urlB
Open a URL (or file/URI scheme) in the default handler.
Inputs: url (required).
run_applescriptA
Run an arbitrary AppleScript and return its result.
Destructive scripts (delete, erase, shutdown, restart, trash, etc.) are refused for safety — do those manually.
Inputs: script (required).
run_shortcutB
Run an Apple Shortcut by name (unlocks Focus modes, HomeKit, timers, etc.).
Inputs: name (required).
sayB
Speak text aloud via text-to-speech.
Inputs: text (required).
screenshotA
Capture the full screen to ~/.applescript-mcp/screenshot.png and return its path.
Inputs: no named parameters.
search_googleA
Open a Google search for the query in the browser.
Inputs: query (required).
search_music_trackC
Open Music and search the library for a track.
Inputs: query (required).
search_photosC
Open Photos and search for a term.
Inputs: query (required).
search_youtubeB
Open a YouTube search for the query in the browser.
Inputs: query (required).
send_imessageB
Send an iMessage to a phone number or email handle.
Inputs: message (required), recipient (required).
set_clipboardA
Replace the clipboard contents with text.
Inputs: text (required).
set_volumeA
Set system output volume (0-100).
Inputs: level (required).
toggle_dark_modeA
Toggle macOS Dark Mode.
Inputs: no named parameters.
unmuteA
Unmute system output.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 39 tools
Each tool has a clear, distinct purpose covering system info, app management, media, communication, and utilities. There is no overlap that would confuse an agent; even closely related tools like mute and is_muted or set_volume and get_volume are easily distinguishable by their action vs. query nature.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., close_app, get_volume, send_imessage). There are no mixed conventions or abbreviations, making the naming predictable and easy to understand.
With 39 tools, the server is extensive but still well-scoped for a general macOS automation tool. While slightly high, each tool addresses a distinct operation, and the count feels appropriate for the broad domain covered.
The tool set covers many common automation tasks (system info, apps, media, messaging, clipboard, reminders, shortcuts), but it lacks tools for file operations, calendar, browser control beyond opening URLs, and system preferences beyond volume/dark mode. These gaps limit its ability to handle some typical workflows.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for macOS Automator that enables AI to control Mac computers by executing AppleScript/JXA, running automation workflows, and performing system-level tasks like sending emails and organizing files.67 npm4MIT
- AlicenseNot gradedqualityAmaintenanceA lightweight MCP server that bridges AI agents and macOS, enabling automation of file navigation, application control, UI interaction, browser automation, and system operations.239MIT
- AlicenseNot gradedqualityAmaintenanceOpen-source, local macOS MCP server for AI agents. Automate background Safari/Chrome tabs, native apps, files and shell with scoped permissions, optional approvals and delegated coding agents.97MIT
- AlicenseBqualityDmaintenanceMCP server that enables AI to fully control macOS — mouse, keyboard, terminal, screenshots, window management, UI element detection, and provides AI-optimized information reporting.3629 npmMIT