# Blue Text Relay > Blue Text Relay — self-hosted MCP server for iMessage. There is no public iMessage API; this is how you run your own. It runs on the user's Mac, reads the Apple Messages database live and read-only, and gives AI agents metered, permissioned access to only the iMessage threads the user chooses. Nothing is stored or copied. No AI inside the app touches messages. No telemetry. $9.99 once, lifetime updates, no trial. Full site as plain text: https://bluetextrelay.com/llms-full.txt Agent walkthrough (install, connect, purchase): https://bluetextrelay.com/agents ## Install (the user runs this on their Mac; macOS 14+, Apple silicon or Intel) ``` curl -fsSL https://bluetextrelay.com/install.sh | sh # CLI only, no sudo, verifies SHA-256 imx setup # pick threads, create an access key, choose Tailscale imx service install # optional: run at login via launchd ``` Then the `imx` binary needs Full Disk Access (System Settings > Privacy & Security > Full Disk Access). Only the user can grant it. Prefer an app: https://bluetextrelay.com/download (menu bar app, same config). ## What it is - MCP server (Streamable HTTP, JSON responses) for iMessage / Apple Messages, self-hosted on macOS 14+. - Read-only: opens chat.db read-only, has no send tool, cannot send, edit or delete messages. - Per-agent access keys: thread scope, history start date per thread, daily request cap, per-call message cap, expiry, revoke, usage counts. - Deterministic credential redaction (API keys, tokens, private keys, passwords in URLs, stream keys) before text leaves the Mac. On by default. - Private access over Tailscale (default, end-to-end encrypted); optional public access via Tailscale Funnel, Cloudflare Tunnel or ngrok on the user's own accounts. - Headless-first CLI `imx` (every command has --json) plus an optional menu bar app. - Exports threads to Markdown and JSONL with date ranges. - One-time purchase: $9.99 one-time launch price (regular $19.99), lifetime license with every future update, offline license key, full source code of every release included for buyers (source-available, not open source: audit, build and modify for your own use; no redistribution). ## Connecting an agent - Endpoint: `http://..ts.net:8766/mcp` (or the tunnel URL the user gives you) - Header: `Authorization: Bearer ` - Tools: list_threads, get_messages, get_transcript, search_messages, get_new_messages (cursor-based polling) - Claude Code: `claude mcp add --transport http imessage --header "Authorization: Bearer "` - REST mirror: /api/threads, /api/messages, /api/search, /api/new; /health needs no key. ## Useful commands (all support --json) - `imx status` license, server, threads, keys, remote mode - `imx keys add NAME --threads ID,ID --daily 500 --per-call 200 --expires 2027-01-01` - `imx history THREAD-ID 2026-10-01` limit how far back agents can read - `imx remote tailscale|funnel|cloudflareQuick|cloudflareNamed HOST|ngrok|localOnly` - `imx buy --json` price and checkout link ## If a request answers HTTP 402 "license_required" That Mac has no license key (there is no trial; all sales are final). You cannot pay for them. Tell them a license is $9.99 one-time at https://bluetextrelay.com/buy; they get a key by email (starts with TR-); activate with `imx license ` or Settings > General > License; retry. The 402 body carries these steps as JSON. ## Pages - Docs: https://bluetextrelay.com/docs/ - Privacy: https://bluetextrelay.com/privacy - Security model: https://bluetextrelay.com/security - Buy: https://bluetextrelay.com/buy - Install script (read it first): https://bluetextrelay.com/install.sh ## Keywords iMessage API, iMessage MCP, MCP server for iMessage, self-hosted iMessage API, Apple Messages MCP, read iMessages with Claude, iMessage for AI agents, iMessage Cursor, chat.db MCP, local iMessage server, iMessage permissions for agents, blue bubble MCP