Messages Bridge

io.github.IsaiahDupree由 GitHub 账号 IsaiahDupree 发布v1.3.0更新于 Oct 24, 2026

MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay

已验证Streamable HTTP可网页运行效率与工作流沟通与协作

概览

AI 生成的概览

该连接器让 ChatGPT 通过运行在你自己 Mac 上的小型代理,搜索和发送 iMessage 对话,并读取或新增通讯录联系人。

可以做什么
搜索消息,列出或分页浏览最近的会话与对话,并可检查本地访问状态和覆盖范围而不返回消息内容。向单个收件人发送一条 iMessage,发送前需你确认。按姓名、电话或邮箱搜索、读取和新增联系人。读取在 Mac 本地执行,请求经托管中继短暂排队转发。
适用场景
适合让助手查找过去的 iMessage 对话或联系人信息,或起草并发送单条短信,同时让消息数据留在自己的 Mac 上。需要一台保持唤醒并运行代理的 Mac。
运行要求
远程 MCP 端点,需 OAuth 登录、托管服务账号和配对码。一台装有 Node 18+ 与 Apple 命令行工具的 Mac,运行 apple-messages-agent 命令行工具,并授予完全磁盘访问权限以及 Messages 和通讯录的自动化权限。Mac 须保持唤醒且代理持续运行。
安装前请注意
代理会读取本地完整消息数据库,并可发送消息和新增联系人;两个写入工具标记为破坏性操作,需你确认,且每次只发给一个收件人。托管中继会在短时效队列中临时保存请求与结果负载,消息内容在传输中离开你的 Mac。代理令牌保存在本地文件中;自托管需要 Supabase 与 JWT 密钥。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Messages Bridge,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.IsaiahDupree%2Fmessages-bridge/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "messages-bridge": {
      "type": "http",
      "url": "https://messagesbridge.vercel.app/mcp"
    }
  }
}

README

💬 MessagesBridge

Use your iMessage & Contacts inside ChatGPT — through your own Mac.

[License: MIT] [npm]

MessagesBridge is a Model Context Protocol (MCP) connector that lets ChatGPT work with your iMessage conversations and Contacts. Reads execute on your own Mac through a small local agent. Requested results pass through the hosted relay and are returned to ChatGPT. The relay temporarily stores request/result payloads in its queue; it does not maintain a permanent copy of your message history.

  ChatGPT  ──OAuth──►  MessagesBridge relay  ──job queue──►  apple-messages-agent  ──►  Messages.app + Contacts (connector)          (Vercel, stateless)      (your Mac, polls & executes)        (on your Mac)

Your Mac is the only place your messages are ever read or contacts written. The relay stores only short-lived job payloads and your account record; it never sees a message unless a job is in flight, and queue payloads have short expiry windows.


For users — 3 steps

1. Create your account at messagesbridge.vercel.app and generate a pairing code.

2. Install the Mac agent (needs Node 18+ and Apple Command Line Tools):

bash
npx apple-messages-agent pair <YOUR-CODE>   # link this Mac to your accountnpx apple-messages-agent install            # keep it running on every restart

The agent needs two macOS permissions, granted once: Full Disk Access so it can read your message history (System Settings → Privacy & Security → Full Disk Access), and Automation the first time it sends a message or reads Contacts — macOS asks "Terminal wants to control Messages" and to access Contacts; click OK.

3. Connect ChatGPT: Settings → Plugins → turn on Developer mode (Security & login) → Create a custom plugin → paste the MCP Server URL https://messagesbridge.vercel.app/mcp → Authentication OAuth → sign in & Allow.

That's it. In a new chat: "Search my messages for the dinner plans" or "Text Sarah that I'm running 10 minutes late." (You confirm every send before it goes out.)

Your Mac must be awake with the agent running. npx apple-messages-agent install makes it start automatically at login and restart if it ever crashes.

Managing the agent

bash
npx apple-messages-agent status      # is it paired & reachable?npx apple-messages-agent logs        # recent activitynpx apple-messages-agent uninstall   # stop auto-start

What ChatGPT can do

ToolAction
search_messagesSearch plain and Apple attributed text; follow next_cursor even on empty result pages
list_recent_threadsList recent conversations, newest first, with a last-message preview
get_threadRead pages of one conversation using an exact chat id; pass next_cursor as cursor until null
messages_statusCheck local access, counts and coverage without returning message content
send_messageSend an iMessage to one recipient (you confirm first — no bulk)
search_contactsFind people by name (returns their phones + emails)
get_contactRead one contact by name or id
create_contactAdd a contact (name, optional phone/email)

Reads come first; the only write tools are send_message and create_contact, and each is confirmed by you in ChatGPT before it runs. Sends always go to one recipient at a time — never in bulk.


