P

imessage-query-fastmcp-mcp-server

...
Created 12/15/2024byhannesrudolph

Categories

llmmcpmcp-server

Language:

Python

Stars:

41

Forks:

5

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.

Last updated: 2/23/2025

Publisher info

hannesrudolph's avatar

Hannes Rudolph

Edmonton, Alberta, Canada
13
followers
19
following
16
repos

More MCP servers built with Python

mcp-atlassian

MCP server for Atlassian tools (Confluence, Jira)

By sooperset3200
https://github.com/fastnai/mcp-fastn

Unified Context Layer (UCL) is a multi-tenant Model Context Protocol (MCP) server that enables AI agents, automation platforms, and applications to connect to over 1,000 SaaS toolsโ€”such as Slack, Jira, Gmail, Shopify, Notion, and moreโ€”via a single standardized /command endpoint.

By Fastn
Web-To-MCP

Bridge the gap between design and code. Send pixel-perfect website components directly to Cursor or Claude Code using Model Context Protocol (MCP). No more screenshots or descriptions needed.

By Web-To-MCP