iMessage 查询 MCP 服务器
一个 MCP 服务器,通过模型上下文协议 (MCP) 提供对 iMessage 数据库的安全访问。该服务器基于 FastMCP 框架和 imessagedb 库构建,使 LLM 能够查询和分析 iMessage 对话,并进行适当的电话号码验证和附件处理。
📋 系统要求
- macOS(iMessage 数据库访问所需)
- Python 3.6+
📦依赖项
安装所有必需的依赖项:
所需软件包
- fastmcp :构建模型上下文协议服务器的框架
- imessagedb :用于访问和查询 macOS 消息数据库的 Python 库
- phonenumbers :Google 的电话号码处理库,用于正确的号码验证和格式化
所有依赖项均在requirements.txt
中指定,以方便安装。
📑 目录
🛠️ MCP 工具
服务器向 LLM 公开以下工具:
获取聊天记录
检索特定电话号码的短信历史记录,并可选择日期筛选。包括:
- 消息文本和时间戳
- 附件信息(如果有)
- 正确的电话号码验证
- 日期范围过滤
🚀 入门
克隆存储库:
📦安装选项
您可以在 Claude Desktop 或 Cline VSCode 插件中安装此 MCP 服务器。请选择最符合您需求的选项。
选项 1:安装 Claude Desktop
使用 FastMCP 安装:
选项 2:安装 Cline VSCode 插件
要将此服务器与Cline VSCode 插件一起使用:
- 在 VSCode 中,单击 Cline 插件侧栏中的服务器图标 (☰)
- 点击“编辑 MCP 设置”按钮 (✎)
- 在设置文件中添加以下配置:
将/path/to/repo
替换为您克隆此存储库的完整路径(例如, /Users/username/Projects/imessage-query-fastmcp-mcp-server
)
🔒 安全功能
- 对 iMessage 数据库的只读访问权限
- 使用 phonenumbers 库进行电话号码验证
- 通过丢失文件检测进行安全附件处理
- 日期范围验证
- 抑制进度输出以获得干净的 JSON 响应
📚 开发文档
该存储库包括用于开发的文档文件:
dev_docs/imessagedb-documentation.txt
���包含有关 iMessage 数据库结构和 imessagedb 库功能的综合文档。
该文档在开发功能时可作为上下文,并可与 LLM 一起使用以协助开发。
⚙️ 环境变量
不需要环境变量,因为服务器会自动将 iMessage 数据库定位在默认的 macOS 位置。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
MCP 服务器通过 MCP 提供对 iMessage 数据库的安全访问,使 LLM 能够通过适当的电话号码验证和附件处理来查询和分析 iMessage 对话
Related MCP Servers
- -securityFlicense-qualityAn MCP server that enables communication with users through Telegram. This server provides a tool to ask questions to users and receive their responses via a Telegram bot.Last updated -116JavaScript
- -securityAlicense-qualityA server for the Machine Chat Protocol (MCP) that provides a YAML-based configuration system for LLM applications, allowing users to define resources, tools, and prompts without writing code.Last updated -5PythonMIT License
- -securityFlicense-qualityAn MCP server that allows Claude and other LLMs to manage persistent memories across conversations through text file storage, enabling commands to add, search, delete and list memory entries.Last updated -2TypeScript
- -securityAlicense-qualityA macOS app that provides an MCP server to your Messages, Contacts, and moreLast updated -646Apache 2.0