mcp-osascript — Claude Code MCP server: what it does, how to install
Automates macOS with 18 typed tools for window tiling, menu clicks, clipboard reads, and browser tab queries. Ideal for giving AI direct control over the desktop.
claude mcp add mcp-osascript -- npx -y mcp-osascriptWhat mcp-osascript does
The server equips your assistant with 18 typed tools powered by AppleScript and JXA. It handles window placement, key presses, simulated typing up to 500 characters, window screenshots, and running Apple Shortcuts. If a requested menu item is missing, the server returns the valid entries at that menu level so the model corrects its own call automatically.
Running the package requires macOS 13+ and Node 18+. Without macOS Accessibility, Automation, and Screen Recording permissions granted to your terminal or host client, tools that manage windows or capture pixels will fail immediately. The process isolates environment variables strictly to PATH, HOME, and LANG, alongside a URL scheme allowlist restricted to http, https, and mailto.
What it helps with
- reposition and resize application windows across displays
- inspect active tab titles and URLs in Safari, Chrome, or Arc
- trigger nested menu bar items inside native desktop apps
- capture screenshots of a specific window instead of the full screen
- execute system Shortcuts directly by name
Example prompts for the agent
- Grab a screenshot of the active browser window and save it to my Desktop
- List the titles and URLs of all tabs currently open in Arc
- Trigger the export command under the File menu in Keynote
How to install mcp-osascript
Platform CLI
claude mcp add mcp-osascript -- npx -y mcp-osascriptPlatform CLI
codex mcp add mcp-osascript -- npx -y mcp-osascriptConfig file
{
"mcpServers": {
"mcp-osascript": {
"command": "npx",
"args": [
"-y",
"mcp-osascript"
]
}
}
}Config file
{
"servers": {
"mcp-osascript": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-osascript"
]
}
}
}Platform CLI
gemini mcp add mcp-osascript npx -y mcp-osascriptStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-osascript
How to install mcp-osascript in Claude Code?
Run claude mcp add mcp-osascript -- npx -y mcp-osascript in your terminal to register the server.
What does mcp-osascript do?
It gives your assistant structured tools to interact with macOS, covering window management, menu navigation, simulated keystrokes, browser tab reading, and AppleScript execution.
What system permissions does mcp-osascript require?
Window manipulation, menus, and keystrokes require Accessibility privileges, browser inspection needs Automation permissions, and window captures rely on Screen Recording access.