Apple macOS Native Applications

by jxnl

15 stars
Not rated
GitHub

About

Enables AI interaction with macOS native applications through AppleScript for tasks like managing contacts, notes, emails, reminders, calendar events, and maps navigation

Details

Author
jxnl
Repository
jxnl/python-apple-mcp
GitHub stars
15
Categories
Productivity, Developer Tools, Design, AI, Search, Frontend, Project Management, Knowledge Base, Communication

- Interact with macOS native applications through AppleScript
- Asynchronous operations for better performance
- Comprehensive error handling
- Type-safe interfaces using Pydantic models
- Extensive test coverage
- Modular design for easy extension

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Apple macOS Native Applications
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

find_contact

Search for contacts by name. Parameters: name (string)

get_all_contacts

Get all contacts.

create_contact

Create a new contact. Parameters: name (string), phones (list of strings)

find_note

Search for notes. Parameters: query (string)

create_note

Create a new note. Parameters: title (string), body (string), folder_name (string)

get_all_notes

Get all notes.

send_email

Send an email. Parameters: to (string), subject (string), body (string)

search_emails

Search emails. Parameters: query (string)

get_unread_mails

Get unread emails.

send_message

Send an iMessage. Parameters: to (string), content (string)

read_messages

Read messages. Parameters: phone_number (string)

schedule_message

Schedule a message. Parameters: to (string), content (string), scheduled_time (string)

create_reminder

Create a reminder. Parameters: name (string), list_name (string), notes (string), due_date (string)

search_reminders

Search reminders. Parameters: query (string)

get_all_reminders

Get all reminders.

create_event

Create an event. Parameters: title (string), start_date (string), end_date (string), location (string), notes (string)

search_events

Search events. Parameters: query (string)

get_events

Get all events.

search_locations

Search for locations. Parameters: query (string)

get_directions

Get directions. Parameters: from_address (string), to_address (string), transport_type (string)

save_location

Save a location to favorites. Parameters: name (string), address (string)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "apple macos native applications": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

Python Apple MCP (Model Context Protocol)

A Python implementation of the server that handles interactions with macOS applications such as Contacts, Notes, Mail, Messages, Reminders, Calendar, and Maps using FastMCP.

Features

- Interact with macOS native applications through AppleScript
- Asynchronous operations for better performance
- Comprehensive error handling
- Type-safe interfaces using Pydantic models
- Extensive test coverage
- Modular design for easy extension

Supported Applications

- Contacts
- Notes
- Mail
- Messages
- Reminders
- Calendar
- Maps

Installation

1. Clone the repository:

git clone https://github.com/jxnl/python-apple-mcp.git
cd python-apple-mcp

2. Create a virtual environment:

python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

3. Install dependencies:

pip install -r requirements.txt

4. Install test dependencies (optional):

pip install -r requirements-test.txt

Usage

Basic Example

from apple_mcp import FastMCP, Context

Initialize FastMCP server

mcp = FastMCP("Apple MCP")

Use the tools

@mcp.tool() def find_contact(name: str) -> List[Contact]: """Search for contacts by name""" # Implementation here pass

Run the server

if __name__ == "__main__": mcp.run()

Using Individual Modules

from utils.contacts import ContactsModule
from utils.notes import NotesModule

Initialize modules

contacts = ContactsModule() notes = NotesModule()

Use the modules

async def main(): # Find a contact contact = await contacts.find_contact("John") # Create a note await notes.create_note( title="Meeting Notes", body="Discussion points...", folder_name="Work" )

Run the async code

import asyncio asyncio.run(main())

Testing

Run the test suite:

pytest

Run tests with coverage:

pytest --cov=utils tests/

Run specific test file:

pytest tests/test_contacts.py

API Documentation

Contacts Module

- find_contact(name: str) -> List[Contact]: Search for contacts by name
- get_all_contacts() -> List[Contact]: Get all contacts
- create_contact(name: str, phones: List[str]) -> Contact: Create a new contact

Notes Module

- find_note(query: str) -> List[Note]: Search for notes
- create_note(title: str, body: str, folder_name: str) -> Note: Create a new note
- get_all_notes() -> List[Note]: Get all notes

Mail Module

- send_email(to: str, subject: str, body: str) -> str: Send an email
- search_emails(query: str) -> List[Email]: Search emails
- get_unread_mails() -> List[Email]: Get unread emails

Messages Module

- send_message(to: str, content: str) -> bool: Send an iMessage
- read_messages(phone_number: str) -> List[Message]: Read messages
- schedule_message(to: str, content: str, scheduled_time: str) -> Dict: Schedule a message

Reminders Module

- create_reminder(name: str, list_name: str, notes: str, due_date: str) -> Dict: Create a reminder
- search_reminders(query: str) -> List[Dict]: Search reminders
- get_all_reminders() -> List[Dict]: Get all reminders

Calendar Module

- create_event(title: str, start_date: str, end_date: str, location: str, notes: str) -> Dict: Create an event
- search_events(query: str) -> List[Dict]: Search events
- get_events() -> List[Dict]: Get all events

Maps Module

- search_locations(query: str) -> List[Location]: Search for locations
- get_directions(from_address: str, to_address: str, transport_type: str) -> str: Get directions
- save_location(name: str, address: str) -> Dict: Save a location to favorites

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

This project is licensed under the MIT License - see the LICENSE file for details.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.