iMessage MCP Server
Provides tools for reading, searching, and sending iMessage conversations, retrieving file attachments, listing recent chats, paginating through threads, and resolving contacts, with SMS fallback for phone numbers.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
iMessage MCP Server
An MCP server that exposes macOS iMessage data — read, search, send messages, and retrieve file attachments delivered via iMessage.
Requirements
macOS (iMessage uses
~/Library/Messages/chat.db)Full Disk Access granted to your terminal or host application
Python 3.10+
Related MCP server: mac-messages-mcp
Setup
# Install
pip install -e .
# Or run directly
pip install fastmcp phonenumbers
python server.pyClaude Code / Claude Desktop
Add to your MCP configuration:
{
"mcpServers": {
"imessage": {
"command": "python",
"args": ["/path/to/mcp/imessage/server.py"],
"env": {
"IMESSAGE_ATTACHMENT_DIR": "~/Downloads/imessage-attachments"
}
}
}
}Full Disk Access
The server reads ~/Library/Messages/chat.db directly. macOS requires Full Disk Access for any process accessing this file.
System Settings > Privacy & Security > Full Disk Access — add your terminal app (Terminal, iTerm, Cursor, Claude Desktop, etc.).
Tools
search_messages
Retrieve messages by contact with optional date range and text filter.
Parameter | Type | Default | Description |
| str | required | Phone number, email, or contact name |
| int | 72 | Look-back window (ignored if |
| str | None | ISO date YYYY-MM-DD |
| str | None | ISO date YYYY-MM-DD |
| str | None | Text substring filter |
| int | 100 | Max messages |
list_conversations
Recent conversations with last message preview, participant resolution, and message counts.
Parameter | Type | Default | Description |
| int | 168 | Look-back window (default 7 days) |
| int | 30 | Max conversations |
get_thread
Full conversation transcript for a specific chat, with backward pagination.
Parameter | Type | Default | Description |
| str | required | Chat identifier from |
| int | 50 | Messages per page |
| str | None | ISO datetime for pagination |
get_attachments
Copy file attachments from a conversation to a local directory. Converts HEIC images to JPEG using macOS sips (no external dependencies).
Parameter | Type | Default | Description |
| str | required | Phone number, email, or contact name |
| int | 168 | Look-back window |
| str | env default | Override destination directory |
| str | None | Filter by MIME prefix (e.g. |
send_message
Send a message via iMessage with automatic SMS fallback for phone numbers.
Parameter | Type | Default | Description |
| str | required | Phone, email, or chat_id |
| str | required | Message text |
| bool | False | True for group chat IDs |
search_contacts
Fuzzy search the macOS AddressBook by name.
Parameter | Type | Default | Description |
| str | required | Name or partial name |
| int | 10 | Max results |
Environment Variables
Variable | Default | Description |
|
| Override database location |
|
| Default attachment destination |
Architecture
Single-file Python server (server.py) using FastMCP. No external database dependencies — reads SQLite directly.
Read path: Direct SQLite queries against chat.db (read-only connection). Handles Apple's nanosecond-since-2001 timestamps, attributedBody binary parsing for older messages, and message_summary_info plist parsing for edited messages.
Write path: AppleScript via osascript to drive Messages.app. Tries iMessage first, falls back to SMS for phone numbers.
Contact resolution: Queries macOS AddressBook SQLite databases directly. Caches results for 5 minutes. Supports phone and email lookups.
Attachment handling: Queries the attachment + message_attachment_join tables. Copies files to a configurable destination. Converts HEIC to JPEG using macOS sips (built-in, no ImageMagick needed).
Acknowledgments
Built on patterns from:
hannesrudolph/imessage-query-fastmcp-mcp-server — attachment handling, text extraction
carterlasalle/mac_messages_mcp — contact resolution, send mechanism, query patterns
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Send and read iMessages from your own Mac and Apple ID — drafts, history and contacts.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Explore your Messages SQLite database to browse tables and inspect schemas with ease. Run flexible…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables reading, searching, and sending iMessages directly from MCP-compatible clients by accessing the local macOS iMessage database, supporting conversations, attachments, and both individual and group chats.10MIT
- AlicenseNot gradedqualityDmaintenanceEnables sending and reading iMessages and SMS messages through the macOS Messages app via MCP.MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading and sending iMessages on macOS through MCP, with tools for managing chats, messages, and attachments via AI agents.MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading, sending, and managing iMessage conversations on macOS through MCP.1MIT