mcp-osascript

by m0rvayne

142 downloads Not rated yet

About

Let Claude control your Mac — 12 typed tools for windows, menus, keyboard, clipboard, browser tabs

Explore

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name mcp-osascript
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp-osascript": {
            "server": {
                "command": "npx",
                "args": [
                    "-y",
                    "mcp-osascript"
                ]
            }
        }
    }
}

McpServers

{
    "server": {
        "command": "npx",
        "args": [
            "-y",
            "mcp-osascript"
        ]
    }
}

Transport

"stdio"

Package

"mcp-osascript"

Registry

"npm"

Let Claude control your Mac.Move windows, click menus, type text, read clipboard, manage browser tabs — 12 typed tools with input validation and security guardrails.

{ "mcpServers": { "osascript": { "command": "npx", "args": ["-y", "mcp-osascript"] } } }

Add this to your Claude Desktop config (Settings → Developer → Edit Config), restart Claude, and you're ready.

{ "mcpServers": { "osascript": { "command": "npx", "args": ["-y", "mcp-osascript"] } } }
claude mcp add osascript -- npx -y mcp-osascript
git clone https://github.com/m0rvayne/mcp-osascript.git cd mcp-osascript && npm install # then use: "command": "node", "args": ["/path/to/mcp-osascript/server/index.js"]

12 typed tools, each with input validation, error classification, and permission-aware error messages.

When Claude tries to click a menu item that doesn't exist, the server automatically returns the list of available items at that level — so Claude can retry with the correct name. No other MCP server does this.

User: "Click File → Export as PDF in Preview" Claude: calls app_menu click ["File", "Export as PDF"] Server: "Menu item 'Export as PDF' not found in 'File'. Available: ['New from Clipboard', 'Open...', 'Close', 'Save', 'Duplicate', 'Rename...', 'Export...', 'Export as PDF...']" Claude: calls app_menu click ["File", "Export as PDF..."] Server: "Clicked: File > Export as PDF..."

- No permission needed— clipboard, notifications, URLs, apps. Works immediately.
- Automation— browser tabs, frontmost app. macOS prompts once per browser.
- Accessibility— keyboard, windows, menus. Grant once inSystem Settings → Privacy & Security → Accessibility.

When a permission is missing, the server tells you exactly what to do:

"Accessibility permission required. Grant access to 'osascript' in System Settings > Privacy & Security > Accessibility."

41 integration tests covering all 12 tools — input validation, security boundaries (URL scheme blocking, prototype pollution, script size limits), timeout enforcement, and permission error handling.

- run_osascriptexecutes arbitrary code — this is by design. The MCP client (Claude) is the trust boundary.
- Scripts piped via stdin to/usr/bin/osascript— no temp files, no TOCTOU race conditions.
- Script size: 50 KB max. Output: 50K chars max (truncated).
- Error messages sanitized — filesystem paths, tokens, and passwords are stripped.
- Child processes get minimal env:PATH,HOME,LANGonly — no API keys or secrets leak.
- URL scheme allowlist —file://,smb://,vnc://,javascript:all blocked.
- Handler dispatch usesObject.create(null)— no prototype pollution.

- Process group kill on timeout — SIGTERM → 2s grace → SIGKILL. No orphaned processes.
- Concurrency semaphore — max 5 simultaneous osascript processes.
- Graceful shutdown —server.close()with 10s force-exit safety net.
- Error classification — parses macOS error codes (-1728, -1743, -25211) into actionable messages. Supports English and Russian locales.

- macOS 13+ (Ventura or later)
- Node.js 18+

GNOME Shell extension + Python MCP server giving AI assistants 30 tools to automate the Linux desktop: screenshots, window management, mouse/keyboard injection, clipboard, and workspaces.

A Python server for remote macOS control via VNC, featuring an AI-powered chat web interface.

A local office automation assistant for file system operations, system command execution, and browser control.

A TypeScript server for automation and integration, featuring Microsoft OAuth, browser control, and basic utilities.

Plugin-based MCP server that gives AI agents access to web applications through the user's authenticated browser session. Chrome extension with 100+ plugins for Slack, Discord, GitHub, Reddit, and more.

An open-source MCP server that allows AI to fully control a remote macOS system.

List, open, and run shortcuts from the macOS Shortcuts app.

Hosted remote MCP server with managed OAuth for a growing list of 15+ toolkits, including Google Workspace, Last.fm, MusicBrainz, Fitbit, Oura, Kalshi, and Polymarket.

Zo is your personal vibe server in the cloud with 50+ tools and integrations. Add texting, email, calendar, research and more to your harness easily.

the local MCP server for safe desktop control

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.