
JCAppleScript
io.github.johnnyclem由 GitHub 账号 johnnyclem 发布v2.0.0更新于 Oct 24, 2026
Control macOS apps via AppleScript/JXA: sanitized commands for Messages, Mail, Finder, and more.
概览
本地 macOS MCP 服务器,让助手通过 AppleScript 和 JXA 控制“信息”“邮件”“访达”“备忘录”“Safari”等 Apple 应用。
- 可以做什么
- 执行任意 AppleScript 或 JXA 代码,或向指定应用发送 tell 命令,并在不执行的情况下检查脚本语法(安全模式下可禁用这些代码执行工具)。浏览、搜索并查看 12 个 macOS 应用的内置命令表,并可试运行命令以查看其将执行的确切脚本。执行“信息”“邮件”“提醒事项”“日历”“备忘录”“访达”“Safari”“音乐”“终端”“系统设置”、Xcode 和语音识别的预置命令。列出正在运行的应用,并从 JSON 清单加载额外的社区应用定义。
- 适用场景
- 适合在 Mac 上让助手发送信息或邮件、管理提醒事项、日历事件、备忘录或文件、控制“音乐”或 Safari,或通过经过审核的快捷命令操作 Xcode 和“终端”,而不是自由编写脚本。
- 运行要求
- 在 macOS 13.0 或更高版本上作为本地进程运行;发布版提供可直接安装到 Claude Desktop 的通用二进制包,也可用 Swift 5.9+ 自行构建。未声明身份验证。可选环境变量:JCAS_SAFE_MODE 和 JCAS_APP_MANIFESTS。可能需要在 macOS 中为目标应用授予自动化权限。
安装
在 SourceWeft 中
- 打开 控制台中的 JCAppleScript,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
JCAppleScript
A Swift package for executing AppleScript from macOS applications, featuring a built-in MCP server that lets AI assistants control macOS apps through pre-built command shortcuts.
Overview
JCAppleScript provides three components:
- JCAppleScript (library) - Core AppleScript execution engine
- AppShortcuts (library) - Registry of pre-built AppleScript commands for popular macOS apps
- jcas-mcp (executable) - MCP (Model Context Protocol) server for AI-driven app automation
Installation
Swift Package Manager
Add JCAppleScript to your Package.swift:
Then add the targets you need:
Quick Start
Using the Core Engine
When embedding untrusted values in script source, escape them first:
Using App Shortcuts
Using the MCP Server
The jcas-mcp executable is a Model Context Protocol server that AI assistants (Claude, GPT, etc.) can use to control macOS applications.
It is published to the official MCP registry as io.github.johnnyclem/jcas-mcp, and each GitHub release ships a prebuilt jcas-mcp.mcpb bundle (universal macOS binary) that can be installed directly in Claude Desktop via Settings → Extensions.
Setup with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
Build the server:
Available MCP Tools
† Hidden and disabled when the server runs in safe mode (see below).
Server Configuration
CLI flags: jcas-mcp --manifest prints the full registry as JSON, --version prints the server version, --help shows usage.
Example AI Interaction
Supported Applications
JCAppleScript ships with command sheets for 12 built-in macOS apps:
Adding Custom App Support
Implement the ScriptableApp protocol to add support for any scriptable macOS app:
Community App Registry
JCAppleScript is designed to grow through community contributions. The app shortcut system uses a standard protocol (ScriptableApp) that makes it easy to:
- Add new applications - Implement
ScriptableAppfor any scriptable macOS app - Extend existing apps - Submit new commands for already-registered apps
- Share command sheets - Export/import app definitions via JSON manifests
We're building a browsable registry (similar to npmjs.org) where you can:
- Browse applications and their supported AppleScript commands
- Submit new commands for existing apps
- Add entirely new applications to the registry
- Generate JSON manifests for integration with other tools
Exporting and Importing the Registry
Example manifest:
The MCP server loads extra manifests from the JCAS_APP_MANIFESTS environment variable at startup.
Security Model
Registry command arguments are sanitized before script generation:
- String, file-path, and date arguments are escaped (
\,", and control characters) so they cannot break out of AppleScript string literals. - Integer and boolean arguments are strictly validated/normalized — malformed values are rejected at validation and fall back to declared defaults during generation.
- Values outside a parameter's
allowedValueslist are dropped. - Arguments that don't correspond to a declared parameter are discarded.
Commands that execute caller-supplied code (Terminal shell commands, Safari JavaScript) are flagged dangerous and can be disabled wholesale with JCAS_SAFE_MODE=1. Use the preview_app_command tool to inspect the exact script a command will run before executing it.
Note that execute_applescript, execute_jxa, and tell_application execute arbitrary code by design — only expose them to clients you trust, or run the server in safe mode.
Architecture
Requirements
- macOS 13.0+
- Swift 5.9+
Legacy
The original Objective-C implementation (2013) is preserved in the Legacy/ directory for reference. It provided basic NSAppleScript wrapping with variable substitution. The new Swift implementation builds on those concepts while adding the MCP server, app registry, and modern Swift patterns.
License
MIT License - Copyright (c) 2013 John Clem. See LICENSE for details.
来源:README.md,提交 57e718e
工具
0版本历史
1- v2.0.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分