imessage-mcp
imessage-mcp
一个只读的 MCP 服务器,将您的 iMessage 数据暴露给 Claude Code 和 Claude Desktop,并支持自动联系人姓名解析。
设置
1. 安装
cd ~/workspace/imessage-mcp
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e .2. 授予完全磁盘访问权限
该服务器需要读取 ~/Library/Messages/chat.db 和联系人数据库。请为运行该服务器的应用程序授予完全磁盘访问权限:
打开 系统设置 → 隐私与安全性 → 完全磁盘访问权限
对于 Claude Code:添加您的终端应用程序(例如 Terminal, iTerm2, Ghostty)
对于 Claude Desktop:添加 Claude 应用程序
3. 配置 Claude Code
添加到 ~/.claude/settings.json:
{
"mcpServers": {
"imessage": {
"command": "/Users/jaredmoskowitz/workspace/imessage-mcp/.venv/bin/python",
"args": ["-m", "imessage_mcp"]
}
}
}4. 配置 Claude Desktop
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"imessage": {
"command": "/Users/jaredmoskowitz/workspace/imessage-mcp/.venv/bin/python",
"args": ["-m", "imessage_mcp"]
}
}
}Related MCP server: imessage-rich-search
工具
list_chats
列出按最近活动排序的 iMessage 聊天记录。
limit(可选,默认 50):返回的最大聊天数
get_messages
获取特定聊天中的消息。
chat_id(必填):来自list_chats的聊天标识符limit(可选,默认 50):最大消息数since(可选):ISO 日期字符串 — 仅获取此日期之后的消息
search_messages
在所有聊天中搜索包含关键字的消息。
query(必填):搜索文本limit(可选,默认 50):最大结果数
使用示例
"列出我的群聊" "获取我的 Business Ideas 聊天中的最后 20 条消息" "在我的消息中搜索 'startup idea'"
Available Tools
3 toolsget_messagesA
Get messages from a specific iMessage chat.
Args: chat_id: The chat identifier (from list_chats) limit: Maximum number of messages to return (default 50) since: Only return messages after this ISO date (e.g. '2024-01-15' or '2024-01-15T10:30:00')
Inputs: chat_id (required), limit, since. Returns: result
list_chatsA
List iMessage chats sorted by most recent activity.
Args: limit: Maximum number of chats to return (default 50)
Inputs: limit. Returns: result
search_messagesB
Search all iMessage chats for messages containing the query text.
Args: query: The text to search for limit: Maximum number of results to return (default 50)
Inputs: query (required), limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct operation: listing chats, retrieving messages from a specific chat, and searching across all chats. There is no functional overlap.
All tool names follow a consistent verb_noun pattern using snake_case (list_chats, get_messages, search_messages), making the set predictable.
Three tools is appropriate for the server's scope, covering essential read operations without being too few or excessive.
The tool set provides solid coverage for reading iMessage data. A potential minor gap is the lack of a send message tool, but that may be intentional for a read-only server.
Maintenance
Related MCP Connectors
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Read, search and manage iCloud Mail, Calendar and Contacts from Claude and other MCP clients.
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.
Related MCP Servers
- AlicenseAqualityDmaintenanceA local MCP server that enables reading iMessage conversations and sending new messages through Claude Desktop. It provides secure, read-only access to your Mac's iMessage database and AppleScript-based message sending capabilities.6MIT
- 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
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server for your iMessage DB. No hosted service.MIT
- AlicenseNot gradedqualityCmaintenancemacOS-only MCP server that exposes iMessage history to Claude and exports per-chat conversations into an Obsidian vault.3MIT