# messages MCP server

> Enables an AI client to fuzzy search, browse, and retrieve Apple Messages and iMessage history from macOS.

- Repository: https://github.com/cardmagic/messages
- Page: https://hostedmcp.org/servers/cardmagic/messages
- Transport: stdio
- Stars: 20
- License: MIT
- Latest version: 1.2.0

## Install

### Claude Code

```sh
claude mcp add messages -- npx -y @cardmagic/messages
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "messages": {
      "command": "npx",
      "args": [
        "-y",
        "@cardmagic/messages"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "messages": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@cardmagic/messages"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"messages","type":"stdio","command":"npx","args":["-y","@cardmagic/messages"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "messages": {
      "command": "npx",
      "args": [
        "-y",
        "@cardmagic/messages"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add messages -- npx -y @cardmagic/messages
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.messages]
command = "npx"
args = ["-y", "@cardmagic/messages"]
```

### Gemini CLI

```sh
gemini mcp add -s user messages npx -- -y @cardmagic/messages
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "messages": {
      "command": "npx",
      "args": [
        "-y",
        "@cardmagic/messages"
      ]
    }
  }
}
```

## Tools (6)

- `search_messages`: Search through Apple Messages (iMessage/SMS) with fuzzy matching. Can search by text query, filter by sender, or both. Use "from" to get messages from a specific person.
- `recent_messages`: Get the most recent messages across all conversations. Use this to see "who texted me recently" or get an overview of recent activity.
- `list_contacts`: List contacts sorted by recent messaging activity. Shows contact name, message count, and last message date.
- `list_conversations`: List conversations with message counts and last message preview. Shows all chat threads sorted by recent activity.
- `get_thread`: Get the full conversation thread with a specific contact. Shows messages in chronological order.
- `get_message_stats`: Get statistics about the indexed messages including count, date range, and contacts.

## FAQ

### What are the system requirements for this server?

You must be using macOS and have Node.js 22 or higher installed.

### Do I need to grant any special permissions?

Yes, you must grant Full Disk Access to your terminal application in System Settings to allow the tool to read the Messages database.

### How does the search indexing work?

The tool automatically builds a SQLite FTS5 full-text search index and a MiniSearch fuzzy search index when messages are detected.
