applescript.com
applescript.com logo

AppleScript

Integrates AppleScript to enable natural language control of macOS applications and system functions.

Created byApr 22, 2025

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.
<a href="https://glama.ai/mcp/servers/0t5gydjcqw"><img width="380" height="200" src="https://glama.ai/mcp/servers/0t5gydjcqw/badge" alt="applescript-mcp MCP server" /></a>

Features

  • Calendar management (events, reminders)
  • Clipboard operations
  • Finder integration
  • System notifications
  • System controls (volume, dark mode, apps)
  • iTerm terminal integration
  • Mail (create new email, list emails, get email)
  • Shortcuts automation
  • Messages (list chats, get messages, search messages, send a message)
  • Notes (create formatted notes, list notes, search notes)
  • Pages (create documents)

Planned Features

  • Safari (open in Safari, save page content, get selected page/tab)
  • Reminders (create, get)

Prerequisites

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

Available Categories

Calendar

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Clipboard

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Finder

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Notifications

Note: Sending notification requires that you enable notifications in System Settings > Notifications > Script Editor.
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

System

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

iTerm

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Shortcuts

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Mail

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Messages

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Notes

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Pages

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Architecture

The applescript-mcp server is built using TypeScript and follows a modular architecture:

Core Components

  1. AppleScriptFramework (framework.ts): The main server class that:
  1. Categories (src/categories/*.ts): Modular script collections organized by functionality:
  1. Types (src/types/index.ts): TypeScript interfaces defining:

Execution Flow

  1. Client sends a tool request via MCP protocol
  1. Server identifies the appropriate category and script
  1. Script content is generated (static or dynamically via function)
  1. AppleScript is executed via macOS osascript command
  1. Results are returned to the client

Logging System

The framework includes a comprehensive logging system that:
  • Logs to both stderr and MCP logging protocol
  • Supports multiple severity levels (debug, info, warning, error, etc.)
  • Provides detailed execution information for troubleshooting

Development

Setup

Adding New Functionality

1. Create Category File

Create src/categories/newcategory.ts:

2. Add Scripts

3. Register Category

Update src/index.ts:

Advanced Script Development

For more complex scripts, you can:
  1. Use dynamic script generation:
  1. Process complex data:

Debugging

Using MCP Inspector

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

Logging

Enable debug logging by setting the environment variable:

Example configuration

After running npm run build add the following to your mcp.json file:

Common Issues

  • Permission Errors: Check System Preferences > Security & Privacy > Privacy > Automation
  • Script Failures: Test scripts directly in Script Editor.app before integration
  • Communication Issues: Check stdio streams aren't being redirected
  • Database Access: Some features (like Messages) require Full Disk Access permission

Resources

Contributing

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

License

MIT License - see LICENSE for details

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.
<a href="https://glama.ai/mcp/servers/0t5gydjcqw"><img width="380" height="200" src="https://glama.ai/mcp/servers/0t5gydjcqw/badge" alt="applescript-mcp MCP server" /></a>

Features

  • Calendar management (events, reminders)
  • Clipboard operations
  • Finder integration
  • System notifications
  • System controls (volume, dark mode, apps)
  • iTerm terminal integration
  • Mail (create new email, list emails, get email)
  • Shortcuts automation
  • Messages (list chats, get messages, search messages, send a message)
  • Notes (create formatted notes, list notes, search notes)
  • Pages (create documents)

Planned Features

  • Safari (open in Safari, save page content, get selected page/tab)
  • Reminders (create, get)

Prerequisites

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

Available Categories

Calendar

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Clipboard

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Finder

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Notifications

Note: Sending notification requires that you enable notifications in System Settings > Notifications > Script Editor.
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

System

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

iTerm

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Shortcuts

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Mail

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Messages

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Notes

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Pages

[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

Examples

Architecture

The applescript-mcp server is built using TypeScript and follows a modular architecture:

Core Components

  1. AppleScriptFramework (framework.ts): The main server class that:
  1. Categories (src/categories/*.ts): Modular script collections organized by functionality:
  1. Types (src/types/index.ts): TypeScript interfaces defining:

Execution Flow

  1. Client sends a tool request via MCP protocol
  1. Server identifies the appropriate category and script
  1. Script content is generated (static or dynamically via function)
  1. AppleScript is executed via macOS osascript command
  1. Results are returned to the client

Logging System

The framework includes a comprehensive logging system that:
  • Logs to both stderr and MCP logging protocol
  • Supports multiple severity levels (debug, info, warning, error, etc.)
  • Provides detailed execution information for troubleshooting

Development

Setup

Adding New Functionality

1. Create Category File

Create src/categories/newcategory.ts:

2. Add Scripts

3. Register Category

Update src/index.ts:

Advanced Script Development

For more complex scripts, you can:
  1. Use dynamic script generation:
  1. Process complex data:

Debugging

Using MCP Inspector

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

Logging

Enable debug logging by setting the environment variable:

Example configuration

After running npm run build add the following to your mcp.json file:

Common Issues

  • Permission Errors: Check System Preferences > Security & Privacy > Privacy > Automation
  • Script Failures: Test scripts directly in Script Editor.app before integration
  • Communication Issues: Check stdio streams aren't being redirected
  • Database Access: Some features (like Messages) require Full Disk Access permission

Resources

Contributing

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

License

MIT License - see LICENSE for details