Cover image
Try Now
2024-12-02

MACOS AppleScript MCP服务器

3 years

Works with Finder

3

Github Watches

25

Github Forks

134

Github Stars

applescript-mcp MCP Server

A Model Context Protocol server that enables LLM applications to interact with macOS through AppleScript. This server provides a standardized interface for AI applications to control system functions, manage files, handle notifications, and more.

Features

  • 🗓️ Calendar management (events, reminders)
  • 📋 Clipboard operations
  • 🔍 Finder integration
  • 🔔 System notifications
  • ⚙️ System controls (volume, dark mode, apps)
  • 📟 iTerm terminal integration

Planned Features

  • 📬 Mail (list emails, save attachments, summarize, send)
  • 🧭 Safari (open in Safari, save page content, get selected page/tab)
  • 💬 Messages (send, get, list)
  • ✅ Reminders (create, get)
  • 🗒️ Notes (create, get, list)

Prerequisites

  • macOS 10.15 or later
  • Node.js 18 or later

Available Categories

Calendar

Command Description Parameters
add Create calendar event title, startDate, endDate
list List today's events None

Clipboard

Command Description Parameters
set_clipboard Copy to clipboard content
get_clipboard Get clipboard contents None
clear_clipboard Clear clipboard None

Finder

Command Description Parameters
get_selected_files Get selected files None
search_files Search for files query, location (optional)
quick_look Preview file path

Notifications

Command Description Parameters
send_notification Show notification title, message, sound (optional)
toggle_do_not_disturb Toggle DND mode None

System

Command Description Parameters
volume Set system volume level (0-100)
get_frontmost_app Get active app None
launch_app Open application name
quit_app Close application name, force (optional)
toggle_dark_mode Toggle dark mode None

iTerm

Command Description Parameters
paste_clipboard Paste to iTerm None
run Execute command command, newWindow (optional)

Development

Setup

# Install dependencies
npm install

# Build the server
npm run build

# Launch MCP Inspector
# See: https://modelcontextprotocol.io/docs/tools/inspector
npx @modelcontextprotocol/inspector node path/to/server/index.js args...

Adding New Functionality

1. Create Category File

Create src/categories/newcategory.ts:

import { ScriptCategory } from "../types/index.js";

export const newCategory: ScriptCategory = {
  name: "category_name",
  description: "Category description",
  scripts: [
    // Scripts will go here
  ]
};

2. Add Scripts

{
  name: "script_name",
  description: "What the script does",
  schema: {
    type: "object",
    properties: {
      paramName: {
        type: "string",
        description: "Parameter description"
      }
    },
    required: ["paramName"]
  },
  script: (args) => `
    tell application "App"
      // AppleScript code using ${args.paramName}
    end tell
  `
}

3. Register Category

Update src/index.ts:

import { newCategory } from "./categories/newcategory.js";
// ...
server.addCategory(newCategory);

Debugging

Using MCP Inspector

The MCP Inspector provides a web interface for testing and debugging your server:

npm run inspector

Logging

Enable debug logging by setting the environment variable:

DEBUG=applescript-mcp* npm start

Common Issues

  • Permission Errors: Check System Preferences > Security & Privacy
  • Script Failures: Test scripts directly in Script Editor.app
  • Communication Issues: Check stdio streams aren't being redirected

Resources

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE for details

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • 林乔安妮
  • A fashion stylist GPT offering outfit suggestions for various scenarios.

  • 田中 楓太
  • A virtual science instructor for engaging and informative lessons.

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • awslabs
  • AWS MCP服务器 - 将AWS最佳实践直接带入您的开发工作流程的专门MCP服务器

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • 1Panel-dev
  • 💬MAXKB是一种现成的AI聊天机器人,它集成了检索功能增强的生成(RAG)管道,支持强大的工作流程并提供高级的MCP工具使用功能。

  • chongdashu
  • 使用模型上下文协议(MCP),启用Cursor,Windsurf和Claude Desktop等AI助手客户,以通过自然语言控制虚幻引擎。

    Reviews

    4 (1)
    Avatar
    user_lEx4UJRf
    2025-04-17

    As a devoted user of applescript-mcp by joshrutkowski, I find it to be an incredibly efficient and user-friendly tool for managing AppleScript projects. Its seamless integration and ease of use have significantly streamlined my workflow. Highly recommend for any AppleScript developer! Check it out at https://github.com/joshrutkowski/applescript-mcp.