mac-messages
Mac Messages Host
Die gesamte Apple-Messages-Historie (iMessage/SMS) deines Macs, schreibgeschützt, für KI-Agenten — ein gebündeltes Tool über REST/OpenAPI und Streamable-HTTP-MCP.
Ein Tool, gebündelte Anfragen: Ein einzelnes
messages(requests: str)-Tool nimmt ein JSON-Array mit Anfragen entgegen und gibt ein passendes JSON-Array mit Antworten zurück — ein Aufruf erledigt viele unabhängige Vorgänge. Wird identisch über REST (POST /api/messages) und MCP (/mcp/) bereitgestellt.Von Grund auf schreibgeschützt: Die Datenbank wird mit SQLite
mode=rogeöffnet; es gibt keinen Schreibpfad. Es kann nichts gesendet, geändert oder gelöscht werden.Moderne macOS-Inhaltsdekodierung: In
attributedBody-Typedstream-Blobs (Ventura+) gespeicherter Nachrichtentext und Bearbeitungsverlauf inmessage_summary_info-Plists werden transparent dekodiert.Automatisch generierter Tool-Prompt: Der für KI-Agenten bestimmte Prompt wird aus den Pydantic-Modellen generiert (~615 gpt-4o-Token, mit
tiktokengezählt und durch einen Test erzwungen); eintool_prompt.md-Snapshot wird durch einen Drift-Test synchron gehalten.
Install
Erfordert Python 3.11+ unter macOS.
pip install . # or: pip install -e . for development
mmhost info # permission check + database status
mmhost start # serve API + MCP on http://127.0.0.1:8761macOS-Berechtigungen (wichtig)
~/Library/Messages/chat.db ist durch macOS TCC geschützt. Der Prozess, der mmhost ausführt, benötigt vollen Festplattenzugriff:
Systemeinstellungen → Datenschutz & Sicherheit → Voller Festplattenzugriff → aktiviere deine Terminal-App (oder was auch immer den Server startet) und starte sie anschließend neu.
mmhost info zeigt dir sofort, ob die Datenbank lesbar ist.
Related MCP server: jons-mcp-imessage
Endpunkte
Endpunkt | Zweck |
| Das gebündelte Tool (REST) |
| OpenAPI-Schema |
| Interaktive Dokumentation |
| Liveness-Probe |
| Streamable-HTTP-MCP-Endpunkt (einzelnes |
Authentifizierung
Authorization: Bearer <token> wenn admin_token konfiguriert ist (persistierte Konfiguration, MMHOST_ADMIN_TOKEN oder --admin-token). Ohne konfiguriertes Token ist der Zugriff offen — sicher, da der Server standardmäßig an 127.0.0.1 bindet.
Anfragearten
get_info— Datenbankstatus, Zähler, Zeitbereich der Historieget_chats— Unterhaltungen nach letzter Aktivität (Filter, Paginierung)get_chat— Transkript eines Chats (älter überbefore)get_recent— neueste Nachrichten aus allen Chats (Polling übersince)search_messages— Groß-/Kleinschreibung insensible Substring-Suche über die Nachrichteninhalte
Siehe tool_prompt.md für die exakte KI-Dokumentation (aus den Modellen generiert).
Beispiel
curl -s http://127.0.0.1:8761/api/messages \
-H 'Content-Type: application/json' \
-d '{"requests": "[{\"kind\":\"list_chats\",\"limit\":3}]"}'MCP-Client-Konfiguration
{
"mcpServers": {
"mac-messages": {
"type": "streamable-http",
"url": "http://127.0.0.1:8761/mcp/"
}
}
}Konfiguration
Wird im spezifischen Plattform-Konfigurationsverzeichnis gespeichert (~/Library/Application Support/mac_messages_host/config.json unter macOS); du kannst den Speicherort mit MMHOST_CONFIG übersteuern. Nur Servereinstellungen — siehe example.env.
Entwicklung
pip install -e '.[dev]'
pytest
# after changing request models:
python -m tests.regenerate_tool_promptArchitektur folgt dem oWoHo-AI-Toole-Server-Muster (reine Kernbibliothek + abgeleitete FastAPI/FastMCP/CLI-Schnittstellen), wie reddit_tool_server und obsidian_ai_miniserver.
Lizenz
MIT — siehe LICENSE.md.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables reading, searching, and sending iMessages directly from MCP-compatible clients by accessing the local macOS iMessage database, supporting conversations, attachments, and both individual and group chats.10410MIT
- 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 gradedqualityCmaintenanceEnables 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.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading and sending iMessages on macOS through MCP, with tools for managing chats, messages, and attachments via AI agents.MIT
Related MCP Connectors
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/whogben/mac_messages_host'
If you have feedback or need assistance with the MCP directory API, please join our Discord server