imessage-mcp

imessage-mcp

A local MCP server that enables reading iMessage conversations and sending new messages through Claude Desktop. It provides secure, read-only access to your Mac's iMessage database and AppleScript-based message sending capabilities.

Category
Visit Server

README

imessage-mcp

A local MCP server that exposes your Mac's iMessage data to Claude Desktop / Claude Code. Two surfaces:

  1. SEND via AppleScript → Messages.app
  2. READ via direct, read-only SQLite access to ~/Library/Messages/chat.db

Everything is local. No API keys, no network calls.

Install

# 1. Clone / copy into ~/mcp-servers/imessage-mcp
cd ~/mcp-servers/imessage-mcp

# 2. Create a Python 3.11+ venv and install deps
python3.12 -m venv .venv
.venv/bin/pip install -e .

Permissions (required)

Full Disk Access — so we can read chat.db

System Settings → Privacy & Security → Full Disk Access → toggle ON for:

  • your terminal app (e.g. Terminal, iTerm2, Ghostty), AND
  • Claude.app (if using Claude Desktop)

Automation — so we can control Messages.app

System Settings → Privacy & Security → Automation → expand your terminal / Claude.app and toggle Messages to ON.

Messages.app must be running and signed into iMessage.

If a permission step is missing, the server errors with the exact settings path to open.

Claude Desktop config

Merge into ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "imessage": {
      "command": "/Users/YOUR_USERNAME/mcp-servers/imessage-mcp/.venv/bin/python",
      "args": ["-m", "imessage_mcp.server"]
    }
  }
}

(The absolute path to the venv's python is the safest — it avoids PATH ambiguity. Replace YOUR_USERNAME.)

Tools

Tool Purpose
send_imessage(recipient, body, service?) Send via Messages.app. recipient is a phone, Apple ID email, or existing buddy name.
list_recent_chats(limit=20) Newest-first chats with last-message preview and unread count.
get_chat_messages(chat_id?, handle?, limit=50, since?) Messages for a chat; provide chat_id or handle.
search_imessages(query, since?, until?, from_contact?, limit=25) Case-insensitive LIKE across message bodies.
get_my_info() Self-handles + DB metadata.

Dates are ISO8601 in and out. Internally, Apple stores message.date as nanoseconds since 2001-01-01 UTC; the server converts both ways.

Safety invariants

  • chat.db is opened with sqlite3.connect("file:...chat.db?mode=ro", uri=True). Any write attempt raises sqlite3.OperationalError: attempt to write a readonly database.
  • send_imessage passes recipient / body / service as separate osascript argv entries — no shell interpolation, no injection.
  • Attachments return metadata only (filename, mime_type, total_bytes). Blobs are never read.

Limitations

  • Scheduled / delayed sends are not supported.
  • Rich / reply-threaded messages may have their text stored in attributedBody (NSKeyedArchive). We best-effort extract the embedded NSString; messages with more exotic payloads (images, taps, Apple Pay) will show empty body but correct metadata.
  • Delivery confirmation: send_imessage reports success from osascript's exit code. To verify the message actually went through, call search_imessages or get_chat_messages a few seconds later.
  • This is macOS-only and will not work on sandboxed App Store apps.

Local development

.venv/bin/pytest -q

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured