Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

imessage-query-fastmcp-mcp-server

MCP.Pizza Chef: hannesrudolph

The imessage-query-fastmcp-mcp-server is a specialized MCP server designed to provide secure and structured access to your iMessage database on macOS. Built using the FastMCP framework and the imessagedb Python library, it allows large language models (LLMs) to query and analyze iMessage conversations efficiently. This server ensures proper phone number validation using Google's phonenumbers library and supports handling of message attachments, making it ideal for developers building AI-powered tools that interact with iMessage data. It requires macOS and Python 3.6+ and is focused on safe, validated access to personal messaging data through the Model Context Protocol.

Use This MCP server To

Query iMessage conversations securely via LLMs Analyze message content with phone number validation Access and process iMessage attachments Integrate iMessage data into AI workflows Build AI assistants that understand iMessage context

README

MseeP.ai Security Assessment Badge

iMessage Query MCP Server

An MCP server that provides safe access to your iMessage database through Model Context Protocol (MCP). This server is built with the FastMCP framework and the imessagedb library, enabling LLMs to query and analyze iMessage conversations with proper phone number validation and attachment handling.

πŸ“‹ System Requirements

  • macOS (required for iMessage database access)
  • Python 3.6+

πŸ“¦ Dependencies

Install all required dependencies:

# Using pip
pip install -r requirements.txt

Required Packages

  • fastmcp: Framework for building Model Context Protocol servers
  • imessagedb: Python library for accessing and querying the macOS Messages database
  • phonenumbers: Google's phone number handling library for proper number validation and formatting

All dependencies are specified in requirements.txt for easy installation.

πŸ“‘ Table of Contents

πŸ› οΈ MCP Tools

The server exposes the following tools to LLMs:

get_chat_transcript

Retrieve message history for a specific phone number with optional date filtering. Includes:

  • Message text and timestamps
  • Attachment information (if any)
  • Proper phone number validation
  • Date range filtering

πŸš€ Getting Started

Clone the repository:

git clone https://github.com/hannesrudolph/imessage-query-fastmcp-mcp-server.git
cd imessage-query-fastmcp-mcp-server

πŸ“¦ Installation Options

You can install this MCP server in either Claude Desktop or the Cline VSCode plugin. Choose the option that best suits your needs.

Option 1: Install for Claude Desktop

Install using FastMCP:

fastmcp install imessage-query-server.py --name "iMessage Query"

Option 2: Install for Cline VSCode Plugin

To use this server with the Cline VSCode plugin:

  1. In VSCode, click the server icon (☰) in the Cline plugin sidebar
  2. Click the "Edit MCP Settings" button (✎)
  3. Add the following configuration to the settings file:
{
  "imessage-query": {
    "command": "uv",
    "args": [
      "run",
      "--with",
      "fastmcp",
      "fastmcp",
      "run",
      "/path/to/repo/imessage-query-server.py"
    ]
  }
}

Replace /path/to/repo with the full path to where you cloned this repository (e.g., /Users/username/Projects/imessage-query-fastmcp-mcp-server)

πŸ”’ Safety Features

  • Read-only access to the iMessage database
  • Phone number validation using the phonenumbers library
  • Safe attachment handling with missing file detection
  • Date range validation
  • Progress output suppression for clean JSON responses

πŸ“š Development Documentation

The repository includes documentation files for development:

  • dev_docs/imessagedb-documentation.txt: Contains comprehensive documentation about the iMessage database structure and the imessagedb library's capabilities.

This documentation serves as context when developing features and can be used with LLMs to assist in development.

βš™οΈ Environment Variables

No environment variables are required as the server automatically locates the iMessage database in the default macOS location.

imessage-query-fastmcp-mcp-server FAQ

What operating system is required to run this MCP server?
This MCP server requires macOS because it accesses the native iMessage database, which is only available on macOS.
How does the server ensure phone number data is accurate?
It uses Google's phonenumbers library to validate and format phone numbers properly, ensuring reliable data handling.
What Python version is needed to install and run this server?
Python 3.6 or higher is required to run the server and its dependencies.
How does this server handle message attachments?
The server supports attachment handling, allowing LLMs to query and analyze iMessage attachments alongside text messages.
Is this server compatible with multiple LLM providers?
Yes, it is designed to work with any LLM that supports the Model Context Protocol, including OpenAI, Anthropic Claude, and Google Gemini.
How do I install the necessary dependencies?
You can install all required dependencies using pip with the provided requirements.txt file.
What framework is used to build this MCP server?
The server is built using the FastMCP framework, which simplifies creating MCP servers with secure and efficient context access.
Can this server be used on non-macOS systems?
No, because it relies on accessing the macOS iMessage database, it only runs on macOS systems.