
Mcp Osascript
io.github.m0rvaynePublished by GitHub account m0rvaynev1.1.3Updated Nov 3, 2026
macOS automation: 17 typed tools for windows, menus, keyboard, clipboard, tabs, screenshots
Overview
macOS-only MCP server that lets an assistant control the Mac: windows, menus, keyboard, clipboard, browser tabs, screenshots and Shortcuts.
- What you can do
- Control apps and windows: launch or front apps, list, move, resize, minimize, fullscreen or close windows, hide, unhide or quit apps, and read the frontmost app and display layout
- Drive menus and input: list or click menu items, type text, press key combinations, and run arbitrary AppleScript or JXA scripts
- Read and write the clipboard, show native notifications, open URLs and files or folders
- Inspect browser tabs in Safari, Chrome or Arc, take full-screen, region or window screenshots, and list or run Apple Shortcuts
- Check which macOS permissions are granted and what each one unlocks
- When to use it
- Useful when you want an assistant to operate a Mac directly — rearranging windows, clicking through app menus, filling in text fields, grabbing screenshots or triggering Shortcuts — instead of only talking about it. Only relevant on macOS desktops.
- Requirements
- Runs locally on macOS 13 or later with Node.js 18 or newer, installed via npx or a Claude Desktop extension bundle. macOS Automation, Accessibility and Screen Recording permissions must be granted in System Settings for the tools that need them. No API keys or environment variables are declared.
Installation
In SourceWeft
- Open Mcp Osascript in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Let Claude control your Mac. Move windows, click menus, type text, read clipboard, manage browser tabs, take screenshots, run Shortcuts — 18 typed tools with input validation and security guardrails.
[npm version] [macOS 13+] [Node 18+] [License: MIT] [Tests: 84 passed] [Tests] [m0rvayne/mcp-osascript MCP server]
Listed in the official MCP Registry as io.github.m0rvayne/mcp-osascript
Quick Start
Claude Desktop — one click. Download mcp-osascript-1.1.3.mcpb from the latest release and double-click it. Claude Desktop installs the extension itself.
Or add it to the config manually:
Add this to your Claude Desktop config (Settings → Developer → Edit Config), restart Claude, and you're ready.
Config for other clients (Cursor, VS Code, Claude Code)
Cursor / VS Code (Copilot)
Claude Code
From source (development)
Try These Prompts
Once installed, ask Claude:
Tools
18 typed tools, each with input validation, error classification, and permission-aware error messages.
Self-Correcting Menus
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.
Why mcp-osascript?
Star counts are a popularity measure, not a quality one — both alternatives predate this project by months. The rows above are the things that differ in practice.
Security audits
Four red-team audit passes (adversarial agents run against the source, commissioned by the author — not a third-party certification), the most recent against v1.1.2 with three parallel agents
covering the shell surface, AppleScript escaping, and information disclosure. It found six real
defects, including a tool that silently annulled another tool's scheme allowlist and a
concurrency slot that could leak until the server deadlocked. Every finding is fixed and carries
a regression test. escapeAS was verified against 13 string-breakout candidates through real
osascript — none escape.
Permissions
Tools work in three tiers:
- No permission needed — clipboard, notifications, URLs, apps, files, displays, Shortcuts. Works immediately.
- Automation — browser tabs, frontmost app. macOS prompts once per browser.
- Accessibility — keyboard, windows, menus, hide/unhide. Grant once in System Settings → Privacy & Security → Accessibility.
- Screen Recording — screenshots only. Grant in System Settings → Privacy & Security → Screen Recording.
Ask Claude to run check_permissions and it will tell you which of these are already
granted, which tools each one unlocks, and exactly which settings pane to open for the
rest. The probes are read-only and never trigger a permission prompt.
When a permission is missing, the server tells you exactly what to do:
Testing
84 integration tests covering all 18 tools — input validation, security boundaries (URL scheme blocking, prototype pollution, script size limits), timeout enforcement, permission error handling, and regressions for every finding of the security audit.
Security & Architecture
Security
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 on a UTF-8 character boundary (no mojibake in non-Latin output).
- 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 uses
Object.create(null)— no prototype pollution. - Externally-sourced text (browser tab titles, window titles, menu items, clipboard) is returned inside an explicit
<untrusted-data>envelope, so a web page that renames itself cannot smuggle instructions into the model's context. file_openrefuses anything that parses as a URL —open(1)resolves URLs as well as paths, so without that check it would quietly annulopen_url's scheme allowlist.screenshotnever overwrites an existing file unlessoverwrite: true, and the extension must match the format.- Every list-building tool strips
|, CR and LF from app-supplied names, so a crafted window or tab title cannot forge a record.
Reliability
- 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.
Requirements
- macOS 13+ (Ventura or later)
- Node.js 18+
License
MIT
Source: README.md at commit 8eb0731
Tools
0Version history
1- v1.1.3LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts