mac-messages-mcp

by carterlasalle
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Allows reading and sending messages through the macOS Messages app, with capabilities to filter messages by contact and interact with iMessage conversations.

  • Provides access to the macOS Messages database, enabling interaction with the native messaging system on Mac computers.

Mac 信息 MCP

使用 MCP(多上下文协议)与 macOS 消息应用程序交互的 Python 桥接器。

特征

  • 从 macOS 信息应用阅读最新消息
  • 按联系人过滤消息
  • 通过 iMessage 发送新消息
  • 通过 API 访问消息

先决条件

  • macOS(已在 macOS 11+ 上测试)
  • Python 3.10+
  • uv 包管理器

安装 uv

如果您使用的是 Mac,请使用 Homebrew 安装 uv:

brew install uv

否则,请按照uv 网站上的安装说明进行操作。

⚠️在安装 uv 之前不要继续

安装

完全磁盘访问权限

⚠️ 此应用程序需要您的终端或应用程序具有完全磁盘访问权限才能访问消息数据库。

授予完全磁盘访问权限:

  1. 打开系统偏好设置/设置>安全和隐私/隐私>完全磁盘访问
  2. 单击锁定图标进行更改
  3. 将您的终端应用程序(Terminal、iTerm2 等)或 Claude Desktop/Cursor 添加到列表中
  4. 授予权限后重新启动终端或应用程序

一体化

Claude 桌面集成

  1. 转到Claude >设置>开发人员>编辑配置> claude_desktop_config.json
  2. 添加以下配置:
{ "mcpServers": { "messages": { "command": "uvx", "args": [ "mac-messages-mcp" ] } } }

光标集成

转到**“光标设置”** > **“MCP”**并将其粘贴为命令:

uvx mac-messages-mcp

⚠️ 仅运行 MCP 服务器的一个实例(在 Cursor 或 Claude Desktop 上),而不是同时运行两者

选项 1:从 PyPI 安装

uv pip install mac-messages-mcp

选项 2:从源安装

# Clone the repository git clone https://github.com/carterlasalle/mac_messages_mcp.git cd mac_messages_mcp # Install dependencies uv install -e .

用法

作为模块

from mac_messages_mcp import get_recent_messages, send_message # Get recent messages messages = get_recent_messages(hours=48) print(messages) # Send a message result = send_message(recipient="+1234567890", message="Hello from Mac Messages MCP!") print(result)

作为命令行工具

# Run the MCP server directly mac-messages-mcp

发展

版本控制

该项目使用语义版本控制。有关版本控制系统的工作原理以及如何发布新版本的详细信息,请参阅VERSIONING.md

要升级版本:

python scripts/bump_version.py [patch|minor|major]

安全说明

此应用程序直接访问包含个人通信信息的“消息”数据库。请谨慎使用,并确保您拥有相应的权限。

执照

麻省理工学院

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

-
security - not tested
A
license - permissive license
-
quality - not tested

一个 Python 桥接器,用于使用 MCP(多上下文协议)与 macOS 信息应用交互。使用 uvx mac-messages-mcp 即可轻松安装。

  1. Features
    1. Prerequisites
      1. Installing uv
    2. Installation
      1. Full Disk Access Permission
    3. Integration
      1. Claude Desktop Integration
      2. Cursor Integration
      3. Option 1: Install from PyPI
      4. Option 2: Install from source
    4. Usage
      1. As a Module
      2. As a Command-Line Tool
    5. Development
      1. Versioning
    6. Security Notes
      1. License
        1. Contributing
          ID: gxvaoc9znc