mac-messages
Mac Messages Host
Mac の Apple Messages(iMessage/SMS)履歴全体を、AI エージェント向けに読み取り専用で提供します — REST/OpenAPI とストリーミング対応 HTTP MCP 上で提供される単一のバッチツールです。
単一ツール、バッチリクエスト: 単一の
messages(requests: str)ツールが、JSON リクエストの配列を受け取り、対応する JSON レスポンスの配列を返します。1 回の呼び出しで多数の独立した操作を実行できます。REST(POST /api/messages)と MCP(/mcp/)の両方で同一に提供されます。設計上読み取り専用: データベースは SQLite の
mode=roで開かれ、書き込み経路はありません。送信、編集、削除は一切できません。最新の macOS 本文デコード:
attributedBodyの typedstream ブロブ(Ventura+)に保存されたメッセージ本文と、message_summary_infoplist 内の編集履歴を透過的にデコードします。自動生成のツールプロンプト: AI 向けプロンプトは Pydantic モデルから生成され(約 615 gpt-4o トークン、
tiktokenでカウントされ、テストで保証されています)。tool_prompt.mdのスナップショットはドリフトテストで同期が維持されています。
Install
macOS 上で Python 3.11+ が必要です。
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 のアクセス権限(重要)
~/Library/Messages/chat.db は macOS TCC によって保護されています。mmhost を実行するプロセスには フルディスクアクセスが必要です。
システム設定 → プライバシーとセキュリティ → フルディスクアクセス → ターミナルアプリ(またはサーバーを起動するもの)を有効にし、再起動してください。
mmhost info を実行すると、データベースが読み取り可能かどうかがすぐにわかります。
Related MCP server: jons-mcp-imessage
Endpoints
Endpoint | Purpose |
| バッチ処理ツール(REST) |
| OpenAPI スキーマ |
| インタラクティブなドキュメント |
| 死活プローブ |
| ストリーミング対応 HTTP MCP エンドポイント(単一 |
Auth
admin_token(永続設定、MMHOST_ADMIN_TOKEN、または --admin-token)が設定されている場合は、Authorization: Bearer <token> が必要です。トークンが設定されていない場合は、アクセスがオープンになります。デフォルトでサーバーが 127.0.0.1 にバインドされるため安全です。
Request kinds
get_info— データベースのステータス、件数、履歴の日付範囲list_chats— 最近のアクティビティ順の会話一覧(フィルタ、ページネーション)get_chat— チャットのトランスクリプト(beforeで過去の履歴をページング)get_recent— すべてのチャットにわたる最新メッセージ(sinceでポーリング)search_messages— メッセージ本文に対する大文字小文字を区別しない部分文字列検索
正確な AI 向けドキュメント(モデルから生成)については tool_prompt.md を参照してください。
Example
curl -s http://127.0.0.1:8761/api/messages \
-H 'Content-Type: application/json' \
-d '{"requests": "[{\"kind\":\"list_chats\",\"limit\":3}]"}'MCP クライアント設定
{
"mcpServers": {
"mac-messages": {
"type": "streamable-http",
"url": "http://127.0.0.1:8761/mcp/"
}
}
}Configuration
プラットフォームの設定ディレクトリ(macOS では ~/Library/Application Support/mac_messages_host/config.json)に永続化されます。場所は MMHOST_CONFIG で上書きできます。サーバーレベルの設定のみです — example.env を参照してください。
Development
pip install -e '.[dev]'
pytest
# after changing request models:
python -m tests.regenerate_tool_promptアーキテクチャは oWoHo AI Tool Server パターン(純粋なコアライブラリ + そこから派生した FastAPI/FastMCP/CLI インターフェース)に従っており、reddit_tool_server や obsidian_ai_miniserver と同様です。
License
MIT — 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