25 tools for exploring your iMessage history on macOS.
An MCP server that gives AI assistants read-only access to your local iMessage database. Search messages, analyze conversations, explore reactions, read receipts, reply threads, edited messages, effects, streaks, conversation patterns, and more. Nothing leaves your machine.
Install
npm install -g imessage-mcp
Or run without installing:
npx imessage-mcp doctor
Add to your AI client
# Claude Code (one command)
claude mcp add imessage -- npx -y imessage-mcp
Claude Code Plugin
For slash commands and agents:
claude plugin add anipotts/imessage-mcp
# Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json
macOS protects ~/Library/Messages/chat.db. Your terminal needs Full Disk Access to read it. This is an Apple requirement, not something imessage-mcp imposes.
How your data flows
chat.db --> [imessage-mcp] --> stdio --> [Your MCP Client] --> AI Provider
^ ^
Your Mac only Already authorized by you
imessage-mcp makes zero network requests. Your data only leaves your machine through your MCP client (Claude Desktop, Cursor, etc.), which you have already authorized separately.
Safe Mode
Prevent message bodies from being sent to the AI. Only metadata (counts, dates, contact names) is returned. No actual message text.
Useful for demos, shared environments, or when you want analytics without exposing private conversations.
Smart Filtering
By default, listing and global search tools only include contacts you have actually replied to. This filters out spam, promo texts, and unknown senders.
Unfiltered tools:get_conversation, get_contact, contact_stats, first_last_message. These always return results for any contact you specify.
To include all contacts (including unrecognized senders), pass include_all: true to any filtered tool.
Configuration
Variable
Default
Description
IMESSAGE_DB
~/Library/Messages/chat.db
Path to iMessage database
IMESSAGE_SAFE_MODE
false
Set to 1 to redact all message bodies. Tools return only metadata.
Troubleshooting
"Cannot read chat.db" / SQLITE_CANTOPEN
Grant Full Disk Access to your terminal app:
System Settings > Privacy & Security > Full Disk Access > enable your terminal app.
Restart your terminal after granting access.
"No messages found"
Make sure Messages.app has been used on this Mac and has synced your messages. Run npx imessage-mcp doctor to verify.
Messages show phone numbers instead of names
Contact resolution uses your macOS AddressBook. If contacts are only on your phone and not synced to your Mac, names will not resolve. Sync contacts via iCloud or add them in the Contacts app.
Node.js version mismatch (MODULE_NOT_FOUND / NODE_MODULE_VERSION)
Your MCP client's bundled Node.js version differs from the one that compiled better-sqlite3's native module.
Fix by pointing to your system Node directly:
Find your Node path: which node (usually /opt/homebrew/bin/node or /usr/local/bin/node)
Find imessage-mcp: npm root -g or dirname $(which imessage-mcp)
Verify the config file is at ~/Library/Application Support/Claude/claude_desktop_config.json
Restart Claude Desktop completely (Cmd+Q, then reopen)
Run npx imessage-mcp doctor to confirm the server works independently
Uninstall
npm uninstall -g imessage-mcp
To revoke database access, remove your terminal from System Settings > Privacy & Security > Full Disk Access.
How It Works
imessage-mcp reads ~/Library/Messages/chat.db using better-sqlite3 in read-only mode with query_only = ON. Contact names are resolved from your macOS AddressBook automatically.
On macOS 14 (Sonoma) and later, Apple changed how message text is stored. Some messages have NULL in the text column but contain the actual text in the attributedBody binary blob. imessage-mcp extracts text from this blob automatically so no messages are left behind.
All 25 tools are annotated with readOnlyHint: true so MCP clients can auto-approve them without user prompts.
iMessage MCP server — 25 tools for searching, analyzing, and exploring your entire iMessage history on macOS
We found that imessage-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 25 Feb 2026
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.
Socket has joined the new Composer and Packagist sponsorship program as a launch sponsor, supporting the team that keeps PHP's package ecosystem secure.