applescript-mcp
Servidor MCP applescript-mcp
Un servidor de Protocolo de Contexto de Modelo que permite que las aplicaciones LLM interactúen con macOS mediante AppleScript. Este servidor proporciona una interfaz estandarizada para que las aplicaciones de IA controlen las funciones del sistema, administren archivos, gestionen notificaciones y más.
Características
🗓️ Gestión de calendario (eventos, recordatorios)
Operaciones del portapapeles
🔍 Integración con Finder
🔔 Notificaciones del sistema
⚙️ Controles del sistema (volumen, modo oscuro, aplicaciones)
Integración del terminal iTerm
📬 Correo (crear nuevo correo electrónico, listar correos electrónicos, recibir correo electrónico)
🔄 Automatización de atajos
💬 Mensajes (listar chats, recibir mensajes, buscar mensajes, enviar un mensaje)
🗒️ Notas (crear notas formateadas, enumerar notas, buscar notas)
📄 Páginas (crear documentos)
Funciones planificadas
🧭 Safari (abrir en Safari, guardar el contenido de la página, obtener la página/pestaña seleccionada)
✅ Recordatorios (crear, recibir)
Related MCP server: MCP AppleScript
Prerrequisitos
macOS 10.15 o posterior
Node.js 18 o posterior
Categorías disponibles
Calendario
Dominio | Descripción | Parámetros |
| Crear evento de calendario |
|
| Enumere los eventos de hoy | Ninguno |
Ejemplos
// 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?Portapapeles
Dominio | Descripción | Parámetros |
| Copiar al portapapeles |
|
| Obtener el contenido del portapapeles | Ninguno |
| Borrar el portapapeles | Ninguno |
Ejemplos
// 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 clipboardDescubridor
Dominio | Descripción | Parámetros |
| Obtener archivos seleccionados | Ninguno |
| Buscar archivos |
|
| Archivo de vista previa |
|
Ejemplos
// 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.pdfNotificaciones
Nota: Para enviar notificaciones es necesario habilitar las notificaciones en Configuración del sistema > Notificaciones > Editor de scripts.
Dominio | Descripción | Parámetros |
| Mostrar notificación |
|
| Activar o desactivar el modo DND | Ninguno |
Ejemplos
// 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 modeSistema
Dominio | Descripción | Parámetros |
| Establecer el volumen del sistema |
|
| Obtener aplicación activa | Ninguno |
| Abrir solicitud |
|
| Cerrar aplicación |
|
| Activar el modo oscuro | Ninguno |
Ejemplos
// 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 modeiTerm
Dominio | Descripción | Parámetros |
| Pegar en iTerm | Ninguno |
| Ejecutar comando |
|
Ejemplos
// 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 windowAtajos
Dominio | Descripción | Parámetros |
| Ejecutar un atajo |
|
| Listar todos los accesos directos disponibles |
|
Ejemplos
// 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"Correo
Dominio | Descripción | Parámetros |
| Crear un nuevo correo electrónico en Mail.app |
|
| Listar correos electrónicos de un buzón |
|
| Obtenga un correo electrónico específico mediante una búsqueda |
|
Ejemplos
// 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"Mensajes
Dominio | Descripción | Parámetros |
| Lista de chats de iMessage y SMS disponibles |
|
| Recibir mensajes desde la aplicación Mensajes |
|
| Buscar mensajes que contengan texto específico |
|
| Abra la aplicación Mensajes con un mensaje precargado o envío automático |
|
Ejemplos
// 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"Notas
Dominio | Descripción | Parámetros |
| Crea una nota con formato similar a Markdown |
|
| Crear una nota con contenido HTML directo |
|
| Lista de notas, opcionalmente de una carpeta específica |
|
| Obtener una nota específica por título |
|
| Buscar notas que contengan texto específico |
|
Ejemplos
// 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" folderPáginas
Dominio | Descripción | Parámetros |
| Crear un nuevo documento de Pages con texto sin formato |
|
Ejemplos
// 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."Arquitectura
El servidor applescript-mcp está construido con TypeScript y sigue una arquitectura modular:
Componentes principales
AppleScriptFramework (
framework.ts): La clase de servidor principal que:Gestiona la comunicación del protocolo MCP
Maneja el registro y ejecución de herramientas.
Proporciona funcionalidad de registro
Ejecuta comandos de AppleScript
Categorías (
src/categories/*.ts): colecciones de scripts modulares organizadas por funcionalidad:Cada categoría contiene scripts relacionados (por ejemplo, calendario, sistema, notas)
Las categorías se registran en el marco en
index.ts
Tipos (
src/types/index.ts): Interfaces de TypeScript que definen:ScriptDefinition: Estructura para scripts individualesScriptCategory: Colección de scripts relacionadosLogLevel: niveles de registro estándarFrameworkOptions: Opciones de configuración
Flujo de ejecución
El cliente envía una solicitud de herramienta a través del protocolo MCP
El servidor identifica la categoría y el script adecuados
El contenido del script se genera (estático o dinámicamente mediante una función)
AppleScript se ejecuta a través del comando
osascriptde macOSLos resultados se devuelven al cliente.
Sistema de registro
El marco incluye un sistema de registro integral que:
Registra tanto el protocolo de registro stderr como el de MCP
Admite múltiples niveles de gravedad (depuración, información, advertencia, error, etc.)
Proporciona información detallada de ejecución para la resolución de problemas.
Desarrollo
Configuración
# 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...Añadiendo nueva funcionalidad
1. Crear archivo de categoría
Crear 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. Agregar 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. Categoría de registro
Actualizar src/index.ts :
import { newCategory } from "./categories/newcategory.js";
// ...
server.addCategory(newCategory);Desarrollo avanzado de scripts
Para scripts más complejos, puedes:
Utilice la generación dinámica de scripts :
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; }Procesar datos complejos :
// 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; }
Depuración
Uso del inspector MCP
El Inspector MCP proporciona una interfaz web para probar y depurar su servidor:
npm run inspectorExplotación florestal
Habilite el registro de depuración configurando la variable de entorno:
DEBUG=applescript-mcp* npm startEjemplo de configuración
Después de ejecutar npm run build agregue lo siguiente a su archivo mcp.json :
{
"mcpServers": {
"applescript-mcp-server": {
"command": "node",
"args": ["/path/to/applescript-mcp/dist/index.js"]
}
}
}Problemas comunes
Errores de permisos : Consultar Preferencias del sistema > Seguridad y privacidad > Privacidad > Automatización
Errores de script : Pruebe los scripts directamente en Script Editor.app antes de la integración
Problemas de comunicación : compruebe que los flujos de stdio no se redirigen
Acceso a la base de datos : algunas funciones (como Mensajes) requieren permiso de acceso completo al disco
Recursos
Contribuyendo
Bifurcar el repositorio
Crear una rama de características
Confirme sus cambios
Empujar hacia la rama
Crear una solicitud de extracción
Licencia
Licencia MIT: consulte LICENCIA para obtener más detalles
Available Tools
33 toolscalendar_addC
[Calendar operations] Add a new event to Calendar
Inputs: title (required), startDate (required), endDate (required), calendar.
calendar_listB
[Calendar operations] List all events for today
Inputs: no named parameters.
clipboard_clear_clipboardC
[Clipboard management operations] Clear clipboard content
Inputs: no named parameters.
clipboard_get_clipboardB
[Clipboard management operations] Get current clipboard content
Inputs: type.
clipboard_set_clipboardC
[Clipboard management operations] Set clipboard content
Inputs: content (required).
finder_get_selected_filesB
[Finder and file operations] Get currently selected files in Finder
Inputs: no named parameters.
finder_quick_look_fileB
[Finder and file operations] Preview a file using Quick Look
Inputs: path (required).
finder_search_filesC
[Finder and file operations] Search for files by name
Inputs: query (required), location.
iterm_paste_clipboardB
[iTerm terminal operations] Paste clipboard content into iTerm
Inputs: no named parameters.
iterm_runC
[iTerm terminal operations] Run a command in iTerm
Inputs: command (required), newWindow.
mail_create_emailC
[Mail operations] Create a new email in Mail.app
Inputs: recipient (required), subject (required), body (required).
mail_get_emailC
[Mail operations] Get a specific email by search criteria from Mail.app
Inputs: mailbox, account, subject, sender, +3 more.
mail_list_emailsB
[Mail operations] List emails from a specified mailbox in Mail.app
Inputs: mailbox, account, count, unreadOnly.
messages_compose_messageC
[iMessage operations] Open Messages app with a pre-filled message to a recipient or automatically send a message
Inputs: recipient (required), body, auto.
messages_get_messagesC
[iMessage operations] Get messages from the Messages app
Inputs: limit.
messages_list_chatsC
[iMessage operations] List available iMessage and SMS chats
Inputs: includeParticipantDetails.
messages_search_messagesC
[iMessage operations] Search for messages containing specific text or from a specific sender
Inputs: searchText (required), sender, chatId, limit, +1 more.
notes_createC
[Apple Notes operations] Create a new note with optional formatting
Inputs: title (required), content (required), format.
notes_createRawHtmlC
[Apple Notes operations] Create a new note with direct HTML content
Inputs: title (required), html (required).
notes_getB
[Apple Notes operations] Get a specific note by title
Inputs: title (required), folder.
notes_listC
[Apple Notes operations] List all notes or notes in a specific folder
Inputs: folder.
notes_searchC
[Apple Notes operations] Search for notes containing specific text
Inputs: query (required), folder, limit, includeBody.
notifications_send_notificationC
[Notification management] Send a system notification
Inputs: title (required), message (required), sound.
notifications_toggle_do_not_disturbB
[Notification management] Toggle Do Not Disturb mode using keyboard shortcut
Inputs: no named parameters.
pages_create_documentC
[Pages document operations] Create a new Pages document with plain text content (no formatting)
Inputs: content (required).
shortcuts_list_shortcutsC
[Shortcuts operations] List all available shortcuts with optional limit
Inputs: limit.
shortcuts_run_shortcutA
[Shortcuts operations] Run a shortcut with optional input. Uses Shortcuts Events to run in background without opening the app.
Inputs: name (required), input.
system_get_battery_statusB
[System control and information] Get battery level and charging status
Inputs: no named parameters.
system_get_frontmost_appB
[System control and information] Get the name of the frontmost application
Inputs: no named parameters.
system_launch_appC
[System control and information] Launch an application
Inputs: name (required).
system_quit_appC
[System control and information] Quit an application
Inputs: name (required), force.
system_toggle_dark_modeB
[System control and information] Toggle system dark mode
Inputs: no named parameters.
system_volumeC
[System control and information] Set system volume
Inputs: level (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Tools are well-organized into distinct domains (e.g., Calendar, Clipboard, Finder, Mail, Messages, Notes, Notifications, Pages, Shortcuts, System), with clear purposes within each domain. Minor potential confusion exists between 'notes_create' and 'notes_createRawHtml', which both create notes but with different content formats, but descriptions clarify the distinction.
Tool names follow a highly consistent verb_noun pattern throughout (e.g., calendar_add, clipboard_get_clipboard, finder_search_files). All tools use snake_case consistently, with no deviations in naming conventions, making them predictable and easy to parse.
With 33 tools, the count is borderline high for a single server, potentially overwhelming for agents. However, given the broad scope of automating various macOS applications and system functions, the number is reasonable but could benefit from more modular organization to reduce cognitive load.
The tool set provides comprehensive coverage across multiple macOS domains, with CRUD operations for key apps like Calendar, Mail, Messages, and Notes. Minor gaps exist, such as no update or delete tools for Calendar events or Pages documents, but agents can work around these with existing tools for most workflows.
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to interact with macOS applications (Finder, Mail, Contacts, Reminders, Notes, Calendar, TextEdit) using AppleScript. Allows AI assistants to perform tasks like searching contacts, managing files, checking email, and creating reminders through natural language.241MIT
- AlicenseAqualityDmaintenanceEnables Large Language Models to automate macOS applications and execute AppleScript commands through natural language. It features built-in security protections including application allowlists and dangerous pattern detection to prevent unauthorized or risky system operations.227 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI to dynamically discover and control native macOS applications (like Finder, Mail, Safari) through AppleScript/JXA automation without pre-built integrations.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to automate macOS applications, manage files, control music, send messages, and more through AppleScript.29 npm1GPL 3.0