messages
Provides fuzzy search and browsing capabilities for Apple Messages (iMessage/SMS), including tools to search messages, list recent messages, contacts, conversations, and retrieve message threads.
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., "@messagessearch for coffee tomorrow"
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.
messages
Fuzzy search and browse Apple Messages (iMessage/SMS) from the command line, as a Claude Code plugin, or as an MCP server.
Features
Fuzzy search with typo tolerance across all your messages
Browse recent messages, contacts, and conversations
Contact resolution - shows names instead of phone numbers
Context display - see messages before/after each match
Filter by sender or date range
Auto-indexing - index automatically rebuilds when new messages are detected
Multiple interfaces - CLI, MCP server, or Claude Code plugin
Related MCP server: iMessage MCP Server
Requirements
macOS (reads from Apple Messages database)
Node.js 22+
Full Disk Access permission for your terminal (to read
~/Library/Messages/chat.db)
Installation
Homebrew
brew install cardmagic/tap/messagesnpm
npm install -g @cardmagic/messagesClaude Code Plugin (recommended)
Install as a plugin to get skills (auto-invoked) and slash commands:
# Add the marketplace
claude plugin marketplace add cardmagic/ai-marketplace
# Install the plugin
claude plugin install messages@cardmagicThis gives you:
Skill: Claude automatically searches messages when you ask about texts/iMessages
Slash commands:
/messages:search,/messages:recent,/messages:from, and more
MCP Server
For direct MCP tool access without the plugin:
claude mcp add --transport stdio messages -- npx -y @cardmagic/messages --mcpOr install globally first:
npm install -g @cardmagic/messages
claude mcp add --transport stdio messages -- messages --mcpFrom source
git clone https://github.com/cardmagic/messages.git
cd messages
make install
# Then add as plugin OR MCP server:
claude plugin marketplace add cardmagic/ai-marketplace
claude plugin install messages@cardmagic
# OR
claude mcp add --transport stdio messages -- messages --mcpGranting Full Disk Access
The tool needs to read your Messages database at ~/Library/Messages/chat.db:
Open System Settings > Privacy & Security > Full Disk Access
Click + and add your terminal app (Terminal.app, iTerm, Warp, etc.)
Restart your terminal
Usage
CLI
Browse Commands
# Show most recent messages (who texted me?)
messages recent
# List contacts by recent activity
messages contacts --limit 10
# List conversations with message counts
messages conversations
# Show recent messages from someone
messages from "Mom"
# Show full conversation thread
messages thread "John" --after 2024-12-01Search Commands
# Search for messages (index auto-builds on first search)
messages search "coffee tomorrow"
# Filter by sender
messages search "dinner" --from "Mom"
# Filter by date
messages search "meeting" --after 2024-01-01
# Adjust result count and context
messages search "project" --limit 20 --context 5
# Show index statistics
messages stats
# Force rebuild the index
messages indexSearch Options
Option | Description |
| Filter by sender name or phone |
| Only messages after date (YYYY-MM-DD) |
| Max results (default: 10) |
| Messages before/after (default: 2) |
Claude Code Plugin
When installed as a plugin, you get:
Skill (auto-invoked): Claude automatically searches messages when you ask things like:
"What did Mom say about dinner?"
"Who texted me recently?"
"Find messages about the trip"
Slash Commands:
Command | Description |
| Fuzzy search with optional filters |
| Show most recent messages |
| List contacts by activity |
| List conversations with message counts |
| Messages from a specific person |
| Full conversation thread |
| Alias for browse commands |
MCP Server
When installed as an MCP server, Claude Code can use these tools:
Tool | Description |
| Search messages with fuzzy matching |
| Get most recent messages |
| List contacts by activity |
| List conversations with counts |
| Get conversation thread with a contact |
| Get index statistics |
Manual MCP Configuration
For Claude Desktop or VS Code, add to your MCP configuration:
{
"mcpServers": {
"messages": {
"command": "npx",
"args": ["-y", "@cardmagic/messages", "--mcp"]
}
}
}How It Works
Auto-Indexing: On first search (or when new messages are detected), the tool automatically:
Reads your Apple Messages SQLite database
Builds a SQLite FTS5 full-text search index
Creates a MiniSearch fuzzy search index
Resolves contact names from your Address Book
Searching: Queries both indexes for best results with typo tolerance
Storage: Index files are stored in
~/.messages/:index.db- SQLite FTS5 databasefuzzy.json- MiniSearch indexstats.json- Index statistics
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables Claude to send and read iMessages on macOS, with smart contact lookup, message history retrieval, and cross-conversation search using natural language commands.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to read and search through iMessage, SMS, and RCS conversations, including mixed-protocol group chats with Android users. It decodes binary message data from the macOS Messages database to provide a comprehensive view of message history.8MIT
- AlicenseAqualityCmaintenanceEnables full-text search of macOS iMessages including link preview metadata. Works as an MCP server for Claude Desktop to search your messages locally.1MIT
- -licenseNot gradedqualityNot gradedmaintenanceRead, search, and send iMessages locally from your terminal or through MCP clients like Claude, Cursor, and VS Code.-