Skip to main content
Glama

Инструменты Apple MCP (протокол контекста модели)

Набор инструментов, которые позволяют помощникам на основе искусственного интеллекта, таким как Клод, взаимодействовать с приложениями и службами Apple через протокол контекста модели (MCP).

Обзор

Этот пакет предоставляет инструменты MCP для взаимодействия с различными приложениями и службами Apple, включая:

  • Контакты : Поиск и извлечение контактов из приложения Apple Contacts.

  • Заметки : поиск, извлечение, создание заметок и составление списков папок в приложении Apple Notes.

  • Сообщения : отправка, чтение, планирование сообщений и проверка непрочитанных сообщений.

  • Почта : чтение непрочитанных писем, поиск писем и отправка писем.

  • Напоминания : поиск, создание и открытие напоминаний в приложении Apple Reminders

  • Календарь : поиск, создание и открытие событий календаря в приложении Apple Calendar.

  • Карты : поиск местоположений, управление путеводителями, сохранение избранного и получение маршрутов

  • Поиск в Интернете : поиск в Интернете с помощью DuckDuckGo и извлечение контента из результатов поиска.

Related MCP server: MCP Personal Assistant Agent

Установка

# Install with npm
npm install @sage/mcp-apple

# Install with yarn
yarn add @sage/mcp-apple

# Install with bun
bun add @sage/mcp-apple

Требования

  • операционная система macOS

  • Node.js 18+ или среда выполнения Bun

  • Соответствующие разрешения для доступа к приложениям Apple (Контакты, Заметки, Сообщения, Почта и т. д.)

Использование

Запуск MCP-сервера

# Using the CLI
npx apple-mcp

# Using bun
bun run dev

Подключение к Клоду

Чтобы использовать эти инструменты с Claude, вам нужно подключить MCP-сервер к Claude. Это можно сделать с помощью MCP-прокси или напрямую через интерфейс Claude, если он доступен.

# Example using mcp-proxy
mcp-proxy --server "bun run /path/to/apple-mcp/index.ts"

Примеры инструментов

Контакты

// Search for a contact by name
{
  "operation": "contacts",
  "name": "John Doe"
}

// List all contacts
{
  "operation": "contacts"
}

Примечания

// Search for notes containing specific text
{
  "operation": "notes",
  "operation": "search",
  "searchText": "meeting notes"
}

// Create a new note
{
  "operation": "notes",
  "operation": "create",
  "title": "Shopping List",
  "body": "- Milk\n- Eggs\n- Bread",
  "folderName": "Personal"
}

// List all notes in a folder
{
  "operation": "notes",
  "operation": "list",
  "folderName": "Work"
}

// List all folders
{
  "operation": "notes",
  "operation": "listFolders"
}

// Create a new folder
{
  "operation": "notes",
  "operation": "createFolder",
  "folderName": "Projects"
}

Сообщения

// Send a message
{
  "operation": "messages",
  "operation": "send",
  "phoneNumber": "+1234567890",
  "message": "Hello, how are you?"
}

// Read messages from a contact
{
  "operation": "messages",
  "operation": "read",
  "phoneNumber": "+1234567890",
  "limit": 5
}

// Schedule a message
{
  "operation": "messages",
  "operation": "schedule",
  "phoneNumber": "+1234567890",
  "message": "Don't forget our meeting tomorrow!",
  "scheduledTime": "2023-12-01T09:00:00Z"
}

// Check unread messages
{
  "operation": "messages",
  "operation": "unread"
}

Почта

// Check unread emails
{
  "operation": "mail",
  "operation": "unread",
  "limit": 10
}

// Search emails
{
  "operation": "mail",
  "operation": "search",
  "searchTerm": "invoice",
  "limit": 5
}

// Send an email
{
  "operation": "mail",
  "operation": "send",
  "to": "recipient@example.com",
  "subject": "Meeting Agenda",
  "body": "Here's the agenda for our meeting tomorrow...",
  "cc": "colleague@example.com"
}

// List mailboxes
{
  "operation": "mail",
  "operation": "mailboxes"
}

// List accounts
{
  "operation": "mail",
  "operation": "accounts"
}

Напоминания

// List all reminders
{
  "operation": "reminders",
  "operation": "list"
}

// Search for reminders
{
  "operation": "reminders",
  "operation": "search",
  "searchText": "groceries"
}

// Create a reminder
{
  "operation": "reminders",
  "operation": "create",
  "name": "Buy milk",
  "listName": "Shopping",
  "notes": "Get organic milk",
  "dueDate": "2023-12-01T18:00:00Z"
}

