Apple Messages MCP
Reads selected iMessage conversations on the user's Mac through imsg, covering both 1:1 chats and named or unnamed group chats, with per-app and per-chat approval from a browser page, a rolling message age limit (30 days by default), configurable attachment handling (files, details only, or none, up to a size cap), recency-bounded search within allowed chats plus optional one-time wide searches across the whole inbox, and optional sending in which drafts are reviewed and approved in the browser and every send is subject to an hourly cap. Reads never mark messages read.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Apple Messages MCP
Let Claude, ChatGPT, and other compatible AI assistants read selected iMessage conversations on your Mac, with optional approval before anything is sent.
apple-messages-mcp is a self-hosted MCP server that runs on a Mac signed into Apple Messages. Instead of handing an AI app your whole inbox, you use a private browser page to approve specific 1:1 chats and group chats for each connected app. Each server runs for the Messages account on one Mac.
How it works
Once the server is running and connected to your AI app:
You ask your assistant something like "Check what Alex texted about Saturday" or "Summarize what I missed in the Weekend Crew group chat."
If you have already shared that conversation with that app, the assistant reads the recent messages and answers.
If you have not shared that chat yet, the assistant cannot see it. Instead, it gives you a link to your server's private approval page.
You open the link on your Mac or phone, sign in with your approval password, and choose Allow (for 24 hours or Until revoked) or Deny. You can also open
/approvalsanytime to add or revoke chats ahead of time.
If you enable sending in approval mode, outgoing texts work the same way: your assistant submits a draft and hands you a link showing the exact recipients, text, and attachments, and nothing leaves your Mac until you tap Send.
Because Apple does not offer a web API for iMessage, the server has to run on a Mac that stays signed into Messages.
Why not just use imsg?
This server uses imsg under the hood. If you only run local command-line agents on your Mac and are comfortable giving them access to your full Messages database, calling imsg directly takes less setup.
apple-messages-mcp adds the remote access and guardrails on top of imsg: OAuth sign-in for cloud and mobile AI apps (such as Claude and ChatGPT), per-app and per-chat read approvals from a browser, a rolling message age limit, read-only defaults that never mark messages read, and browser draft review with an hourly send cap if you enable sending.
Related MCP server: iMessage MCP Server
Features
Approve access one chat at a time. Works for both 1:1 conversations and group chats (named or unnamed). Each connected AI app gets its own list of allowed chats, managed from a private browser page, and you can revoke access immediately without restarting the server.
Read-only by default, with unread badges intact. Sending is off until you turn it on, and reading messages never marks them read in Apple Messages.
Control how far back apps can read. A rolling age limit (30 days by default) applies to every read, search, and attachment. Choose whether apps receive attachment files, file details only, or no attachments at all, up to a configurable size limit.
Approve one-off searches across all chats. Normal search only checks chats the AI app can already see. Optionally let an app request a single search across your inbox. You review the exact search text, date range, and match limit before releasing the results once.
Optional sending, with draft approval and an hourly cap. Sending stays off by default. Turn it on when you want assistants to send from non-Apple devices, attach generated files, queue drafts for one-tap browser approval, or send automatically to preapproved chats. Every mode enforces an hourly send cap and never retries an uncertain send.
Manage each connected AI app separately. Connect compatible AI apps with standard OAuth sign-in. From
/approvals/connections, see paired apps and when they were last used, disconnect one to revoke its access, or replace a re-paired app while choosing which chat permissions to carry over.Keep message text out of instructions and logs. The server returns incoming message text and text attachments in a separate
sender_textfield rather than mixing them into server prose. Local logs record call metadata only and exclude message contents, search queries, and attachment files.
What you need
To run the server on your Mac, you need:
A Mac running macOS and signed into Apple Messages.
Bun 1.3.11 or later.
imsginstalled with Homebrew (tested with0.21.1; other versions log a startup warning).An AI app that supports remote MCP servers (Streamable HTTP with OAuth login, dynamic client registration, and PKCE).
Setup
Let an agent set it up (recommended)
A full setup involves several macOS and networking pieces (.env, Full Disk Access, optional code signing, Keychain, a launchd LaunchAgent, and a tunnel or Tailscale). You do not need to configure those by hand. Open Claude Code, Codex, or another coding agent on your Mac and paste the agent setup prompt.
The agent asks which pieces you want, runs the local checks and config steps for you, and pauses for you to enter passwords and click macOS permission dialogs yourself.
Set it up manually
Start by testing the server locally on your Mac, then layer on remote access, a background service, or both:
Install
imsgand the server's dependencies:brew install steipete/tap/imsg bun installCopy the example settings file:
cp .env.example .envOpen
.envand set at least these two values for local testing:MCP_BASE_URL=http://127.0.0.1:3460 APPROVAL_PASSWORD=choose-a-strong-passwordLeave
MESSAGES_ALLOWLISTempty to approve chats per app in your browser, or add entries there to preapprove chats for every app. Runbun run list-chatsto print every chat's ID, name, and participants.Start the server:
bun run startOn startup, the server logs its active settings, the
imsgversion, how many chats matchedMESSAGES_ALLOWLIST, and whether it can read your Messages database, Attachments folder, and Contacts, then listens on127.0.0.1:3460.Layer on what you need for day-to-day use:
Remote AI apps or phone approvals. Follow Connect remotely and approve from your phone (covers Tailscale Serve, Cloudflare Tunnel with Cloudflare Access, Cloudflare Tunnel with Tailscale Serve, and MacRemote with Tailscale Serve).
Always-on Mac or Mac mini. Follow Run apple-messages-mcp as a macOS background service to compile a signed binary, store the password in Keychain, grant Full Disk Access, and run it at login as a LaunchAgent (works with either a local or remote setup).
Connect an AI app
In your AI app, add a remote MCP server at
http://127.0.0.1:3460/mcp(or your HTTPS/mcpURL if configured remotely).Start connecting. Your browser opens the server's sign-in page.
Confirm the app name, enter
APPROVAL_PASSWORD, and approve the connection.If another paired app already uses that name, choose Keep both for separate permissions, or Replace connection to disconnect the older app and choose which chat permissions carry over.
Open
http://127.0.0.1:3460/approvals(or<MESSAGES_APPROVAL_ORIGIN>/approvals), sign in withAPPROVAL_PASSWORD, and choose Add a chat to share a conversation.
Verify the connection
Run this check from your AI app before relying on the server:
Call
get_access_info(for example, ask "What Messages access do you have?"). Confirm the access mode, whether sending is enabled, and the link to/approvals.Call
list_chats. Confirm that only the chats you preapproved or granted appear, with contact names shown if Contacts access is granted.Call
read_chaton an allowed chat. Confirm that messages appear undersender_text.In the default
askmode, callread_chaton an unlisted chat. Confirm that it returns an approval link instead of message contents.
How access works
You can combine server-wide defaults in .env with per-app permissions in your browser:
Preapproved chats (
MESSAGES_ALLOWLIST). Chats listed in.envare readable by every connected app without asking. Supported formats are phone numbers (+15551234567,+1 (555) 123-4567; bare 10-digit numbers default to+1), email addresses (friend@example.com), named groups (group: Weekend Crew), unnamed groups by exact members (group: +15551230001 & friend@example.com), and exact chat IDs (iMessage;+;chat123...). Startup logs warn if an entry matches zero or multiple chats. Remove an entry and restart to withdraw it.Approving chats on request (
MESSAGES_ACCESS=ask). When an app asks for an unlisted chat, the server returns a link to/approvals/r/<id>. Sign in and choose Allow or Deny. Access defaults to 24 hours (set byMESSAGES_APPROVAL_HOURS) and clears on restart. Choose Until revoked to save access across restarts inchat-access.sqlitebesideTOKEN_STORE_PATH. Every grant applies to one exact chat and one connected app.Adding or revoking chats anytime. Open
/approvalsand select Add a chat to search 1:1 chats and group chats by contact name, group name, phone number, or email, then share temporarily or until revoked. Select Revoke on/approvalsto cut off access immediately. Browser grants apply to reading only and never unlock automatic sending.One-time search across all chats (
MESSAGES_WIDE_SEARCH=ask). Optional (requiresMESSAGES_ACCESS=ask). Lets an app request a single search across your inbox when it does not know which chat to check. You review the exact search text, date range, match limit, and app name at/approvals/s/<id>. After approval, the app can collect up to 20 matches (default 10) once within 15 minutes, covering at most the last 30 days (bounded byMESSAGES_MAX_DAYS). Reading a full conversation or its attachments still requires chat access.Managing connected apps. Open
/approvals/connectionsto see every paired app and when it was last used. Selecting Disconnect immediately revokes that app's tokens, pending requests, and chat permissions.Shared gateways. If a gateway routes several AI agents through one connection to
apple-messages-mcp, those agents share that connection's chat permissions. Connect apps directly when each one needs its own chat list.History age limit (
MESSAGES_MAX_DAYS). Limits every read, search, and attachment to the last 30 days by default. Set0to allow full history.Optional sending (
MESSAGES_SEND). Off by default, which hidessend_messageand disables sending inside the server. Inapprovemode, every outgoing message waits as a locked draft at/approvals/d/<id>until you tap Send or Discard (or it expires afterMESSAGES_DRAFT_MINUTES). Inallowlistmode, messages to chats inMESSAGES_ALLOWLISTsend right away while all other chats and new recipients wait for approval. Indirectmode, every message sends immediately (logs a startup warning).MESSAGES_SEND_PER_HOURcaps total sends in every mode, and ifimsgcannot confirm whether a send went through, the server reports it as uncertain and never retries automatically.
Tools
Which tools appear in your AI app depends on MESSAGES_WIDE_SEARCH, MESSAGES_ATTACHMENTS, MESSAGES_SEND, and MESSAGES_FEEDBACK:
Tool | Available when | What it does |
| Always | Returns your |
| Always | Lists only the chats this app can read, with contact names, participants, group flag, last activity, unread count, and the |
| Always | Reads messages from one 1:1 or group chat over a time window (default last 7 days, up to 100 messages, max 500; optional |
| Always | Searches message text across readable chats (default 50, max 100 matches). Restricted modes check the latest 1,000 messages per readable chat within |
|
| Requests or collects one owner-approved search across all chats (default 10, max 20 matches; collected once within 15 minutes). |
|
| Fetches one attachment from |
| Always | Searches macOS Contacts read-only by name, phone number, or email (returns up to 10 matching contacts by default, max 50). Independent of the chat allowlist. |
|
| Write. Sends text and up to 5 attachments (totaling at most |
|
| Local write. Saves user-requested notes about tool behavior to |
Configuration
Set options through environment variables or a .env file in the folder where the server runs. Invalid settings stop startup and list every problem. See .env.example for examples.
Variable | Default | Purpose |
|
| Local port the server listens on. |
|
| Local network address. Keep |
|
| Base URL your AI apps connect to (no trailing |
|
| Separate HTTPS address for |
| (unset) | Password for pairing new apps and signing into |
| (unset) | macOS login Keychain generic-password service name (account must match your macOS username) so you do not have to store the password in |
|
| File storing paired app logins. |
| (unset) | Secret token for |
|
| Folder for local |
|
| Path or command name for the |
|
|
|
|
|
|
|
|
|
| (empty) | Comma- or newline-separated chats readable by every connected app. |
|
| Hours before temporary chat permissions and pending read requests expire. |
|
| Maximum message age in days for reads, searches, and attachments. |
|
|
|
|
| Size limit in MB for one returned attachment, and for all attachments combined on one outgoing message. |
|
|
|
|
| Maximum outgoing messages per rolling hour when sending is enabled. |
|
| Minutes before an unapproved outgoing draft expires. |
Privacy and security
This server runs locally on your Mac under your control. You control the binary, approval password, network exposure, and which AI apps can connect.
What it reads. The server reads
~/Library/Messages/chat.dbthroughimsg, reads attachment files strictly inside~/Library/Messages/Attachments(blocking symlinks or paths outside that folder), and reads~/Library/Application Support/AddressBookin read-only mode.No phone-home or telemetry. The server makes no outbound network requests of its own. If you enable
MESSAGES_FEEDBACK=on,report_feedbackappends only toLOG_DIR/feedback.jsonlon your Mac. Connected AI apps receive the messages, attachments, and contacts they request and handle that data under their own privacy policies.Contacts access is separate from the chat allowlist.
search_contactscan look up names, phone numbers, and emails in macOS Contacts even for people whose chats are not shared. If you do not want connected apps to search Contacts, do not grant Full Disk Access to~/Library/Application Support/AddressBook.What is saved on disk. Paired app logins are saved in
TOKEN_STORE_PATH, long-term chat permissions and app names are saved inchat-access.sqlitebeside it, and call metadata appends toLOG_DIR/tool-calls.jsonl. Message text, search queries, and attachment files are never saved to SQLite or the tool-call log. Temporary grants, pending requests, drafts, and browser sign-ins live in memory and clear when the server restarts.Approval page protection. The
/approvalspage is password-protected, rate-limits failed logins (10 attempts per 15 minutes per IP), runs with no client-side JavaScript, and blocks cross-site form submissions.Revoking access. Changing
APPROVAL_PASSWORDstops new logins and approvals, but it does not disconnect already-paired apps. To cut off an existing app right away, open/approvals/connectionsand select Disconnect.Large upload limit when sending is on. When
MESSAGES_SENDis enabled,POST /mcpaccepts request bodies large enough for attachments up toMESSAGES_ATTACHMENT_MAX_MB(about 34 MB at the 25 MB default), parsed before checking the app's token. Keep/mcpbehind an authenticated tunnel or private network if you turn sending on.
Troubleshooting
The Messages database is unavailable ... Grant Full Disk Access to the server binary for ~/Library/Messages.Grant Full Disk Access to the compiled binary (or to your terminal app if runningbun run startdirectly). If you rebuilt an unsigned binary, remove and re-add it, or sign builds with a consistent identity. See Run apple-messages-mcp as a macOS background service.Can't read ... Grant Full Disk Access to the server binary for ~/Library/Application Support/AddressBook.Grant access to~/Library/Application Support/AddressBook. Contacts reopen on every search, so the permission takes effect without restarting.Cross-site request refused.The address in your browser does not matchMESSAGES_APPROVAL_ORIGIN(orMCP_BASE_URL). Open the exact address you configured, such ashttp://127.0.0.1:3460/approvalsrather thanhttp://localhost:3460/approvalswhenMCP_BASE_URL=http://127.0.0.1:3460.APPROVAL_PASSWORD or MESSAGES_APPROVAL_KEYCHAIN_ITEM is required. Set exactly one of those variables in.envor your service environment. Setting both stops startup.Cannot read MESSAGES_APPROVAL_KEYCHAIN_ITEM from the login Keychain. Check that a generic-password item with that exact service name exists in your login Keychain, its account matcheswhoami, and the binary can read it without a prompt.Missing
send_message,get_attachment,search_all_chats_once, orreport_feedback. These tools only appear when enabled in.env(MESSAGES_SEND,MESSAGES_ATTACHMENTS=contents,MESSAGES_WIDE_SEARCH=askwithMESSAGES_ACCESS=ask, andMESSAGES_FEEDBACK=on). After changing settings and restarting, refresh the tool list in your AI app.Your session ended. Sign in again.Browser approval sessions last 12 hours and reset whenever the server restarts. Sign in again at/approvals.
Develop locally
Run the tests and typecheck without touching your real Messages database or Contacts:
bun test
bun run typecheck
bun run lint
bun run auditTests run against a fake imsg helper (test/fake-imsg.ts) and temporary fixture databases. To run the full server against sample data, point IMSG_BIN at a wrapper script that runs bun test/fake-imsg-bin.ts.
Never run development tests with MESSAGES_SEND enabled against the real imsg binary.
Architecture and implementation notes live in docs/design/architecture.md and docs/design/kit-workarounds.md.
Credits
imsgby Peter Steinberger provides theimsg rpcbridge to Apple Messages.mcp-server-kitprovides the MCP HTTP transport, OAuth sign-in, audit logging, and server lifecycle helpers.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
iMessage for AI agents, from your iPhone. No Mac needed, and you choose which chats they read.
Mac & Windows: let ChatGPT, Claude & Cursor use your email, calendar, iMessage, Teams, files.
Let AI agents securely access the text messages on your phone.
Connect Gmail, iCloud Mail, Outlook, Yahoo Mail, Fastmail and other IMAP inboxes to ChatGPT, Claude and compatible AI assistants. Find emails by meaning across languages with semantic search. Ask AI to find customer conversations, summarize deadlines and draft follow-ups. Give a sales rep access to a shared outreach inbox or bring email into a compatible CRM. Share an iCloud custom-domain inbox with teammates without their own Apple ID or iCloud+ plan. Search results may be incomplete or stale; separate permissions control mail actions.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to read iMessage history and send messages on macOS. Supports conversation listing, message search with keyword and semantic modes, contact lookup, and sending messages to existing conversations.1311MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to read, search, and send iMessages, manage contacts, and access attachments on macOS.1MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to search and retrieve from your local macOS iMessage history using hybrid retrieval with context expansion, all processed locally without sending data off-device.-
- AlicenseAqualityBmaintenanceEnables AI agents on macOS to securely read and search the local Messages database, catch up on missed messages via a persistent inbox, and send texts or files to allowlisted chats, with optional voice note transcription and text-to-speech.1024 npmMIT