io.github.cardmagic/messages

平台与服务

by cardmagic

可通过 CLI 或 MCP server 对 Apple Messages/iMessage 进行模糊搜索与浏览。

什么是 io.github.cardmagic/messages

可通过 CLI 或 MCP server 对 Apple Messages/iMessage 进行模糊搜索与浏览。

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 marketplace
claude plugin marketplace add cardmagic/ai-marketplace

# Install the plugin
claude 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/messages
claude mcp add --transport stdio messages -- messages --mcp

From source

bash
git clone https://github.com/cardmagic/messages.git
cd messages
make install

# Then add as plugin OR MCP server:
claude plugin marketplace add cardmagic/ai-marketplace
claude plugin install messages@cardmagic
# OR
claude 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 activity
messages contacts --limit 10

# List conversations with message counts
messages conversations

# Show recent messages from someone
messages from "Mom"

# Show full conversation thread
messages thread "John" --after 2024-12-01

Search Commands

bash
# Search for messages (index auto-builds on first search)
messages search "coffee tomorrow"

# Filter by sender
messages search "dinner" --from "Mom"

# Filter by date
messages search "meeting" --after 2024-01-01

# Adjust result count and context
messages search "project" --limit 20 --context 5

# Show index statistics
messages stats

# Force rebuild the index
messages 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

常见问题

io.github.cardmagic/messages 是什么?

可通过 CLI 或 MCP server 对 Apple Messages/iMessage 进行模糊搜索与浏览。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描111.8k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描111.8k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描9.8k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.1k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.3k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
34.9k

评论