// Open a reminder
{
  "operation": "reminders",
  "operation": "open",
  "searchText": "Buy milk"
}

// List reminders by list ID
{
  "operation": "reminders",
  "operation": "listById",
  "listId": "x-apple-reminder://list/123456"
}

Календарь

// Search for events
{
  "operation": "calendar",
  "operation": "search",
  "searchText": "meeting",
  "fromDate": "2023-12-01T00:00:00Z",
  "toDate": "2023-12-31T23:59:59Z"
}

// List upcoming events
{
  "operation": "calendar",
  "operation": "list",
  "limit": 5
}

// Create an event
{
  "operation": "calendar",
  "operation": "create",
  "title": "Team Meeting",
  "startDate": "2023-12-05T14:00:00Z",
  "endDate": "2023-12-05T15:00:00Z",
  "location": "Conference Room A",
  "notes": "Quarterly review meeting",
  "isAllDay": false,
  "calendarName": "Work"
}

// Open an event
{
  "operation": "calendar",
  "operation": "open",
  "eventId": "x-apple-calendar://event/123456"
}

Карты

// Search for locations
{
  "operation": "maps",
  "operation": "search",
  "query": "coffee shops near me",
  "limit": 5
}

// Save a location
{
  "operation": "maps",
  "operation": "save",
  "name": "Favorite Coffee Shop",
  "address": "123 Main St, Anytown, USA"
}

// Get directions
{
  "operation": "maps",
  "operation": "directions",
  "fromAddress": "123 Main St, Anytown, USA",
  "toAddress": "456 Oak Ave, Anytown, USA",
  "transportType": "driving"
}

// Drop a pin
{
  "operation": "maps",
  "operation": "pin",
  "name": "Meeting Point",
  "address": "Central Park, New York, NY"
}

// List guides
{
  "operation": "maps",
  "operation": "listGuides"
}

// Create a guide
{
  "operation": "maps",
  "operation": "createGuide",
  "guideName": "Favorite Restaurants"
}

// Add to guide
{
  "operation": "maps",
  "operation": "addToGuide",
  "guideName": "Favorite Restaurants",
  "address": "789 Pine St, Anytown, USA"
}

// Get map center coordinates
{
  "operation": "maps",
  "operation": "getCenter"
}

// Set map center coordinates
{
  "operation": "maps",
  "operation": "setCenter",
  "latitude": 37.7749,
  "longitude": -122.4194
}

Поиск в Интернете

// Search the web
{
  "operation": "webSearch",
  "query": "how to make chocolate chip cookies"
}

Архитектура

Инструмент Apple MCP построен на основе модульной архитектуры:

  • index.ts : Основная точка входа, которая настраивает сервер MCP и регистрирует инструменты

  • tools.ts : определяет схемы и описания инструментов

  • src/handlers/ : Содержит функции обработчика для каждого инструмента

  • src/scripts/ : Содержит скрипты AppleScript для взаимодействия с приложениями Apple.

  • utils/ : Содержит служебные модули для каждой службы Apple

Для повышения производительности инструмент использует отложенную загрузку, загружая модули только тогда, когда они необходимы.

Безопасность и разрешения

Этот инструмент требует доступа к различным приложениям и службам Apple. Вам нужно будет предоставить разрешения, когда macOS запросит. Эти разрешения можно управлять в Системные настройки > Безопасность и конфиденциальность > Конфиденциальность.

Разработка

Настраивать

# Clone the repository
git clone https://github.com/yourusername/apple-mcp.git
cd apple-mcp

# Install dependencies
bun install

Работа в режиме разработки

bun run dev

Стиль кода

  • Используйте отступ в 2 пробела

  • Длина строк не должна превышать 100 символов.

  • Используйте явные аннотации типов для параметров и возвращаемых значений функций.

  • Используйте PascalCase для типов, интерфейсов и констант инструментов.

  • Используйте camelCase для переменных и функций

Внося вклад

Вклады приветствуются! Пожалуйста, не стесняйтесь отправлять запрос на включение.

  1. Форк репозитория

  2. Создайте ветку функций ( git checkout -b feature/amazing-feature )

  3. Зафиксируйте свои изменения ( git commit -m 'Add some amazing feature' )

  4. Отправить в ветку ( git push origin feature/amazing-feature )

  5. Открыть запрос на извлечение

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Appeared in Searches

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wearesage/mcp-apple'

If you have feedback or need assistance with the MCP directory API, please join our Discord server