iMessage History

io.github.anipottsbuilds由 GitHub 账号 anipottsbuilds 发布v3.3.2更新于 Oct 24, 2026

Read-only MCP server for searching and reading Apple Messages history on macOS.

已验证STDIO仅桌面文件与存储沟通与协作

概览

AI 生成的概览

一个只读的本地 MCP 服务器,让助手在 Mac 上搜索和读取 Apple 信息历史,包括对话、附件和通信统计。

可以做什么
按词、精确文本、词元或短语搜索信息,可按服务、收发方向和日期筛选;按联系人、服务、类型、回复状态或日期列出对话及其最新消息。读取完整对话,包括编辑、撤回、回应、回复、已读回执、群组事件和附件,并可向前翻页查看更早事件。显示单个附件,图片以去除位置和相机元数据的 JPEG 返回。按游标拉取变更,包括新增、编辑、撤回和删除的信息、成员关系、回应和回执。分析按小时和星期分布的数量、回复时间、连续记录以及谁发起对话,并把姓名、电话号码或邮箱解析为 Mac 通讯录中的联系人。
适用场景
适合希望助手帮你了解未读短信、查找某条具体信息、总结一周对话,或回答回复速度和发消息习惯等问题的场景,且需在装有“信息”应用的 Mac 上使用。适合想要本地只读访问而非云服务的用户。
运行要求
macOS 14 或更新版本;使用 npx 安装需要 Node.js 24.16 或更新版本(Claude Desktop 自带运行时)。运行该服务器的应用需要获得“完全磁盘访问权限”以读取信息数据库。可选设置包括 IMESSAGE_PRIVACY、IMESSAGE_CONTACTS、IMESSAGE_DB、IMESSAGE_CACHE 和 IMESSAGE_UPDATE_CHECK;使用 HTTP 传输还需 IMESSAGE_API_TOKEN 或 IMESSAGE_API_TOKEN_FILE。
安装前请注意
信息内容会发送给你使用的 MCP 客户端及其模型提供商,并受其政策约束;默认的 full 隐私模式会暴露信息文本和文件名,可用 redacted 或 aggregate 模式限制外发内容。信息文本不可信,可能包含试图操纵助手的指令。服务器为只读,不能发送、编辑或回应,但会读取你的全部信息历史和通讯录。唯一的网络请求是可选的 npm 版本检查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 iMessage History,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[图片]

imessage-mcp

[npm] [MCP Registry] [CI] [License: MIT]

Search and read your Messages history from Claude, Codex, Cursor, VS Code, and any other MCP client.

[Claude Code catching up on a real conversation about a hackathon through imessage-mcp]

Read-only. Runs on your Mac. No accounts, no cloud service, nothing to compile.

  • Finds messages by words, exact text, or phrase across iMessage, SMS, MMS, and RCS
  • Reads whole conversations with edits, unsent messages, reactions, replies, and read receipts
  • Shows photos people sent you, with location data removed
  • Keeps up with new messages through a change feed, and answers counts and response-time questions

Install

Requirements: macOS 14 or newer. Node.js 24.16 or newer for npx installs (Claude Desktop brings its own). Use Node 24 LTS for encrypted cache support. Runtimes without SQLite checkpoint APIs, including Node 25, search in memory and rebuild after a restart; doctor reports this.

Standard config, for any client that reads mcpServers JSON:

json
{  "mcpServers": {    "imessage": {      "command": "npx",      "args": ["-y", "imessage-mcp@latest"]    }  }}

Then give the app that runs it Full Disk Access: System Settings > Privacy & Security > Full Disk Access, turn on the app (Claude, your terminal, Cursor, VS Code, ...), then quit it fully and reopen it. Not sure which app? Run npx -y imessage-mcp@latest doctor from that app's terminal and it tells you. Until access is granted, every tool answers with these same steps.

Amp
bash
amp mcp add imessage -- npx -y imessage-mcp@latest
Claude Code
bash
claude mcp add --scope user imessage -- npx -y imessage-mcp@latest

Or install the plugin: /plugin marketplace add anipotts/imessage-mcp, then /plugin install imessage-mcp@anipotts.

Claude Desktop

Download imessage-mcp.mcpb and double-click it, or install iMessage History from Settings > Extensions if it is listed there. To update a bundle you installed yourself, download the newest one and double-click it again.

Then turn on Claude in Full Disk Access and quit and reopen Claude.

Cline

Add the standard config to cline_mcp_settings.json (docs).

Codex
bash
codex mcp add imessage -- npx -y imessage-mcp@latest

Or in ~/.codex/config.toml:

toml
[mcp_servers.imessage]command = "npx"args = ["-y", "imessage-mcp@latest"]
Copilot CLI

Run /mcp add, or add the standard config to ~/.copilot/mcp-config.json with "type": "local".

Cursor

[Install in Cursor]

Or add the standard config to ~/.cursor/mcp.json.

Gemini CLI

Add the standard config to ~/.gemini/settings.json.

Goose

[Install in Goose]

JetBrains (Junie)

Add the standard config to .junie/mcp/mcp.json, or type /mcp in Junie CLI.

Kiro

[Add to Kiro]

opencode

In ~/.config/opencode/opencode.json:

json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "imessage": { "type": "local", "command": ["npx", "-y", "imessage-mcp@latest"], "enabled": true }  }}
VS Code

[Install in VS Code] [Install in VS Code Insiders]

bash
code --add-mcp '{"name":"imessage","command":"npx","args":["-y","imessage-mcp@latest"]}'
Warp, Windsurf, Zed, and others

Add the standard config in the client's MCP settings. Zed uses context_servers with "source": "custom".

If a GUI app reports that npx was not found, it cannot see your Node installation: use the full path from which npx as the command.

Use it

