applescript-mcp MCP Server logo

applescript-mcp MCP Server

Community
joshrutkowski

A macOS AppleScript MCP server

Publisherjoshrutkowski
Repositoryapplescript-mcp
LanguageTypeScript
Forks
63
Stars
395
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    applescript-mcp MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    395 stars and 63 forks from the linked repository.

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.

Node.js CI

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

CommandDescriptionParameters
addCreate calendar eventtitle, startDate, endDate, calendar (optional)
listList today's eventsNone

Examples

// Create a new calendar event
Create a calendar event titled "Team Meeting" starting tomorrow at 2pm for 1 hour

// List today's events
What events do I have scheduled for today?

Clipboard

CommandDescriptionParameters
set_clipboardCopy to clipboardcontent
get_clipboardGet clipboard contentsNone
clear_clipboardClear clipboardNone

Examples

// Copy text to clipboard
Copy "Remember to buy groceries" to my clipboard

// Get clipboard contents
What's currently in my clipboard?

// Clear clipboard
Clear my clipboard

Finder

CommandDescriptionParameters
get_selected_filesGet selected filesNone
search_filesSearch for filesquery, location (optional)
quick_lookPreview filepath

Examples

// Get selected files in Finder
What files do I currently have selected in Finder?

// Search for files
Find all PDF files in my Documents folder

// Preview a file
Show me a preview of ~/Documents/report.pdf

Notifications

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

CommandDescriptionParameters
send_notificationShow notificationtitle, message, sound (optional)
toggle_do_not_disturbToggle DND modeNone

Examples

// Send a notification
Send me a notification with the title "Reminder" and message "Time to take a break"

// Toggle Do Not Disturb
Turn on Do Not Disturb mode

System

CommandDescriptionParameters
volumeSet system volumelevel (0-100)
get_frontmost_appGet active appNone
launch_appOpen applicationname
quit_appClose applicationname, force (optional)
toggle_dark_modeToggle dark modeNone

Examples

// Set system volume
Set my Mac's volume to 50%

// Get active application
What app am I currently using?

// Launch an application
Open Safari

// Quit an application
Close Spotify

// Toggle dark mode
Switch to dark mode

iTerm

CommandDescriptionParameters
paste_clipboardPaste to iTermNone
runExecute commandcommand, newWindow (optional)

Examples

// Paste clipboard to iTerm
Paste my clipboard contents into iTerm

// Run a command in iTerm
Run "ls -la" in iTerm

// Run a command in a new iTerm window
Run "top" in a new iTerm window

Shortcuts

CommandDescriptionParameters
run_shortcutRun a shortcutname, input (optional)
list_shortcutsList all available shortcutslimit (optional)

Examples

// List available shortcuts
List all my available shortcuts

// List with limit
Show me my top 5 shortcuts

// Run a shortcut
Run my "Daily Note in Bear" shortcut

// Run a shortcut with input
Run my "Add to-do" shortcut with input "Buy groceries"

Mail

CommandDescriptionParameters
create_emailCreate a new email in Mail.apprecipient, subject, body
list_emailsList emails from a mailboxmailbox (optional), count (optional), unreadOnly (optional)
get_emailGet a specific email by searchsubject (optional), sender (optional), dateReceived (optional), mailbox (optional), account (optional), unreadOnly (optional), includeBody (optional)

Examples

// Create a new email
Compose an email to john@example.com with subject "Meeting Tomorrow" and body "Hi John, Can we meet tomorrow at 2pm?"

// List emails
Show me my 10 most recent unread emails

// Get a specific email
Find the email from sarah@example.com about "Project Update"

Messages

CommandDescriptionParameters
list_chatsList available iMessage and SMS chatsincludeParticipantDetails (optional, default: false)
get_messagesGet messages from the Messages applimit (optional, default: 100)
search_messagesSearch for messages containing specific textsearchText, sender (optional), chatId (optional), limit (optional, default: 50), daysBack (optional, default: 30)
compose_messageOpen Messages app with pre-filled message or auto-sendrecipient (required), body (optional), auto (optional, default: false)

Examples

// List available chats
Show me my recent message conversations

// Get recent messages
Show me my last 20 messages

// Search messages
Find messages containing "dinner plans" from John in the last week

