Messages

io.github.cardmagic由 GitHub 帳號 cardmagic 發布v1.2.0更新於 Oct 24, 2026

Fuzzy search and browse Apple Messages/iMessage from CLI or MCP server

已驗證STDIO僅桌面知識與記憶溝通與協作

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助手在 Mac 上以模糊搜尋瀏覽 Apple 訊息/iMessage 的歷史紀錄、聯絡人與對話。

可以做什麼
以模糊、容錯方式搜尋訊息,可依寄件者或日期範圍篩選,並顯示前後文。瀏覽最近訊息、依活躍度排序的聯絡人,以及附訊息數量的對話。開啟與某位聯絡人的完整對話串。查看搜尋索引統計。
適用情境
適合讓助手回答關於你自己簡訊的問題,例如某人對某個計畫說了什麼、最近誰傳訊息來、某個對話串裡聊了什麼,而不必手動複製訊息。
執行需求
僅限 macOS,因為它會讀取 Apple 訊息資料庫。需要 Node.js 22+ 與該 npm 套件,透過 stdio 在本機執行。必須為終端機應用程式授予完整磁碟存取權限,才能讀取訊息資料庫。
安裝前請注意
它會讀取你全部的訊息歷史與通訊錄聯絡人,並在家目錄下建立本機搜尋索引,因此能存取該機器或這些索引檔案的人都能看到內容。為終端機授予完整磁碟存取權限範圍很廣,需考量該終端機中還執行什麼。僅供瀏覽讀取,但資料極為私密。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Messages,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

messages

Fuzzy search and browse Apple Messages (iMessage/SMS) from the command line, as a Claude Code plugin, or as an MCP server.

Features

  • Fuzzy search with typo tolerance across all your messages
  • Browse recent messages, contacts, and conversations
  • Contact resolution - shows names instead of phone numbers
  • Context display - see messages before/after each match
  • Filter by sender or date range
  • Auto-indexing - index automatically rebuilds when new messages are detected
  • Multiple interfaces - CLI, MCP server, or Claude Code plugin

Requirements

  • macOS (reads from Apple Messages database)
  • Node.js 22+
  • Full Disk Access permission for your terminal (to read ~/Library/Messages/chat.db)

Installation

Homebrew

bash
brew install cardmagic/tap/messages

npm

bash
npm install -g @cardmagic/messages

Claude Code Plugin (recommended)

Install as a plugin to get skills (auto-invoked) and slash commands:

bash
# Add the marketplaceclaude plugin marketplace add cardmagic/ai-marketplace
# Install the pluginclaude plugin install messages@cardmagic

This gives you:

  • Skill: Claude automatically searches messages when you ask about texts/iMessages
  • Slash commands: /messages:search, /messages:recent, /messages:from, and more

MCP Server

For direct MCP tool access without the plugin:

bash
claude mcp add --transport stdio messages -- npx -y @cardmagic/messages --mcp

Or install globally first:

bash
npm install -g @cardmagic/messagesclaude mcp add --transport stdio messages -- messages --mcp

From source

bash
git clone https://github.com/cardmagic/messages.gitcd messagesmake install
# Then add as plugin OR MCP server:claude plugin marketplace add cardmagic/ai-marketplaceclaude plugin install messages@cardmagic# ORclaude mcp add --transport stdio messages -- messages --mcp

Granting Full Disk Access

The tool needs to read your Messages database at ~/Library/Messages/chat.db:

  1. Open System Settings > Privacy & Security > Full Disk Access
  2. Click + and add your terminal app (Terminal.app, iTerm, Warp, etc.)
  3. Restart your terminal

Usage

CLI

Browse Commands
bash
# Show most recent messages (who texted me?)messages recent
# List contacts by recent activitymessages contacts --limit 10
# List conversations with message countsmessages conversations
# Show recent messages from someonemessages from "Mom"
# Show full conversation threadmessages thread "John" --after 2024-12-01
Search Commands
bash
# Search for messages (index auto-builds on first search)messages search "coffee tomorrow"
# Filter by sendermessages search "dinner" --from "Mom"
# Filter by datemessages search "meeting" --after 2024-01-01
# Adjust result count and contextmessages search "project" --limit 20 --context 5
# Show index statisticsmessages stats
# Force rebuild the indexmessages index
Search Options
OptionDescription
-f, --from <sender>Filter by sender name or phone
-a, --after <date>Only messages after date (YYYY-MM-DD)
-l, --limit <n>Max results (default: 10)
-c, --context <n>Messages before/after (default: 2)

Claude Code Plugin

When installed as a plugin, you get:

Skill (auto-invoked): Claude automatically searches messages when you ask things like:

  • "What did Mom say about dinner?"
  • "Who texted me recently?"
  • "Find messages about the trip"

Slash Commands:

CommandDescription
/messages:search <query>Fuzzy search with optional filters
/messages:recentShow most recent messages
/messages:contactsList contacts by activity
/messages:conversationsList conversations with message counts
/messages:from "Name"Messages from a specific person
/messages:thread "Name"Full conversation thread
/messages:browse <cmd>Alias for browse commands

MCP Server

When installed as an MCP server, Claude Code can use these tools:

ToolDescription
search_messagesSearch messages with fuzzy matching
recent_messagesGet most recent messages
list_contactsList contacts by activity
list_conversationsList conversations with counts
get_threadGet conversation thread with a contact
get_message_statsGet index statistics
Manual MCP Configuration

For Claude Desktop or VS Code, add to your MCP configuration:

json
{  "mcpServers": {    "messages": {      "command": "npx",      "args": ["-y", "@cardmagic/messages", "--mcp"]    }  }}

How It Works

  1. Auto-Indexing: On first search (or when new messages are detected), the tool automatically:

    • Reads your Apple Messages SQLite database
    • Builds a SQLite FTS5 full-text search index
    • Creates a MiniSearch fuzzy search index
    • Resolves contact names from your Address Book
  2. Searching: Queries both indexes for best results with typo tolerance

  3. Storage: Index files are stored in ~/.messages/:

    • index.db - SQLite FTS5 database
    • fuzzy.json - MiniSearch index
    • stats.json - Index statistics

License

MIT

來源:README.md,提交 e3fa952

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.2.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分