Mac Messages MCP is a locally running MCP server used to securely connect conversations in the macOS Messages app to local clients that support MCP (such as Claude, Codex, Cursor, VS Code, etc.), allowing models to search, read, and send messages.
Purpose It is intended for scenarios that require querying and analyzing iMessage conversations on a Mac: reading recent messages, retrieving by contact/group chat, searching message text and attachment metadata, sending text or file attachments when explicitly invoked, and waiting for new messages.
Main capabilities
- Reading and searching messages, reading from the local SQLite database (chat.db and the AddressBook database), opened in read-only mode.
- Phone number validation and region expansion: supports E.164 and international/local formats; local formats are converted to E.164 according to the region (for example, (415) 555-1234 → +14155551234 in the US region, 06 39 98 00 01 → +33639980001 in the France region). MAC_MESSAGES_REGION can be used to specify an ISO 3166-1 alpha-2 code; numbers that are already E.164 will not be reinterpreted. Email addresses, contact names, and the contact:N option returned by contact search are also accepted.
- Contact management and lookup: provides tools such as tool_check_addressbook and tool_check_contacts; tool_create_contact only creates new contact cards and does not edit or merge existing cards.
- Group chat handling: first use tool_get_chats to get the chat ID, then use tool_send_message with group_chat=true to send; when reading the same conversation, pass the same ID as chat_id to tool_get_recent_messages.
- Attachment handling: three steps—message reading/search attaches markers such as [attachments: #42 image/jpeg (invitation.jpg)]; tool_search_attachments searches metadata only; tool_get_attachment retrieves a specified attachment. Images are returned inline by default, with a maximum of 5 MB, and HEIC is converted to PNG; larger images, PDFs, videos, and audio are returned as local file paths. Stickers, link preview payloads, and .pluginPayloadAttachment containers are filtered out.
- Message metadata, pagination, and cursors: tool_get_recent_messages provides the next page offset when a page is full; passing since_rowid switches to forward cursor reading (oldest first) and ignores the hours window, which is also the method used by tool_wait_for_new_messages for polling.
- Built-in MCP prompts: triage_unread_messages, summarize_recent_messages, draft_reply, used to guide agents on which read tools to call and do not send anything.
- MCP resources: messages://recent/{hours} and messages://contact/{contact}/{hours}.
Usage Requires Python 3.10 or later. uvx can be used to install and run in an isolated environment without creating a virtual environment first. The server command is the same across clients, but the configuration method varies by client: Claude Desktop adds mcpServers in "Settings → Developer → Edit Config"; Claude Code can be added once at user scope to be available globally, and checked with /mcp; Codex clients share the MCP configuration, and it can also be written directly to ~/.codex/config.toml; Cursor adds it in "Settings → Tools & MCP → New MCP Server"; VS Code uses the command palette "MCP: Add Server" and selects Command (stdio), with the command set to uvx and the argument set to mac-messages-mcp. Note that VS Code uses a top-level servers object, while Claude Desktop and Cursor use mcpServers. Regarding permissions: open "System Settings → Privacy & Security → Full Disk Access" and authorize the app that launches the MCP server (desktop/IDE integrations are usually Claude Desktop, Cursor, VS Code, or ChatGPT desktop app; when using Claude Code or Codex CLI from the terminal, it is a terminal app). After changing, you need to quit and reopen the app. On the first contact lookup or send, macOS may separately request permission to access Contacts or control "Messages", which must be allowed. Verify the connection: have the client first call tool_check_db_access, then call tool_check_addressbook; once both succeed, you can try reading or searching. The first uvx startup may be slower because it downloads and caches Python dependencies. Region settings: the server reads the Mac's own region settings by default; when the region to which a number belongs differs from the Mac configuration, set MAC_MESSAGES_REGION (ISO 3166-1 alpha-2 code). The region is resolved once at startup, and the server must be restarted after changes. The resolution order is MAC_MESSAGES_REGION, the macOS AppleLocale preference, LC_ALL / LC_CTYPE / LANG, and finally US. There is also a mac-messages-cli command-line tool that can read, search, and send messages in the terminal, using the same local database and macOS permissions; mac-messages-cli send requires y/N confirmation before sending, refuses to send when stdin is not a terminal unless --yes is passed, and the command exits with a non-zero exit code when lookup fails. The package also exports core read/send functions for standalone use; these calls use the same macOS permissions and may send real messages.
Use cases
- Use a local MCP client to retrieve, organize, and analyze iMessage conversations.
- Need to locate messages by contact, group chat, or attachment metadata.
- Send text and file attachments to individuals or group chats when the send tool is explicitly invoked, or schedule timed sends (depends on the server process staying alive).
- Read and write messages via CLI in a terminal environment.
Limitations
- macOS only. Reading requires Full Disk Access, and sending requires that the Mac is signed in to "Messages" and that the launching app has permission to automate "Messages".
- Unsupported operations are: sending Tapback, message effects, or subject lines (only text and file attachments can be sent); creating group chats, adding or removing participants, attaching files to group chats; editing, unsending, deleting, or marking messages as read, and saving drafts; editing or merging existing contact cards.
- Scheduled sends are not persisted; if the client disconnects first, the scheduled message will be lost.
- The server itself does not perform manual confirmation; sending must be gated by the MCP client.
- The included Dockerfile is only for package and directory validation; a Linux container cannot access macOS TCC permissions or automate Messages.app, so Docker is not a supported way to read or send messages.
- Information about fees, pricing, platform versions, etc. is not currently provided.