imessage-mcp
Provides read and write access to iMessage data, allowing AI agents to send messages via Messages.app and read message history from the local chat.db database.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@imessage-mcp send a message to Mom saying I'll be home in 30 minutes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
imessage-mcp
A local MCP server that exposes your Mac's iMessage data to Claude Desktop / Claude Code. Two surfaces:
SEND via AppleScript →
Messages.appREAD via direct, read-only SQLite access to
~/Library/Messages/chat.db
Everything is local. No API keys, no network calls.
Install
# 1. Clone / copy into ~/mcp-servers/imessage-mcp
cd ~/mcp-servers/imessage-mcp
# 2. Create a Python 3.11+ venv and install deps
python3.12 -m venv .venv
.venv/bin/pip install -e .Related MCP server: imessage-mcp
Permissions (required)
Full Disk Access — so we can read chat.db
System Settings → Privacy & Security → Full Disk Access → toggle ON for:
your terminal app (e.g. Terminal, iTerm2, Ghostty), AND
Claude.app(if using Claude Desktop)
Automation — so we can control Messages.app
System Settings → Privacy & Security → Automation → expand your terminal / Claude.app
and toggle Messages to ON.
Messages.app must be running and signed into iMessage.
If a permission step is missing, the server errors with the exact settings path to open.
Claude Desktop config
Merge into ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"imessage": {
"command": "/Users/YOUR_USERNAME/mcp-servers/imessage-mcp/.venv/bin/python",
"args": ["-m", "imessage_mcp.server"]
}
}
}(The absolute path to the venv's python is the safest — it avoids PATH
ambiguity. Replace YOUR_USERNAME.)
Tools
Tool | Purpose |
| Send via Messages.app. |
| Newest-first chats with last-message preview and unread count. |
| Messages for a chat; provide |
| Case-insensitive LIKE across message bodies. |
| Self-handles + DB metadata. |
Dates are ISO8601 in and out. Internally, Apple stores message.date as
nanoseconds since 2001-01-01 UTC; the server converts both ways.
Safety invariants
chat.dbis opened withsqlite3.connect("file:...chat.db?mode=ro", uri=True). Any write attempt raisessqlite3.OperationalError: attempt to write a readonly database.send_imessagepasses recipient / body / service as separate osascript argv entries — no shell interpolation, no injection.Attachments return metadata only (filename, mime_type, total_bytes). Blobs are never read.
Limitations
Scheduled / delayed sends are not supported.
Rich / reply-threaded messages may have their text stored in
attributedBody(NSKeyedArchive). We best-effort extract the embedded NSString; messages with more exotic payloads (images, taps, Apple Pay) will show emptybodybut correct metadata.Delivery confirmation:
send_imessagereports success from osascript's exit code. To verify the message actually went through, callsearch_imessagesorget_chat_messagesa few seconds later.This is macOS-only and will not work on sandboxed App Store apps.
Local development
.venv/bin/pytest -qAvailable Tools
6 toolsget_chat_messagesA
Return messages for a chat. Provide chat_id or handle (phone/email).
since is an ISO8601 datetime. Attachments are metadata only.
Inputs: chat_id, handle, limit, since. Returns: result
get_my_infoA
Return self-handles and chat.db metadata for sanity checks.
Inputs: no named parameters. Returns: object
list_recent_chatsB
List recent chats, newest-first, with previews and unread counts.
Inputs: limit. Returns: result
resolve_contactA
Resolve an iMessage handle to a name, or a name to handles.
Provide either handle (phone like +15551234567 or email) or name.
Checks a local JSON cache first, then falls back to the macOS AddressBook
SQLite. New hits are written back to the cache for future sessions.
Inputs: name, handle. Returns: object
search_imessagesA
Case-insensitive LIKE search over message bodies. Dates are ISO8601.
Inputs: query (required), since, until, from_contact, +1 more. Returns: result
send_imessageA
Send an iMessage/SMS via Messages.app.
Args: recipient: phone (+15551234567), Apple ID email, or an existing buddy name. body: message text. service: "iMessage" (default) or "SMS".
Inputs: recipient (required), body (required), service. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: retrieving messages by chat or search, listing chats, resolving contacts, sending messages, and getting self info. No two tools overlap in functionality.
All tool names follow a consistent verb_noun pattern (get_, list_, resolve_, search_, send_), making the API predictable and easy to navigate.
With 6 tools covering core iMessage operations (read, send, search, list, resolve), the set is well-scoped and each tool earns its place without unnecessary bloat.
Covers essential CRUD-like operations (read via chat or search, send, list) plus contact resolution and self-info. Missing message deletion or editing, but those are uncommon for MCP servers, so no significant gap.
Related MCP Connectors
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Free WhatsApp MCP server for ChatGPT and Claude: read and search chats, every send you approve.
Hosted Apple Health MCP for Claude and ChatGPT, works outside the US. iPhone app, no local server.
Read, search and manage iCloud Mail, Calendar and Contacts from Claude and other MCP clients.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables full-text search of macOS iMessages including link preview metadata. Works as an MCP server for Claude Desktop to search your messages locally.1MIT
- FlicenseAqualityDmaintenanceA read-only MCP server that exposes your iMessage data to Claude Code and Claude Desktop, with automatic contact name resolution.3-
- AlicenseAqualityDmaintenanceA read-only MCP server that lets Claude Desktop interact with Apple Mail on macOS via AppleScript. It enables listing mailboxes, searching emails, and reading email content without making network calls.3MIT
- FlicenseNot gradedqualityDmaintenanceA read-only iMessage MCP server for macOS that lets you list conversations, read chats, and search message history through Claude or a CLI. It is auditable, dependency-light, and deliberately has no send capability.-