Ask in plain words: "catch me up on my texts", "find the message about the dinner reservation", "how fast does Sam usually reply?". Three prompts are also in your client's prompt menu:

promptwhat it does
catch_upWho is waiting on a reply from you, and what they need
draft_replyA reply in your own texting style. You send it; this server cannot.
recapYour week in messages: volume, busiest conversations, anyone still waiting

Clients that attach resources can use imessage://conversations and imessage://conversations/{chat_id}.

Tools

toolwhat it does
search_messagesSearch by substring, exact text, token, or phrase. Message text by default; conversation names and attachment filenames are opt-in. Filter by service, sent or received, and date
get_conversationRead a conversation by chat_id or by a contact or group name, with edits, reactions, receipts, replies, group events, and attachments. The cursor pages to older events
list_conversationsFind conversations by contact, service, kind, reply state, or date, each with its latest message, newest first or by who you text most
get_attachmentShow one attachment from get_conversation: images as a JPEG with location and camera metadata removed, text files as text. Needs the full privacy mode
sync_messagesPull every change since a cursor: new, edited, unsent, and deleted messages, conversation memberships, reactions, and receipts
analyze_communicationMessage counts by hour and weekday, response times, streaks, and who starts conversations
resolve_contactMatch a name, phone number, or email to a contact in your Mac's Address Book, and report ambiguity rather than guess
server_statusVersion, update availability, privacy mode, index and cache state, schema support, conversation membership counts, and Contacts access

Every tool is read-only and marked readOnlyHint. Results use plain ids (message_id, chat_id, attachment_id) you can pass between tools.

Apple can record the same message in several conversations. Search returns that message once with all canonical chat_ids and their conversations labels. A single membership also includes chat_id and conversation; for shared results, pass the relevant id from chat_ids to get_conversation. Only Apple's explicit lookup evidence combines chat aliases. Shared messages do not combine unrelated conversations.

Global and contact message counts deduplicate shared records within the requested scope. Conversation timelines and sequence metrics retain each recorded membership, so adding per-conversation counts can exceed the global count. Sync includes chat_ids on changes and emits message_membership_changed with previous_chat_ids; its changed_at is null because Apple does not timestamp these joins. Logged memberships describe the change when observed; available text, sender and receipt fields describe current source state. Upgrading the index format rebuilds its cache once and invalidates older sync cursors; start a new sync when it returns DATABASE_CHANGED.

Contact names expand to the selected person's addresses. An exact phone number or email scopes only that address, even when Contacts has conflicting labels. resolve_contact still reports ambiguous identity; address scoping does not merge people or include their other addresses. For an address-like group title, search with the conversation_names scope and use the selected chat_id.

Every tool's output schema accepts both its success envelope and the structured error envelope, so strict clients can expose the original reason and recovery hints.

Conversation reads are strict by default. When a body or relationship cannot be recovered completely, the error explains the allow_partial: true retry. Partial results retain completeness, warnings and each event's row_status; inspect these before citing evidence. Narrower dates or around_message_id can avoid an unrelated damaged event. Structural failures still fail closed.

Configuration

Add options to args, for example ["-y", "imessage-mcp@latest", "--privacy", "redacted"].

optiondescription
--privacy <mode>The most any caller can see. full (default), redacted (names and masked handles, calendar days, no message text or filenames), or aggregate (counts only). A call can ask for a stricter mode, never a looser one. env IMESSAGE_PRIVACY
--contacts <mode>live (default) names handles from your Contacts; none shows handles only. env IMESSAGE_CONTACTS
--database <path>Read a copy of chat.db instead of this Mac's Messages. env IMESSAGE_DB
--transport http --port <n>Serve MCP over HTTP on 127.0.0.1 instead of stdio. Requires IMESSAGE_API_TOKEN or IMESSAGE_API_TOKEN_FILE. IMESSAGE_ALLOWED_HOSTS and IMESSAGE_ALLOWED_ORIGINS take comma-separated lists; both default to localhost.
IMESSAGE_CACHE=0Keep the search index in memory only
IMESSAGE_WARM_SEARCH=0Build the search index on the first search instead of at startup
IMESSAGE_UPDATE_CHECK=0Turn off the version check

Privacy and security

  • Read-only. The server opens the Messages database read-only and has no tool that sends, edits, reacts, or marks anything read.
  • Local. No accounts, telemetry, or analytics. The only network request is an optional version check to the npm registry.
  • Your client sees what you ask for. Results go to the MCP client you use and its model provider, under their policies. --privacy redacted or aggregate limits what leaves the server.
  • Search index. Built on your Mac and, when SQLite checkpoint APIs are available, cached encrypted in ~/Library/Caches/imessage-mcp, with a key derived from your Messages database, so it opens only for an app that can already read your messages. Deleting it is always safe. server_status reports an unavailable or failed cache while searches continue from memory.
  • Untrusted content. Messages can contain text written to manipulate an AI. The server tells clients to treat all message content as data, never as instructions.

Details: SECURITY.md and PRIVACY.md.

Development

bash
npm cinpm test      # unit tests on synthetic Messages databasesnpm run e2e   # launches the built server over stdio and HTTPnpm run perf  # one-million-message performance gates

Tests use synthetic data only. See CONTRIBUTING.md.

Dependency PRs use protected auto-merge through a repository-scoped GitHub App, without personal-token renewal. A daily health check detects authentication failures and stalled updates; see maintenance and recovery.

  • Retire the unused owner-token copies after the App migration is verified and rollback is no longer needed.
  • After extended inactivity, verify that GitHub has not disabled scheduled workflows. Dependency merges do not publish a release.

License

MIT

来源:README.md,提交 a1550ec

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:软件包安装失败。

版本历史

1
  1. v3.3.2最新Oct 24, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分