// Compose a message
Send a message to 555-123-4567 saying "I'll be there in 10 minutes"

Notes

CommandDescriptionParameters
createCreate a note with markdown-like formattingtitle, content, format (optional with formatting options)
createRawHtmlCreate a note with direct HTML contenttitle, html
listList notes, optionally from a specific folderfolder (optional)
getGet a specific note by titletitle, folder (optional)
searchSearch for notes containing specific textquery, folder (optional), limit (optional, default: 5), includeBody (optional, default: true)

Examples

// Create a new note with markdown formatting
Create a note titled "Meeting Minutes" with content "# Discussion Points\n- Project timeline\n- Budget review\n- Next steps" and format headings and lists

// Create a note with HTML
Create a note titled "Formatted Report" with HTML content "<h1>Quarterly Report</h1><p>Sales increased by <strong>15%</strong></p>"

// List notes
Show me all my notes in the "Work" folder

// Get a specific note
Show me my note titled "Shopping List"

// Search notes
Find notes containing "recipe" in my "Cooking" folder

Pages

CommandDescriptionParameters
create_documentCreate a new Pages document with plain textcontent

Examples

// Create a new Pages document
Create a Pages document with the content "Project Proposal\n\nThis document outlines the scope and timeline for the upcoming project."

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:

    • Manages MCP protocol communication
    • Handles tool registration and execution
    • Provides logging functionality
    • Executes AppleScript commands
  2. Categories (src/categories/*.ts): Modular script collections organized by functionality:

    • Each category contains related scripts (e.g., calendar, system, notes)
    • Categories are registered with the framework in index.ts
  3. Types (src/types/index.ts): TypeScript interfaces defining:

    • ScriptDefinition: Structure for individual scripts
    • ScriptCategory: Collection of related scripts
    • LogLevel: Standard logging levels
    • FrameworkOptions: Configuration options

Execution Flow

  1. Client sends a tool request via MCP protocol
  2. Server identifies the appropriate category and script
  3. Script content is generated (static or dynamically via function)
  4. AppleScript is executed via macOS osascript command
  5. 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

bash
# 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:

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

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

2. Add Scripts

typescript
{
  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:

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

Advanced Script Development

For more complex scripts, you can:

  1. Use dynamic script generation:

    typescript
    script: (args) => {
      // Process arguments and build script dynamically
      let scriptContent = `tell application "App"\n`;
      
      if (args.condition) {
        scriptContent += `  // Conditional logic\n`;
      }
      
      scriptContent += `end tell`;
      return scriptContent;
    }
  2. Process complex data:

    typescript
    // Example from Notes category
    function generateNoteHtml(args: any): string {
      // Process markdown-like syntax into HTML
      let processedContent = content;
      
      if (format.headings) {
        processedContent = processedContent.replace(/^# (.+)$/gm, '<h1>$1</h1>');
        // ...
      }
      
      return processedContent;
    }

Debugging

Using MCP Inspector

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

bash
npm run inspector

Logging

Enable debug logging by setting the environment variable:

bash
DEBUG=applescript-mcp* npm start

Example configuration

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

json
{
  "mcpServers": {
    "applescript-mcp-server": {
      "command": "node",
      "args": ["/path/to/applescript-mcp/dist/index.js"]
    }
  }
}

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
  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

Installation

TypingMind
{
  "mcpServers": {
    "applescript-mcp": {
      "command": "npx",
      "args": [
        "applescript-mcp"
      ]
    }
  }
}

Use applescript-mcp MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once applescript-mcp MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add applescript-mcp MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the applescript-mcp MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "applescript-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "applescript-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the applescript-mcp MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the applescript-mcp MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use applescript-mcp MCP Server to help me with this task?
applescript-mcp MCP Server
Sure. I read it.
Here is what I found using applescript-mcp MCP Server.

Frequently asked questions

What is the applescript-mcp MCP Server MCP server used for?

applescript-mcp MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use applescript-mcp MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use applescript-mcp MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use applescript-mcp MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With applescript-mcp MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect applescript-mcp MCP Server MCP to TypingMind?

applescript-mcp MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does applescript-mcp MCP Server MCP provide in TypingMind?

applescript-mcp MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use applescript-mcp MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If applescript-mcp MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter πŸ‘‡