apple-messages-mcp-remote
This server gives AI assistants access to Apple Messages on macOS, allowing reading and sending messages.
list_chats: List recent chats with last message preview and participant info.
get_chat_messages: Get message history for a specific chat, optionally filtered by date range.
search_messages: Search messages by text content, optionally limited to a specific chat.
send_message: Send an iMessage or SMS to a phone number or email address.
get_chat_participants: Get the participants of a specific chat.
Remote access (optional): Support for HTTP transport with bearer token authentication, enabling access from cloud AI sessions via a tunnel.
Provides tools for reading Apple Messages chat history (listing chats, searching messages, getting participants) and sending iMessages or SMS through the macOS Messages app.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@apple-messages-mcp-remote Search my messages for the flight confirmation code."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
apple-messages-mcp-remote
A fork of @griches/apple-messages-mcp that adds an optional remote (HTTP) transport, for running this server on an always-on Mac and reaching it from a cloud AI session instead of only a session running locally on the same machine. Local stdio mode is unchanged and remains the default — this is purely additive.
An MCP server that gives AI assistants access to Apple Messages on macOS. Reads messages from the Messages database (SQLite) and sends messages via AppleScript.
Quick Start (local, stdio — same as upstream)
npx apple-messages-mcp-remoteRelated MCP server: imsg
Quick Start (remote, HTTP)
Only do this if you understand what you're exposing: this gives whoever holds the token read access to your real iMessage history, and send access to your Messages app. See Remote setup below before running this on a machine reachable from outside your own network.
export MCP_TRANSPORT=http
export MCP_AUTH_TOKEN=$(openssl rand -hex 32) # save this, you'll need it on the client side
npx apple-messages-mcp-remoteTools
Tool | Description |
| List recent chats with last message preview |
| Get message history for a specific chat (with optional date range filtering). Voice messages are flagged with |
| Search messages by text content. Results carry the same voice-message fields |
| Send an iMessage or SMS |
| Get participants of a chat |
Configuration
Claude Code
claude mcp add apple-messages -- npx apple-messages-mcp-remoteClaude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"apple-messages": {
"command": "npx",
"args": ["apple-messages-mcp-remote"]
}
}
}Remote setup
This adds an HTTP transport (Streamable HTTP, the current MCP spec's remote transport) alongside the original stdio one. Stdio is still the default — you only get the HTTP server if you set MCP_TRANSPORT=http.
Threat model this was actually designed for: one person, one Mac, one client at a time, connecting from that same person's own cloud AI session. It is not designed to be a multi-tenant hosted service — every deployment only ever has one real Messages database behind it, so there's no "different users, different permissions" problem to solve, which is why this uses a single bearer token instead of OAuth. If you want to offer this to other people against their own Macs, each of them runs their own instance with their own token; you're not meant to run one instance for many people.
Environment variables:
Variable | Required | Purpose |
| no (default | Set to |
| yes, in | Bearer token every request must present. Generate with |
| yes, in | The hostname your tunnel actually serves this on, for example |
| no (default | Port to listen on. |
| no (default | Bind address. Leave this on loopback and reach it through a tunnel (see below) rather than binding |
Do not expose a raw open port on the public internet. Put a private tunnel in front of this instead. Cloudflare Tunnel is what this project's sibling (mcp-timeline) already runs, so it's the tested path.
Before touching cloudflared, check what is already there:
./deploy/diagnose-cloudflared.shIt only reads (processes, launchd jobs, plist and config file contents) and changes nothing. This matters because cloudflared service install manages exactly one system service with one default config; running it again for this server does not add a second tunnel, it overwrites the registration of whichever tunnel already exists. If another tool on this Mac (mcp-timeline, for instance) already runs one, follow "Adding to an existing tunnel" below instead of "Fresh setup."
Fresh setup, if the script above found no existing tunnel:
brew install cloudflared
cloudflared tunnel login
cloudflared tunnel create apple-messages
cloudflared tunnel route dns apple-messages messages.your-domain.exampleThen a config file, typically ~/.cloudflared/config.yml:
tunnel: apple-messages
credentials-file: /Users/you/.cloudflared/<tunnel-id>.json
ingress:
- hostname: messages.your-domain.example
service: http://127.0.0.1:8443
- service: http_status:404cloudflared service install # registers it as its own background service, survives reboot on its ownAdding to an existing tunnel, if the script found one already running: add one ingress entry to that tunnel's own config.yml, above its final service: http_status:404 line, using this server's own hostname and port:
- hostname: messages.your-domain.example
service: http://127.0.0.1:8443Route DNS for the new hostname under that same tunnel (its name is the tunnel: key already in that file), then reload the service that owns it instead of reinstalling it:
cloudflared tunnel route dns <existing-tunnel-name> messages.your-domain.example
sudo launchctl kickstart -k system/com.cloudflare.cloudflared # if it's a root-level LaunchDaemon
launchctl kickstart -k gui/$(id -u)/com.cloudflare.cloudflared # if it's a user-level LaunchAgentEither way, MCP_PUBLIC_HOST in your env file is that same messages.your-domain.example. Tailscale works too if you'd rather keep this on a private network you control instead of a public hostname; either way, the port is never directly internet-routable, the bearer token is a second layer rather than your only layer, and you get to revoke access by removing a tunnel or device rather than by hoping nobody guessed the token.
Connecting to Claude, once the tunnel is up:
{
"mcpServers": {
"apple-messages-remote": {
"url": "https://messages.your-domain.example/",
"headers": {
"Authorization": "Bearer <your MCP_AUTH_TOKEN>"
}
}
}
}For Claude Desktop, that goes in claude_desktop_config.json alongside the local example above. For claude.ai, add it under Settings → Connectors → Add custom connector, with the same URL and an Authorization: Bearer <token> header.
What this does not do: encrypt anything beyond what your tunnel provides, rate-limit requests, expire or rotate the token automatically, or provide per-tool permission scoping (a valid token can call every tool, including send_message). If any of that matters for your setup, treat this as a starting point, not a finished security product — patches welcome.
Running it unattended (macOS)
Started from a terminal, the process dies when the window closes or the machine reboots. For a server other sessions expect to reach at any time, that's an outage you find out about the next time you ask it something.
deploy/install-macos.sh installs the HTTP server as a launchd user agent, so it starts at login and restarts if it crashes:
npm install && npm run build # build/index.js has to exist first
./deploy/install-macos.sh --dry-run # inspect the generated plist first
./deploy/install-macos.sh # install and load itThe first run creates deploy/apple-messages-mcp-remote.env from .env.example with a freshly generated MCP_AUTH_TOKEN. Set MCP_PUBLIC_HOST in that file to your tunnel hostname before installing; without it the server rejects every tunneled request with 421 Invalid Host header. The env file and the generated plist hold the token, so both are written owner-only, and the env file is gitignored.
launchctl list | grep apple-messages-mcp-remote # status
tail -f ~/Library/Logs/apple-messages-mcp-remote/*.log # logs
./deploy/install-macos.sh --uninstall # remove the serviceThe tunnel itself is separate; cloudflared service install (above) already registers it as its own background service.
Requirements
macOS (uses AppleScript and macOS Messages database)
Node.js 22+ (uses built-in
node:sqlite)Full Disk Access granted to your terminal app (System Settings > Privacy & Security > Full Disk Access) — required for reading the Messages database
Permissions
Reading messages: Requires Full Disk Access for your terminal app to read
~/Library/Messages/chat.dbSending messages: macOS will prompt you to allow your terminal app to control the Messages app via AppleScript
Credit
The stdio server, database reader, and AppleScript send logic are almost entirely the original work of @griches/apple-messages-mcp — this fork's own contribution is the remote HTTP transport and the auth/tunnel setup around it.
License
MIT.
Available Tools
5 toolsget_chat_messagesB
Get message history for a specific chat
Inputs: chat_id (required), limit, to_date, from_date.
get_chat_participantsC
Get participants of a chat
Inputs: chat_id (required).
list_chatsA
List recent chats with last message preview and participant info
Inputs: limit.
search_messagesC
Search messages by text content
Inputs: query (required), limit, chat_id.
send_messageA
Send an iMessage or SMS to a phone number or email address
Inputs: to (required), text (required), service.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
list_chats includes participant info and last message preview, which overlaps with get_chat_participants. Similarly, get_chat_messages and search_messages both retrieve messages, though one is chat-scoped and the other is global. Descriptions help but boundaries are not fully crisp.
All tool names follow a consistent verb_noun snake_case pattern: list_chats, get_chat_messages, search_messages, send_message, get_chat_participants. No deviations or mixed conventions.
Five tools is well-scoped for an iMessage server, covering the core messaging actions without unnecessary bloat. Each tool has a clear place in the workflow.
The surface covers listing chats, reading message history, searching, sending, and fetching participants. Minor gaps exist such as deleting messages or retrieving a single chat's full metadata, but the essential workflows are complete.
Maintenance
Related MCP Connectors
iMessage for AI agents, from your iPhone. No Mac needed, and you choose which chats they read.
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Send and read iMessages from your own Mac and Apple ID — drafts, history and contacts.
Send and receive iMessage, RCS and SMS from US phone numbers: inbox, contacts, AI agents, lines.
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 gradedqualityAmaintenanceRead, search, and send iMessages locally from your terminal or through MCP clients like Claude, Cursor, and VS Code.MIT
- AlicenseAqualityCmaintenanceEnables reading the local iMessage database and sending messages through Messages.app on macOS, with both local stdio and remote HTTP access.7MIT
- 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.1012 npmMIT