Self-hosting

You can run your own relay so nothing depends on the hosted instance.

Prereqs: a Vercel account and a Supabase project (free tiers are fine).

  1. Storage — in your Supabase project's SQL editor, run supabase/schema.sql. It creates isolated actp_messagesbridge_* tables and mb_* storage functions with RLS and service-role-only grants.
  2. Deploy the server/ directory to Vercel.
  3. Set env vars (see server/.env.example):
    • SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY — your project + service-role key
    • JWT_SECRET — openssl rand -hex 32
  4. Verify: curl https://YOUR-APP.vercel.app/api/health → redisConfigured, redisOk, jwtSecretSet all true.
  5. Point the agent at it: npx apple-messages-agent pair <CODE> --server https://YOUR-APP.vercel.app.

How it works

  • Auth — OAuth 2.1 with PKCE and Dynamic Client Registration (RFC 7591). ChatGPT registers itself, the user signs in on the MessagesBridge consent page, and ChatGPT gets a scoped MCP access token. JWTs are HMAC-signed; three kinds (session, agent, mcp) with distinct privileges. Optional email verification via Resend (RESEND_API_KEY); off unless configured, and enforcement is opt-in (REQUIRE_EMAIL_VERIFICATION).
  • Relay — MCP tool call → job pushed to jobs:<user> (TTL ≤ the caller's wait window, so an abandoned job can't run late) → the Mac agent (holding a hanging long-poll) is handed the job within ~200ms, executes it, pushes the result → the MCP handler returns it. The long-poll means jobs are delivered on arrival rather than on a fixed interval, so relay overhead is ~300ms instead of ~1s. The agent is considered "online" only while it's actively connected.
  • Agent — a dependency-free Node CLI. Read tools query the Messages chat.db directly (read-only SQLite); send and contact tools run via JXA (osascript -l JavaScript) against Messages.app and Contacts; arguments are passed as JSON over argv (never shell-interpolated). A macOS LaunchAgent keeps it alive across logins and crashes.

Repository layout

server/    Vercel functions: OAuth + MCP endpoint + relay        (deploy this)agent/     apple-messages-agent — the npm-published Mac CLI          (users npx this)kit/       Browser automations: register the dev-mode connector AND           fill the OpenAI directory submission (see kit/README.md)supabase/  schema.sql for self-hosting the storagetest/      end-to-end OAuth + MCP integration test

Development

bash
# servercd server && cp .env.example .env.local   # fill in, then: vercel dev# end-to-end test against a live deployment (reads ../.env.local)node test/e2e-oauth.mjs# agent unit testsnode --test agent/test-agent-unit.mjs

Security & privacy

  • Messages are read and sent, and contacts read and added, only on your Mac. The relay temporarily persists requested content in its job/result queues with short TTLs; results are consumed on delivery.
  • The agent token is stored at ~/.messagesbridge-agent.json (mode 600).
  • No secrets are committed; see .gitignore and the .env.example files.
  • Write tools are marked destructive so ChatGPT asks before it sends a message or adds a contact — every send goes to one confirmed recipient at a time, never in bulk.

License

MIT © Isaiah Dupree

Verified read coverage and live tests

Agent 1.1 reads the live SQLite WAL, decodes Apple attributed strings using macOS Foundation, and provides bounded cursor pagination. Cursors follow database insertion order. Attachment-only records remain visible through has_attachments; attachment files are not uploaded or decoded. The Mac database is the coverage boundary: this does not establish that every iPhone/iCloud message has synced.

sh
apple-messages-agent doctornode test/live-messages.mjs# After pairing your own account and starting the agent:MB_EMAIL=your-email MB_PASSWORD=your-password node test/live-relay.mjs

Provide credentials through your secure environment, not a shared transcript or committed file. The live tests only read and print aggregate results. live-messages checks every local conversation page, all messages in the largest thread, decoded search, and cursor validation. live-relay validates actual OAuth, MCP and paired-Mac reads; it fails if the Mac is offline. Reviewer/demo output is never accepted as evidence of a live integration.

Production requires the storage migration and valid Supabase configuration. /api/health returns HTTP 503 when storage is unavailable. If the old relay database is unavailable, accounts, pairing and OAuth sessions from it cannot be recovered automatically; sign in/create an owner account and reconnect the plugin.

来源:README.md,提交 0ecb5ed

工具

0
该服务器需要登录,因此 SourceWeft 无法在没有账号的情况下读取其工具,也未收录。已连接账号所能看到的内容可能因账号及其权限而异。

版本历史

1
  1. v1.3.0最新Sep 16, 2026

评分

已满足适用检查项的 85%

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

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

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

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