Enables sending and reading iMessages, retrieving message history, searching across conversations, and managing contacts with fuzzy matching and macOS Contacts sync.
iMessage MCP Server
A personalized iMessage MCP (Model Context Protocol) server that lets Claude send and read iMessages on macOS.
Features
Send Messages: Send iMessages using natural language ("Text John saying I'm running late")
Read Messages: Retrieve recent message history with any contact
Smart Contact Lookup: Find contacts by name with fuzzy matching
Cross-Conversation Search: Search messages across all contacts
macOS Contacts Sync: Auto-sync contacts from your macOS Contacts app
Requirements
macOS (required - iMessage is macOS only)
Python 3.9+
Claude Code or Claude Desktop (MCP client)
Full Disk Access permission (for reading message history)
Quick Start
1. Clone and Install
2. Set Up Contacts
3. Grant Permissions
Full Disk Access (for reading messages):
System Settings → Privacy & Security → Full Disk Access
Add Terminal.app or your Python interpreter
Automation (for sending messages):
Will be requested automatically on first send
4. Register with Claude Code
5. Test It Out
In Claude Code, try:
Available MCP Tools
Tool | Description |
| List all configured contacts |
| Send an iMessage to a contact by name |
| Get recent messages with a specific contact |
| Get recent messages across all contacts |
| Full-text search across all messages |
| Get messages by phone number directly |
Project Structure
Configuration
Contact Format
Contacts are stored in config/contacts.json:
Phone numbers can be in any format - they're normalized automatically.
Server Config
Optional settings in config/mcp_server.json:
Troubleshooting
"Contact not found"
Run
python3 scripts/sync_contacts.pyto sync contactsCheck
config/contacts.jsonexists and has contactsTry partial names (e.g., "John" instead of "John Doe")
"Permission denied" reading messages
Grant Full Disk Access to Terminal/Python
Restart Terminal after granting permission
Verify:
ls ~/Library/Messages/chat.db
Messages show "[message content not available]"
Some older messages use a different format
Attachment-only messages don't have text content
This is normal for some message types
MCP server not appearing in Claude Code
Verify registration:
claude mcp listCheck Python path:
which python3Restart Claude Code after adding the server
How It Works
Sending: Uses AppleScript to control Messages.app
Reading: Directly queries
~/Library/Messages/chat.db(SQLite)Contacts: Syncs from macOS Contacts via PyObjC framework
Claude Code Skill (Optional)
This repo includes a Claude Code skill at .claude/skills/imessage-texting/ with usage examples for each MCP tool.
To use it, clone this repo - Claude Code will automatically pick up the skill from the .claude/skills/ directory.
Development
Privacy & Security
All data stays local on your Mac
No cloud services or external APIs
Contacts file is gitignored by default
Message history accessed read-only
License
MIT License - see LICENSE for details.
Contributing
Contributions welcome! Please open an issue or PR.
Built for use with