Skip to main content
Glama
imessage-mcp

imessage-mcp

by selan-ai
README.md
# imessage-mcp

[![ci](https://github.com/selan-ai/imessage-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/selan-ai/imessage-mcp/actions/workflows/ci.yml)

Your Mac's Messages, for Claude and any MCP client. Ask "what did Rūta say about Saturday?", "show me the photo
Jonas sent", "wait for the bank's code", or "send her the PDF on my Desktop", and it does, from the messages
already on your Mac.

It reads `~/Library/Messages/chat.db` read-only, asks nothing of the network, and sends only when you turn sending on
and say yes to each message. Zero dependencies: Node's own SQLite, and the `sips`, Quick Look and `osascript` that
come with macOS.

---

## What it can do

| Tool | What it answers |
| --- | --- |
| `imessage_chats` | Your conversations, most recent first. One person once, across all their numbers, addresses and iMessage and SMS threads, named as Contacts saves them, with the last message and the unread count. |
| `imessage_messages` | One conversation, page by page: who wrote what and when, edited and unsent messages marked, what each replies to, the reactions on it, its attachments. |
| `imessage_search` | Messages holding every word you give, in any case and without accents ("siandien" finds "Šiandien"), across everything or one conversation, between dates. |
| `imessage_attachment` | A photo as an image the model can see (iPhone HEIC turned into JPEG), a video's frame or a PDF's first page, and any file's name, type, size and path. |
| `imessage_wait` | Waits for the next message, from anyone or one conversation, holding a word or matching a pattern such as `/\b\d{6}\b/`: a sign-in code, or the reply you are expecting. |
| `imessage_send` | Sends text, photos and files to a conversation you already have, after you approve each one. Off until you turn it on. |

Things it gets right that most iMessage servers miss:

- **The text.** Since macOS Ventura, Messages leaves the `text` column empty for nearly every message and keeps the
  words in an archived `attributedBody`: on a current Mac, all but a handful of messages. A server that reads `text`
  sees almost nothing; this one decodes the archive.
- **People, not numbers.** Messages keeps a separate thread for each of someone's numbers and for SMS and iMessage.
  Here they are one conversation, found by name: "Rūta" means your conversation with Rūta, not every group she is in.
- **Nothing is guessed.** A name that fits two conversations comes back as a question listing both, never a read
  of, or a send to, the wrong person.

---

## Install it

You need macOS and Node.js 22.13 or newer (`node --version`; get it from [nodejs.org](https://nodejs.org)).

**Claude Code**

```sh
claude mcp add imessage -- npx -y @selan-ai/imessage-mcp
```

**Claude Desktop**: Settings → Developer → Edit Config, and add:

```json
{
  "mcpServers": {
    "imessage": { "command": "npx", "args": ["-y", "@selan-ai/imessage-mcp"] }
  }
}
```

Any other MCP client: run `npx -y @selan-ai/imessage-mcp` as a stdio server.

### Full Disk Access

macOS lets only apps with Full Disk Access read Messages. Turn it on for the app that runs the server: Claude,
your terminal for Claude Code, or your editor. System Settings → Privacy & Security → Full Disk Access, add the app,
then quit and reopen it. Until then every tool says exactly this, naming the app.

---

## Sending

Sending is off. A server set up to read cannot send, even by mistake: `imessage_send` is not listed at all. To turn
it on, set `IMESSAGE_ALLOW_SEND=1`:

```sh
claude mcp add imessage -e IMESSAGE_ALLOW_SEND=1 -- npx -y @selan-ai/imessage-mcp
```

```json
"imessage": {
  "command": "npx",
  "args": ["-y", "@selan-ai/imessage-mcp"],
  "env": { "IMESSAGE_ALLOW_SEND": "1" }
}
```

Then, for every message:

- **You are asked first.** Your client shows who it goes to, the text and the files, and nothing is sent until you
  say yes (MCP elicitation). A client that cannot ask does not send; `IMESSAGE_SEND_WITHOUT_ASKING=1` lets it, if you
  accept that.
- **Only to conversations you have.** The recipient is one of your conversations, never a number the model made up.
- **Sent the way you would.** Through Messages.app, to that person's most recent thread. The first send asks macOS
  to let the app control Messages (Privacy & Security → Automation).
- **Kept on record.** Each send is appended to `~/Library/Logs/imessage-mcp/sent.jsonl`. Files are copied to
  `~/Library/Messages/Attachments/imessage-mcp/` first, since macOS fails a file sent from anywhere else.

---

## Privacy

- Nothing goes over the network. The server reads files on your Mac and answers your client on stdio; what the client
  does with an answer, such as sending it to a model, is up to the client.
- Messages and Contacts are opened read-only, per call, and closed after. Nothing is copied, indexed or kept.
- What other people wrote reaches the model as data: every tool tells it so, and never to follow instructions in a
  message.

---

## Develop

```sh
pnpm install
pnpm test        # node --test, on a Messages and Contacts written into a temp folder
pnpm typecheck
pnpm lint
pnpm build       # dist/main.js, the published bundle
```

Contributing needs Node 24, which runs the TypeScript sources directly.

## License

MIT

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a clearly distinct operation: listing chats, reading one conversation's messages, fetching an attachment, searching messages, and waiting for an incoming message. The boundaries between reading messages and searching are clear because one is scoped to a conversation and the other is a global query.

Naming Consistency4/5

All tools use the same `imessage_` prefix and snake_case style, making them predictable. There is minor inconsistency in that some names are nouns (`messages`, `attachment`, `chats`) while others are verbs (`search`, `wait`), but this remains readable and conventional.

Tool Count5/5

Five tools is well-scoped for an iMessage integration focused on reading and waiting. Each tool earns its place and there is no obvious redundancy or missing operational category for that scope.

Completeness4/5

The read-oriented surface is strong: conversations, messages, attachments, search, and incoming-message waiting are all covered. The main gap is the absence of a send/reply tool, which is a notable omission for a messaging domain but may be intentional for a read-only server.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues