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.
git clone https://github.com/yourusername/mac-imessage-mcp.git
cd mac-imessage-mcp
pip install -r requirements.txt
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
}
allowed_models
: List of AI model IDs that are allowed to connectserver_port
: Port number for the MCP servermax_history
: Maximum number of messages to include in conversation historyStart the MCP server by running:
python mcp_server.py
The server will start listening for connections on the configured port.
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
Once connected, Claude can use the following commands to interact with iMessages:
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
Check the server logs for detailed error information:
tail -f mcp_server.log
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.
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"
]
}
}
}
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.
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.