iMessage Max
Enables AI assistants to read, search, and send iMessages with features like contact name resolution, session grouping, and attachment listing. It provides intent-aligned tools to efficiently navigate conversation history and manage messages through natural language queries.
README
<p align="center"> <img src="icon.png" alt="iMessage Max" width="128"> </p>
iMessage Max
An MCP (Model Context Protocol) server for iMessage that lets AI assistants read and search your messages with proper contact resolution.
<!-- mcp-name: io.github.cyberpapiii/imessage-max -->
Features
- Contact Resolution - See names instead of phone numbers (resolves via macOS Contacts)
- Participant Lookup - Find chats by typing names like
find_chat(participants=["Nick", "Andrew"]) - Session Grouping - Messages grouped into conversation sessions with gap detection
- Token Efficient - Designed for AI consumption with compact responses and pagination
- Read-Only Safe - Only reads from chat.db, never modifies your messages
Why This Exists
Most iMessage tools expose raw database structures, requiring 3-5 tool calls per user intent. This MCP provides intent-aligned tools that work the way you'd naturally ask questions:
"What did Nick and I talk about yesterday?"
→ find_chat(participants=["Nick"]) + get_messages(since="yesterday")
"Show me recent group chats"
→ list_chats(is_group=True)
"Find where we discussed the trip"
→ search(query="trip")
Installation
From PyPI (Recommended)
pip install imessage-max
Using UV
# Install UV if you haven't
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install imessage-max
uv pip install imessage-max
From Source
pip install git+https://github.com/cyberpapiii/imessage-max.git
Setup
1. Grant Permissions
The MCP needs two macOS permissions to work properly:
Full Disk Access (Required)
Allows reading ~/Library/Messages/chat.db
- Open System Settings → Privacy & Security → Full Disk Access
- Click + and add your terminal app (Terminal.app, iTerm, Warp, etc.)
- If using Claude Desktop, add the process that runs Python:
- For UV: Add
/Users/YOU/.local/share/uv/python/(or find it withwhich python)
- For UV: Add
Contacts Access (Required for name resolution)
Allows resolving phone numbers to contact names
- Open System Settings → Privacy & Security → Contacts
- Add the same apps/processes as above
- Important: If using UV, you need to add UV itself (
~/.cargo/bin/uvor similar)
2. Configure Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"imessage": {
"command": "uvx",
"args": ["imessage-max"]
}
}
}
Or if installed via pip:
{
"mcpServers": {
"imessage": {
"command": "imessage-max"
}
}
}
3. Restart Claude Desktop
The MCP will request Contacts access on first run if not already granted.
Tools
find_chat
Find chats by participants, name, or recent content.
# Find a DM by contact name
find_chat(participants=["Nick"])
# Find a group chat with multiple people
find_chat(participants=["Nick", "Andrew"])
# Find a named group chat
find_chat(name="Family")
# Find chat where you discussed something recently
find_chat(contains_recent="dinner plans")
get_messages
Retrieve messages with flexible filtering.
# Get recent messages from a chat
get_messages(chat_id="chat123", limit=50)
# Get messages from the last 24 hours
get_messages(chat_id="chat123", since="24h")
# Get only messages from a specific person
get_messages(chat_id="chat123", from_person="Nick")
# Get messages containing specific text
get_messages(chat_id="chat123", contains="flight")
list_chats
Browse recent chats with previews.
# List recent chats
list_chats(limit=20)
# List only group chats
list_chats(is_group=True)
# List chats active in the last week
list_chats(since="7d")
search
Full-text search across all messages.
# Search all messages
search(query="dinner")
# Search messages from a specific person
search(query="dinner", from_person="Nick")
# Search with time bounds
search(query="meeting", since="2024-01-01", before="2024-02-01")
# Search only in group chats
search(query="party", is_group=True)
get_context
Get messages surrounding a specific message.
# Get context around a message
get_context(message_id="msg123", before=5, after=10)
# Find message containing text and get context
get_context(chat_id="chat123", contains="that link", before=3, after=5)
get_active_conversations
Find chats with recent back-and-forth activity.
# Find active conversations in the last 24 hours
get_active_conversations(hours=24)
# Find active group conversations
get_active_conversations(is_group=True, min_exchanges=3)
list_attachments
List attachments with metadata.
# List recent attachments
list_attachments(limit=20)
# List images from a specific chat
list_attachments(chat_id="chat123", type="image")
# List attachments from a specific person
list_attachments(from_person="Nick", type="any")
get_unread
Get unread messages or summary.
# Get all unread messages
get_unread()
# Get unread summary by chat
get_unread(format="summary")
# Get unread from specific chat
get_unread(chat_id="chat123")
send
Send a message (requires Automation permission for Messages.app).
# Send to a contact
send(to="Nick", text="Hey, are we still on for dinner?")
# Send to a group chat
send(chat_id="chat123", text="Running 5 minutes late")
diagnose
Troubleshoot configuration and permission issues.
# Check setup
diagnose()
# Returns: pyobjc_available, contacts_authorized, contacts_loaded count
Troubleshooting
Contacts showing as phone numbers
Run the diagnose tool to check status:
{
"pyobjc_available": true,
"contacts_authorized": false,
"authorization_status": "not_determined"
}
Fix: Add your Python interpreter or UV to System Settings → Privacy & Security → Contacts.
"Database not found" error
The MCP can't access ~/Library/Messages/chat.db.
Fix: Add your terminal/Python to System Settings → Privacy & Security → Full Disk Access.
Empty message previews
Some messages store text in attributedBody instead of text column. This is handled automatically as of v0.1.0.
MCP not loading in Claude Desktop
- Check your config file syntax is valid JSON
- Ensure the command path is correct
- Restart Claude Desktop completely (Cmd+Q, not just close window)
Development
# Clone the repo
git clone https://github.com/cyberpapiii/imessage-max.git
cd imessage-max
# Create virtual environment and install
uv venv
uv pip install -e ".[dev]"
# Run tests
pytest
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。