imessage-mcp
About
25 read-only tools for searching, analyzing, and exploring your entire iMessage history on macOS. Spotify Wrapped for texts, conversation analytics, streaks, read receipts, reactions, and more.
Explore
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:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
imessage-mcpCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
search_messages
Full-text search across all iMessages with rich filtering. Supports query text, contact, date range, direction, group chat, and attachment filters. By default, only searches contacts you've messaged. Use include_all to search everything.
get_conversation
Get a full conversation thread with a specific contact or chat. Supports cursor-based pagination via before_rowid for scrolling through history.
list_contacts
List all contacts with message counts and tier assignments. Supports filtering by tier and minimum message threshold. By default, only shows contacts you've actually messaged (replied to). Use include_all to see all.
get_contact
Deep info on a specific contact: tier, message stats, yearly breakdown, and recent messages.
resolve_contact
Fuzzy-match a name, phone number, or email to a contact record. Uses multi-level resolution: exact match, digits, fuzzy, and macOS AddressBook.
message_stats
Aggregate message statistics with flexible time-series grouping. Returns counts, sent/received splits, and averages grouped by day, week, month, year, hour, or day-of-week. By default excludes contacts you've never replied to.
contact_stats
Deep per-contact analytics: message volumes, response time estimates, conversation patterns, and yearly trends.
temporal_heatmap
Generate a 7x24 activity heatmap (day-of-week x hour-of-day). Returns message counts for each of the 168 weekly time slots. By default excludes contacts you've never replied to.
list_group_chats
List all group chats with member counts, message volumes, and activity dates. Group chats have multiple participants.
get_group_chat
Detailed info on a specific group chat: all members with per-member message counts, activity timeline, and recent messages.
list_attachments
Query message attachments (images, videos, audio, documents) with filtering by contact, MIME type, and date range. Returns file metadata, not file contents.
get_reactions
Tapback/reaction analytics: distribution by type, top reactors, most-reacted messages, emoji breakdown. Queries associated_message_type 2000-2005 for love/like/dislike/laugh/emphasize/question reactions.
get_read_receipts
Read receipt and delivery timing analytics: per-contact read latency stats, unread patterns, fastest/slowest readers. Queries date_read and date_delivered columns.
get_thread
Reconstruct iMessage reply threads using thread_originator_guid. Returns nested thread trees with parent message and all replies in order.
get_edited_messages
Find edited and unsent (retracted) messages. Queries date_retracted and date_edited columns. Returns message list with timestamps and per-contact stats.
get_message_effects
iMessage expressive send effects and screen effects analytics: slam, loud, gentle, invisible ink, confetti, fireworks, balloons, lasers, etc. Queries expressive_send_style_id.
on_this_day
Messages from this date in previous years — like 'Memories' for iMessage. Shows what you and your contacts were talking about exactly 1, 2, 3+ years ago today. By default excludes contacts you've never replied to.
first_last_message
The very first and very last message ever exchanged with a contact. People use this for sentimental lookups like 'what was the first text I sent my partner?' or 'what was the last thing my grandparent texted me?'
who_initiates
Who starts conversations? After a gap of N hours, the next message is a 'conversation initiation.' Shows per-contact who reaches out first and how often. Answers 'do I always text first?' By default excludes contacts you've never replied to.
streaks
Consecutive-day messaging streaks with contacts. Like Snapchat streaks but for iMessage. Shows longest streak, when it happened, and current streak status. By default excludes contacts you've never replied to.
double_texts
Detect double-texting and unanswered message patterns. Finds when you (or a contact) sent multiple consecutive messages without a reply. Shows frequency, longest bursts, and who does it more. Omit contact for a global ranking of who you double-text the most.
conversation_gaps
Find the longest silences in a conversation. Detects periods where you and a contact stopped talking — falling-outs, busy periods, or drifting apart. Shows gap duration and when it happened.
forgotten_contacts
Find dormant relationships — contacts you used to message but haven't talked to in a long time. Great for reconnecting with people you've lost touch with. By default excludes contacts you've never replied to.
yearly_wrapped
Your iMessage Year in Review — like Spotify Wrapped but for texting. Returns a complete summary of a year: total messages, top contacts, busiest day, monthly trends, reactions, group chats, media shared, late-night texting, new contacts, and effects used. By default excludes contacts you've never replied to. Defaults to last year.
help
Show the imessage-mcp guide: all 25 tools and usage examples. Call this when you're unsure what's available.
- search_messages: Full-text search across all iMessages with rich filtering. Supports query text, contact, date range, direction, group chat, and attachment filters. By default, only searches contacts you've messaged. Use include_all to search everything.
- get_conversation: Get a full conversation thread with a specific contact or chat. Supports cursor-based pagination via before_rowid for scrolling through history.
- list_contacts: List all contacts with message counts and tier assignments. Supports filtering by tier and minimum message threshold. By default, only shows contacts you've actually messaged (replied to). Use include_all to see all.
- get_contact: Deep info on a specific contact: tier, message stats, yearly breakdown, and recent messages.
- resolve_contact: Fuzzy-match a name, phone number, or email to a contact record. Uses multi-level resolution: exact match, digits, fuzzy, and macOS AddressBook.
- message_stats: Aggregate message statistics with flexible time-series grouping. Returns counts, sent/received splits, and averages grouped by day, week, month, year, hour, or day-of-week. By default excludes contacts you've never replied to.
- contact_stats: Deep per-contact analytics: message volumes, response time estimates, conversation patterns, and yearly trends.
- temporal_heatmap: Generate a 7x24 activity heatmap (day-of-week x hour-of-day). Returns message counts for each of the 168 weekly time slots. By default excludes contacts you've never replied to.
- list_group_chats: List all group chats with member counts, message volumes, and activity dates. Group chats have multiple participants.
- get_group_chat: Detailed info on a specific group chat: all members with per-member message counts, activity timeline, and recent messages.
- list_attachments: Query message attachments (images, videos, audio, documents) with filtering by contact, MIME type, and date range. Returns file metadata, not file contents.
- get_reactions: Tapback/reaction analytics: distribution by type, top reactors, most-reacted messages, emoji breakdown. Queries associated_message_type 2000-2005 for love/like/dislike/laugh/emphasize/question reactions.
- get_read_receipts: Read receipt and delivery timing analytics: per-contact read latency stats, unread patterns, fastest/slowest readers. Queries date_read and date_delivered columns.
- get_thread: Reconstruct iMessage reply threads using thread_originator_guid. Returns nested thread trees with parent message and all replies in order.
- get_edited_messages: Find edited and unsent (retracted) messages. Queries date_retracted and date_edited columns. Returns message list with timestamps and per-contact stats.
- get_message_effects: iMessage expressive send effects and screen effects analytics: slam, loud, gentle, invisible ink, confetti, fireworks, balloons, lasers, etc. Queries expressive_send_style_id.
- on_this_day: Messages from this date in previous years — like 'Memories' for iMessage. Shows what you and your contacts were talking about exactly 1, 2, 3+ years ago today. By default excludes contacts you've never replied to.
- first_last_message: The very first and very last message ever exchanged with a contact. People use this for sentimental lookups like 'what was the first text I sent my partner?' or 'what was the last thing my grandparent texted me?'
- who_initiates: Who starts conversations? After a gap of N hours, the next message is a 'conversation initiation.' Shows per-contact who reaches out first and how often. Answers 'do I always text first?' By default excludes contacts you've never replied to.
- streaks: Consecutive-day messaging streaks with contacts. Like Snapchat streaks but for iMessage. Shows longest streak, when it happened, and current streak status. By default excludes contacts you've never replied to.
- double_texts: Detect double-texting and unanswered message patterns. Finds when you (or a contact) sent multiple consecutive messages without a reply. Shows frequency, longest bursts, and who does it more. Omit contact for a global ranking of who you double-text the most.
- conversation_gaps: Find the longest silences in a conversation. Detects periods where you and a contact stopped talking — falling-outs, busy periods, or drifting apart. Shows gap duration and when it happened.
- forgotten_contacts: Find dormant relationships — contacts you used to message but haven't talked to in a long time. Great for reconnecting with people you've lost touch with. By default excludes contacts you've never replied to.
- yearly_wrapped: Your iMessage Year in Review — like Spotify Wrapped but for texting. Returns a complete summary of a year: total messages, top contacts, busiest day, monthly trends, reactions, group chats, media shared, late-night texting, new contacts, and effects used. By default excludes contacts you've never replied to. Defaults to last year.
- help: Show the imessage-mcp guide: all 25 tools and usage examples. Call this when you're unsure what's available.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"imessage-mcp": {
"server": {
"command": "node",
"args": [
"imessage-mcp"
],
"env": {
"IMESSAGE_PRIVACY": "",
"IMESSAGE_CONTACTS": "",
"IMESSAGE_DB": "",
"IMESSAGE_CACHE": "",
"IMESSAGE_UPDATE_CHECK": ""
}
}
}
}
}
McpServers
{
"server": {
"command": "node",
"args": [
"imessage-mcp"
],
"env": {
"IMESSAGE_PRIVACY": "",
"IMESSAGE_CONTACTS": "",
"IMESSAGE_DB": "",
"IMESSAGE_CACHE": "",
"IMESSAGE_UPDATE_CHECK": ""
}
}
}
Transport
"stdio"
Package
"imessage-mcp"
Registry
"npm"
26 tools for locally exploring your iMessage history with AI.
if this helped you, star it. it helps others find it.
Read-only access to 2 local files(chat.db+AddressBook). Zero network requests. Nothing is written, uploaded, or shared. All 26 tools are annotatedreadOnlyHint: true— your MCP client can auto-approve every call without prompts.
Smithery:One-click install via the Smithery registry — search forimessage-mcp.
# Claude Code (one command) claude mcp add imessage -- npx -y imessage-mcp
# Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
SeeSetupfor Cursor, Windsurf, VS Code, Codex CLI, Cline, JetBrains, and Zed.
- macOS(iMessage is macOS-only)
- Node.js 18+(node --version)
- Database accessfor your host application — macOS protectschat.dbwith its Application Data permission. Grant access in:System Settings > Privacy & Security > Full Disk Accessand enable the app running the MCP server (your terminal, Claude Desktop, or Cursor). GUI apps like Claude Desktop and Cursor may already have this permission.
- Messages in iCloudenabled on your Mac (if you use multiple devices) — seeiCloud Sync & Multiple Devices
imessage-mcp reads your local iMessage database inread-only mode. No data leaves your machine. Nothing is written, modified, uploaded, or shared.
No other files are accessed. No external APIs are called.
chat.db --> [imessage-mcp] --> stdio/http --> [Your MCP Client] --> AI Provider ^ ^ Your Mac only Already authorized by you
Once connected, ask your AI assistant anything about your messages in plain language:
- "Give me my 2024 iMessage Wrapped"
- "Do I always text first with [name]?"
- "What's my longest texting streak?"
- "Who reacts to my messages the most?"
- "What was the first text I ever sent my partner?"
- "What was I texting about on this day last year?"
- "Do I double-text [name] a lot?"
- "Who have I lost touch with?"
- "Show me the longest silence between me and [name]"
- "How many messages have I sent this year?"
- "Show my conversation with Mom"
- "What time of day am I most active texting?"
- "Show me messages people unsent"
- "What are the most popular group chats?"
26 tools across 10 categories. All read-only. All annotated withreadOnlyHint: true.
Add to~/Library/Application Support/Claude/claude_desktop_config.json:
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
claude mcp add imessage -- npx -y imessage-mcp
Or add to.mcp.jsonin your project root:
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
codex --mcp-config '{"imessage":{"command":"npx","args":["-y","imessage-mcp"]}}'
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
Add to~/.codeium/windsurf/mcp_config.json:
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
Add to.vscode/mcp.jsonin your project root:
{ "servers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
{ "servers": { "imessage": { "type": "http", "url": "http://localhost:3000/mcp" } } }
Add via the Cline MCP settings UI, or editcline_mcp_settings.json:
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"] } } }
Settings > Tools > AI Assistant > MCP Servers > Add:
- Name:imessage
- Command:npx
- Args:-y imessage-mcp
{ "context_servers": { "imessage": { "command": { "path": "npx", "args": ["-y", "imessage-mcp"] } } } }
Checks macOS version, Node.js version, chat.db access, database permissions, AddressBook, and message count.
$ npx imessage-mcp doctor imessage-mcp doctor ✓ macOS: Running on macOS (darwin) ✓ Node.js: Node v22.0.0 (>= 18 required) ✓ chat.db: Found at /Users/you/Library/Messages/chat.db ✓ Database access: Database readable ✓ Messages: 97,432 messages indexed ✓ AddressBook: 342 contacts resolved All checks passed — ready to use!
Pass--jsonfor machine-readable output:
# Export last 1000 messages npx imessage-mcp dump > messages.json # Filter by contact npx imessage-mcp dump --contact "+15551234567" # Date range with custom limit npx imessage-mcp dump --from 2024-01-01 --to 2024-12-31 --limit 5000 # Export contacts (excluding spam/promo by default) npx imessage-mcp dump --contacts > contacts.json # Include all contacts (even ones you never replied to) npx imessage-mcp dump --contacts --all > all-contacts.json # Export all messages (including unfiltered contacts) npx imessage-mcp dump --all > all-messages.json
By default, imessage-mcp usesstdiotransport — the standard for local MCP clients like Claude Desktop and Claude Code. For workflow tools (n8n, Lutra, Copilot Studio) or remote access, HTTP transport is available.
npx imessage-mcp --transport http --port 3000
Starts a Streamable HTTP server onhttp://127.0.0.1:3000/mcp. SupportsPOST,GET, andDELETEon/mcpwith session management viamcp-session-idheaders. This is the MCP 2025-03-26 standard.
npx imessage-mcp --transport sse --port 3000
Starts a legacy SSE server:GET /sseto establish the stream,POST /messages?sessionId=<id>for JSON-RPC requests. Use this only if your client does not support Streamable HTTP.
Run imessage-mcp as an HTTP server in Docker. Copy yourchat.dbto a volume mount:
docker build -t imessage-mcp . docker run -p 3000:3000 -v /path/to/chat.db:/data/chat.db:ro imessage-mcp
The container starts with--transport http --host 0.0.0.0on port 3000 by default. Connect any MCP client tohttp://localhost:3000/mcp.
To secure the HTTP endpoint with authentication:
docker run -p 3000:3000 -e IMESSAGE_API_TOKEN=your-secret-token -v /path/to/chat.db:/data/chat.db:ro imessage-mcp
All requests must then include theAuthorization: Bearer your-secret-tokenheader.
Prevent message bodies from being sent to the AI. Only metadata (counts, dates, contact names) is returned. No actual message text.
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"], "env": { "IMESSAGE_SAFE_MODE": "1" } } } }
Useful for demos, shared environments, or when you want analytics without exposing private conversations.
By default, listing and global search tools only include contacts you have actually replied to. This filters out spam, promo texts, and unknown senders.
Filtered tools:search_messages(global),list_contacts,message_stats(global),temporal_heatmap(global),who_initiates(global),streaks(global),on_this_day(global),forgotten_contacts,yearly_wrapped.
Unfiltered tools:get_conversation,get_contact,contact_stats,first_last_message,conversation_gaps,get_reactions,get_read_receipts,get_thread,get_edited_messages,get_message_effects, group chats, attachments,check_new_messages.
To include all contacts (including unrecognized senders), passinclude_all: trueto any filtered tool.
Looking for iCloud sync?This section covers real-time message tracking within imessage-mcp. To sync your full message history from iPhone/iPad to your Mac, seeiCloud Sync & Multiple Devices.
By default, every query reads the latest data — if someone texts you, your next tool call sees it immediately. No sync needed.
For proactive awareness, thecheck_new_messagestool tracks what arrived since your last check:
- First call sets a baseline
- Subsequent calls report the delta — count, who messaged, and optional text previews
{ "mcpServers": { "imessage": { "command": "npx", "args": ["-y", "imessage-mcp"], "env": { "IMESSAGE_SYNC": "watch" } } } }
This watches your iMessage database for changes and notifies your AI client within seconds. Uses macOS FSEvents — zero CPU when idle.
imessage-mcp reads your Mac's local database (~/Library/Messages/chat.db). This database only contains messages that have beensynced to your Mac. If your conversations live on your iPhone or iPad but haven't synced, imessage-mcp won't see them.
If you only use iMessage on your Mac, you can skip this — your messages are already inchat.db.
Apple's "Messages in iCloud" keeps your full message history synchronized across all your Apple devices:
┌─────────────┐ ┌──────────┐ ┌──────────────┐ │ iPhone/iPad │ ──────► │ iCloud │ ──────► │ Your Mac │ │ (sends & │ ◄────── │(Messages │ ◄────── │ │ │ receives) │ │in iCloud)│ │ chat.db │ └─────────────┘ └──────────┘ └──────┬───────┘ │ ▼ imessage-mcp reads this ↑
Without "Messages in iCloud" enabledon your Mac, the Mac'schat.dbonly contains messages sent and received while Messages.app was actively running on that Mac.
- OpenMessages.appon your Mac
- Go toSettings(Cmd+,) >iMessagetab
- Check"Enable Messages in iCloud"
- Keep Messages.app open — sync begins automatically
- OpenSettings> tap yourname(Apple ID) >iCloud>Messages
- Toggle"Use on this iPhone"ON
All devices must be signed into thesame Apple ID. Check: Mac (System Settings > Apple ID), iPhone (Settings > tap your name).
Initial sync can takehours or even daysfor large message histories. During sync:
- Messages.app must remainopenon your Mac
- Your Mac should be connected toWi-Fi and power
- You'll see a"Syncing with iCloud"status in Messages.app
imessage-mcp resolves phone numbers to names using your Mac's AddressBook. If contacts only exist on your iPhone:
- OpenSystem Settings>Apple ID>iCloud
- FindContactsand toggle itON
- Wait for contacts to sync (usually under a minute)
Look for theMessagesline — it shows how many messages are indexed locally. If this number seems low, iCloud sync is likely still in progress. Rundoctoragain later to confirm the count has stabilized.
Tip:On your iPhone, go toSettings > General > iPhone Storage > Messagesto see your total message history size. Compare with whatdoctorreports on your Mac.
Messages on iPhone don't appear on Mac:"Messages in iCloud" must be enabled onbothdevices. Ensure both use the same Apple ID. Keep Messages.app open on your Mac. Runnpx imessage-mcp doctorperiodically to check if the count is growing.
Brand-new Mac shows no history:Expected — enable "Messages in iCloud," connect to Wi-Fi and power, keep Messages.app open. For large histories (100K+ messages), initial sync may take 1–2 days.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



