iMessage MCP server

Enables iMessage interaction on macOS for read/send capabilities.
Back to servers
Provider
tchbw
Release date
Jan 08, 2025
Language
TypeScript
Stats
3 stars

This server allows Claude and other MCP-compatible AI assistants to read and send iMessages on macOS devices. By implementing the Model Context Protocol (MCP), it bridges the gap between AI assistants and your iMessage conversations.

Prerequisites

  • macOS device
  • Python 3.7+
  • iMessage account properly configured on your Mac

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/mac-imessage-mcp.git
cd mac-imessage-mcp
  1. Install required dependencies:
pip install -r requirements.txt

Configuration

Create a configuration file named config.json in the project directory:

{
  "allowed_models": ["claude-3-opus-20240229", "claude-3-sonnet-20240229"],
  "server_port": 8000,
  "max_history": 50
}

Configuration Options

  • allowed_models: List of AI model IDs that are allowed to connect
  • server_port: Port number for the MCP server
  • max_history: Maximum number of messages to include in conversation history

Running the Server

Start the MCP server by running:

python mcp_server.py

The server will start listening for connections on the configured port.

Usage with Claude

Connecting Claude to the MCP Server

When chatting with Claude, you can instruct it to connect to your MCP server:

Please connect to my MCP server running at http://localhost:8000

Available Commands

Once connected, Claude can use the following commands to interact with iMessages:

  • Read messages: Claude can read recent conversations
  • Send messages: Claude can send new messages to contacts
  • Check message status: Claude can verify if messages were delivered

Example Interactions

You can ask Claude to:

Please read my recent iMessage conversation with John
Send an iMessage to Jane saying "Looking forward to dinner tonight!"
Check if my last message to David was delivered

Troubleshooting

Common Issues

  • Connection refused: Ensure the server is running and port is accessible
  • Authentication errors: Verify that the model ID is in the allowed_models list
  • Message send failures: Check that iMessage is properly signed in on your Mac

Logs

Check the server logs for detailed error information:

tail -f mcp_server.log

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later