Are you the author? Sign in to claim
mcp-applescript
An MCP (Model Context Protocol) server that enables Large Language Models to execute AppleScript commands on macOS. This allows LLMs to interact with and automate macOS applications through natural language requests.
Using uv:
uv pip install mcp-applescript
Or install from source:
git clone https://github.com/pietz/mcp-applescript.git
cd mcp-applescript
uv sync
mcp-applescript
The server runs using stdio transport, making it compatible with any MCP client.
run_applescriptExecute an AppleScript command on macOS.
Parameters:
script (string): The AppleScript code to executeReturns:
Example:
tell application "Mail"
get subject of first message of inbox
end tell
get_server_statusGet the current server configuration and security settings.
Returns:
Example Response:
{
"server": "MCP AppleScript",
"version": "0.1.0",
"security": {
"allowed_apps": ["Mail", "Calendar"],
"block_dangerous": true,
"timeout_seconds": 30
}
}
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"applescript": {
"command": "mcp-applescript",
"env": {
"ALLOWED_APPS": "mail,calendar,contacts,notes",
"BLOCK_DANGEROUS": "true"
}
}
}
}
ALLOWED_APPS (optional)
"mail,calendar,contacts" (lowercase recommended)"*")"*": Explicitly allows all applications"" (empty string): Blocks all applications (lockdown mode)BLOCK_DANGEROUS (optional)
"true" or "false""true"do shell script, file system access, system control commandsTIMEOUT (optional)
"30""env": {
// ALLOWED_APPS not set = allow all apps
"BLOCK_DANGEROUS": "true" // This is the default, can be omitted
}
"env": {
"ALLOWED_APPS": "mail,calendar,contacts",
"BLOCK_DANGEROUS": "true"
}
"env": {
"ALLOWED_APPS": "*", // or omit this line
"BLOCK_DANGEROUS": "false"
}
"env": {
"ALLOWED_APPS": "" // Empty string = block all
}
Application Allowlist (optional)
ALLOWED_APPS to restrict to specific applicationsDangerous Pattern Detection
do shell script)/System, /Library, ~/.ssh)Execution Timeout
-- ❌ BLOCKED: Shell command execution
do shell script "rm -rf ~/"
-- ❌ BLOCKED: System control
tell application "System Events" to shut down
-- ❌ BLOCKED: Sensitive file access
do shell script "cat ~/.ssh/id_rsa"
-- ❌ BLOCKED: Unauthorized application (if not in ALLOWED_APPS)
tell application "Terminal" to do script "echo test"
-- ✅ ALLOWED: Reading from allowed app
tell application "Mail"
get subject of first message of inbox
end tell
ALLOWED_APPS to only the applications you need for production useget_server_status tool to understand current configurationBefore running scripts, check what's allowed:
User: "What can you access on my system?"
LLM uses: get_server_status()
Response: "I can currently access: Mail, Calendar, and Contacts.
Dangerous operations are blocked, and scripts timeout after 30 seconds."
tell application "Mail"
get subject of first message of inbox
end tell
tell application "Calendar"
get summary of every event of calendar "Work"
end tell
-- This will be BLOCKED if "System Events" not in ALLOWED_APPS
tell application "System Events"
name of first process whose frontmost is true
end tell
-- Safe if no dangerous patterns
display notification "Hello from MCP!" with title "AppleScript"
MIT
Paul-Louis Pr�ve
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows