imessage-mcp
Uses ElevenLabs for text-to-speech to generate outbound voice notes and for speech-to-text transcription of inbound voice notes.
Provides tools for sending and receiving iMessages through a managed line, including text, voice notes, stickers, link cards, images, and reactions.
Supports speech-to-text transcription of inbound voice notes via an OpenAI-compatible Whisper endpoint as an alternative to ElevenLabs.
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., "@imessage-mcpCheck my unread iMessages and reply to the latest one"
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.
imessage-bridge
A managed iMessage line for your AI agent, exposed as an MCP server.
Give your agent its own phone number. Messages that arrive from the person on the other end land in an inbox your agent can read; messages your agent sends are actually delivered — text, voice notes, stickers, links, images, and reactions.
No Mac is required. The line is hosted by Spectrum / Photon,
not by a local Messages.app install.
your phone ⇄ Spectrum Cloud (managed iMessage line)
│
imessage-line node line.mjs — holds the line, receives, sends
│ 127.0.0.1:18230 (local "door", Bearer SEND_TOKEN)
imessage-mcp python FastMCP :8515 — the MCP interface your agent calls
│ Bearer MCP_TOKEN
your agent (Claude Code / Claude Desktop / any MCP client)Features
Read & write iMessage — inbound text / image / voice / reaction / file all land in an inbox; outbound goes out for real.
Voice notes, both ways — send voice in a voice of your choice (ElevenLabs TTS); incoming voice is transcribed to text (ElevenLabs Scribe by default, or any OpenAI-compatible Whisper endpoint).
Tone detection (optional) — incoming voice notes are also described by a multimodal model ("sounds tired, speaking softly"), so the agent knows how something was said, not just what.
Reactions, links, images, stickers — react to a message, send a link card, an image by URL, or a sticker by mood.
Safe by default — the MCP endpoint requires a bearer token unless you explicitly opt out.
Related MCP server: iMessage Max
How it works
Two processes, one shared .env:
line.mjs(Node) — the only thing that talks to Spectrum. It receives inbound messages, stores them ininbox.json, and sends outbound messages. It exposes a tiny HTTP "door" on127.0.0.1:18230guarded bySEND_TOKEN. Nothing else is allowed to talk to the line directly.imessage_mcp.py(Python, FastMCP) — the MCP server your agent connects to. Every tool is a thin proxy over the door. It is the only thing that can reach the door from the outside, and it is itself guarded byMCP_TOKEN.
The "brain" is deliberately not here. Your agent lives wherever it lives (Claude Code, Claude Desktop, your own harness) and uses this MCP server the same way it would use any other tool.
Prerequisites
Node.js ≥ 18 (for
spectrum-ts)Python ≥ 3.10 (for the MCP server)
ffmpegon PATH (voice ↔ audio conversion)A Photon project with a managed iMessage line
Quick start
# 1. install node deps
npm install
# 2. install python deps
python -m venv .venv
.venv/bin/pip install -r requirements.txt # Windows: .venv\Scripts\pip
# 3. configure
cp .env.example .env
# fill in PHOTON_PROJECT_ID, PHOTON_PROJECT_SECRET, OWNER_PHONE, SEND_TOKEN, MCP_TOKENRun both processes. With pm2:
npm i -g pm2
pm2 start ecosystem.config.cjs
pm2 saveOr by hand:
node line.mjs # terminal A
.venv/bin/python imessage_mcp.py # terminal B.env — the important fields
Key | Meaning |
| Your Photon project credentials |
| The other person's number (the recipient), not the line number. The line number is discovered by Spectrum from the project credentials. |
| Shared secret between |
| Bearer token MCP clients must send |
| The public hostname the MCP server is served under (used for the tunnel's Host allow-list) |
First-time gotcha: the sender's identity must be registered under Project → Users in the Photon dashboard, or Photon rejects the message with "This number didn't recognize yours". Add the recipient's number there.
Connect your agent
Claude Code:
claude mcp add --transport http imessage https://<your-host>/mcp \
--header "Authorization: Bearer <MCP_TOKEN>"Claude Desktop / any JSON-based client (claude_desktop_config.json):
{
"mcpServers": {
"imessage": {
"type": "http",
"url": "https://<your-host>/mcp",
"headers": { "Authorization": "Bearer <MCP_TOKEN>" }
}
}
}The transport is streamable-http, endpoint /mcp.
Tools
Tool | What it does |
| Send text. Blank lines split into separate bubbles. |
| Send a voice note in your configured voice. |
| Send a sticker by mood. |
| Send a link card with a preview. |
| Send an image by URL. |
| React to their latest message. |
| Read recent inbound messages (optionally unread only). |
| Mark all inbound messages read. |
| Line health, unread count, moods. |
Action lines
Inside imessage_send, a line that matches an action keyword is
turned into a real iMessage action instead of being sent as text. The keywords are
Chinese (the code matches them literally); put one action per line:
Action | Effect |
| React to the last inbound message (❤️ 👍 👎 😂 ‼️ ❓ are safest) |
| Send a link card with preview |
| Send an image from the web |
| Send a random sticker from the |
| Send a voice note in your own voice |
Voice
TTS (outbound) — ElevenLabs. Set
ELEVENLABS_API_KEY,ELEVENLABS_VOICE_ID,ELEVENLABS_MODEL(defaulteleven_v3),VOICE_NAME.ASR (inbound) — default ElevenLabs Scribe (
scribe_v1). With noELEVENLABS_API_KEYit falls back to an OpenAI-compatible Whisper endpoint (ASR_PROVIDER=openai,ASR_BASE_URL,ASR_API_KEY).Tone (inbound, optional) — the same audio is also sent to an Alibaba DashScope multimodal model (
qwen3.8-omni-flash,qwen-omni-turbo, …) which describes the speaker's mood in one sentence. SetDASHSCOPE_API_KEY;TONE=0disables it. Tone failure silently degrades — the transcript is unaffected.
The inbound transcript and tone are stored on the inbox entry (transcript, tone)
and folded into the text the agent reads.
Stickers
[[表情:开心]] picks a random image from stickers/开心/. One mood = one folder:
stickers/
开心/ 1.gif 2.jpg …
想你/ a.png …An optional sticker-notes.json describes individual stickers:
{ "开心/1.jpg": ["name", "what it shows", "when to send"] }.
Security
The MCP endpoint requires
MCP_TOKEN(Authorization: Bearer …). SetALLOW_NO_AUTH=1only if you understand that anyone who reaches the URL could send iMessage on your agent's behalf.SEND_TOKENis the internal secret between the two processes; keep.envchmod 600and out of version control (it's in.gitignore).If you expose this behind Cloudflare Tunnel, FastMCP's DNS-rebinding protection must allow the public host — set
PUBLIC_HOSTto your domain so the tunnel'sHostheader is accepted.
Deploying behind a tunnel (VPS + Cloudflare)
A common setup is a cheap VPS + a Cloudflare Tunnel (no public 80/443 on the box):
# on the VPS
git clone https://github.com/yuyuki-guyu/imessage-bridge.git
cd imessage-bridge
npm install
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
sudo apt-get install -y ffmpeg
cp .env.example .env # fill it in
npm i -g pm2 && pm2 start ecosystem.config.cjs && pm2 saveThen add an ingress in your tunnel config pointing imessage.<your-domain> at
http://127.0.0.1:8515, and set PUBLIC_HOST=imessage.<your-domain> in .env.
See README.zh-CN.md for a Chinese walkthrough that covers the same steps with the
China-specific pitfalls (GitHub egress, package mirrors, the tunnel Host header).
License
AGPL-3.0 — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Give your AI agents a real WhatsApp number to send and receive messages.
Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.
Give AI agents a phone number. Voice calls, SMS, and phone number management for MCP clients.
Virtual phone numbers for AI agents — rent numbers in 200+ countries, receive SMS.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables Claude to send and read iMessages on macOS, with smart contact lookup, message history retrieval, and cross-conversation search using natural language commands.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to read, search, and send iMessages with features like contact name resolution, session grouping, and attachment listing. It provides intent-aligned tools to efficiently navigate conversation history and manage messages through natural language queries.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading and sending iMessages on macOS through MCP, with tools for managing chats, messages, and attachments via AI agents.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to read, search, and send iMessages, manage contacts, and access attachments on macOS.5 npmMIT