imessage-mcp
imessage-mcp
Claude CodeおよびClaude DesktopにiMessageデータを公開する読み取り専用のMCPサーバーです。連絡先名の自動解決機能付き。
セットアップ
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')
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | ||
| limit | No | ||
| since | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behavior. It describes a read operation with filtering, but omits details like rate limits, permissions, or whether messages are sorted.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two short paragraphs: one for purpose, one for parameters. No unnecessary words or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read tool with output schema, the description covers the key aspects: what it does and what each parameter does. Could mention sorting or pagination, but not essential.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage; the description adds crucial meaning by explaining chat_id as from list_chats, limit with its default, and since with ISO date examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets messages from a specific iMessage chat, distinguishing it from sibling search_messages by specifying the chat_id is obtained from list_chats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by stating chat_id comes from list_chats and provides limit/since filters, but does not explicitly compare to search_messages or advise when not to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_chatsA
List iMessage chats sorted by most recent activity.
Args: limit: Maximum number of chats to return (default 50)
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions sorting by activity but does not disclose if it requires authentication, rate limits, pagination, or that it is read-only. It adds minimal behavioral context beyond the action itself.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely terse: one sentence for purpose and one for the parameter. Every sentence earns its place with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, output schema available), the description covers the essential purpose and parameter semantics. It lacks mention of sorting direction but 'most recent activity' implies descending. Mostly complete for a simple list tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description explains the 'limit' parameter as 'Maximum number of chats to return (default 50)', adding meaning beyond the schema's type and default. With 0% schema coverage, this compensates adequately, though other implicit constraints are not mentioned.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List iMessage chats sorted by most recent activity', using a specific verb and resource, and is differentiated from sibling tools (get_messages, search_messages) which focus on individual messages.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like get_messages or search_messages, nor any context for selection or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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)
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavior. It only states that it searches all chats, without detailing performance, pagination, error handling, or what happens with empty queries or limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise, with two sentences and a bullet list. It front-loads the core purpose. However, it could be more structured (e.g., separate sections) to improve readability for complex use cases.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 parameters, no nested objects) and the presence of an output schema, the description is mostly adequate. However, it lacks usage context and any mention of return structure, leaving some gaps for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, yet the description adds only minimal clarification: 'The text to search for' for query and 'Maximum number of results to return (default 50)' for limit. This adds little beyond the schema's title fields, failing to compensate for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches all iMessage chats for messages containing the query text, specifying the verb 'search', resource 'iMessage chats', and scope 'all'. It distinguishes from siblings 'get_messages' (which likely retrieves specific messages) and 'list_chats'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool vs. its siblings ('get_messages', 'list_chats'), nor are there any prerequisites or exclusions mentioned. The agent is left to infer usage context without explicit direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
get_messages - First observed
list_chats - First observed
search_messages
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
Let Claude or ChatGPT search, read and send your WhatsApp messages over MCP. OAuth sign-in.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Your own WhatsApp as an MCP server: read, search and send from any MCP client.
Related MCP Servers
- AlicenseAqualityCmaintenanceA 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
- 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
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server for your iMessage DB. No hosted service.MIT
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server for local macOS Messages database, enabling querying of chats, messages, attachments, and metadata.246 npmMIT