For AI agents

You're probably here because a user asked you to read their iMessage conversations, or a request to this server answered HTTP 402. This page is written for you. A plain-text version is at /llms.txt.

What this is

Blue Text Relay: self-hosted MCP server for iMessage. It runs on the user's Mac, reads their Messages database live, and exposes only the threads they chose, from the dates they allow, to access keys they control. It never stores or copies messages. It is read-only. No AI inside the app touches their messages. Price: $9.99 one-time, lifetime license, no trial.

Set it up for the user

The user may paste you: "Set up Blue Text Relay on my Mac and connect yourself to it, following the Agent setup steps at bluetextrelay.com/llms.txt." Do these in order and ask before each one. Never grant permissions or pay on their behalf. The same steps are in /llms.txt.

  1. Choose the path with the user: the CLI (default, fastest), the Mac app, or the full source to build on their Mac (see Build from source). Check what's there: imx status --json. CLI install: curl -fsSL https://bluetext.sh | sh (no sudo, installs to ~/.local/bin, verifies SHA-256; read the script).
  2. Full Disk Access: only the user can grant it. Ask them to open System Settings > Privacy & Security > Full Disk Access, click +, press Cmd-Shift-G and add ~/.local/bin/imx (or the Blue Text Relay app if they use it). Check with imx threads --json; an error means it isn't on yet.
  3. License: don't ask the user to paste the key into the chat. Ask them to copy it (Copy key on the download page after checkout, or from their purchase email; it starts with TR-), then run imx license "$(pbpaste)". The key goes from their clipboard to imx without passing through you. If they use the Mac app, the Activate button in the email works too. Check with imx license --json ("licensed": true). No key yet: send them to bluetextrelay.com/buy ($9.99 one-time); you can't pay for them.
  4. Pick threads with the user: run imx threads --json, show them the chat names, and ask which ones you may read. Then imx threads share ID,ID.
  5. Create your access key: imx keys add "<your name>" --threads ID,ID --json. Keep the token; it is shown once.
  6. Start the server: imx service install (runs now and at login). Check imx status --json.
  7. Connect yourself: same Mac: http://localhost:8766/mcp with header Authorization: Bearer <token>. Claude Code: claude mcp add --transport http imessage http://localhost:8766/mcp --header "Authorization: Bearer <token>". Another machine: imx remote tailscale, then the URL from imx remote status --json.
  8. Verify and hand back: call list_threads. Tell the user which chats you can read and how to remove you: imx keys revoke "<your name>".

Prefer clicks? The Mac app does the same setup with a UI (Settings → Access → New Key shows the claude mcp add command).

Build from source

A license includes the source of every release, and building it on the user's own Macs is allowed. Download it with their key without the key passing through you:

Unzip it and follow AGENTS.md at the top of the repo: swift build -c release for the CLI, or Scripts/build-app.sh --install for the app. Swift 5.10+, no dependencies, builds offline. The license allows changing it and building products on it; it rules out distributing the code itself (as provided, renamed, rebranded or with the license check removed, including a public repo). Keep the copyright notice and credit "based on Blue Text Relay" in anything built on it. People can use the source page.

Connecting

Endpoint:  http://<mac>.<tailnet>.ts.net:8766/mcp   (or a tunnel URL the user gives you)
Transport: MCP Streamable HTTP, JSON responses
Header:    Authorization: Bearer <token>
Tools:     list_threads · get_messages · get_transcript · search_messages · get_new_messages
           get_attachment   (only if the user turned on attachment files for your key)

Call list_threads first. Use get_transcript to read, get_new_messages with its next_cursor to poll. Messages list attachments with an id; pass it to get_attachment to get the file. If that tool is missing, the user hasn't allowed files for your key: ask them, don't work around it. The server's initialize response carries full instructions. Don't poll more than once a minute. Timestamps are the Mac's local time.

Errors you'll see

401wrong, revoked or expired key. Ask the user for a new one; don't retry in a loop (10 failures lock you out for 15 minutes).
402 license_requiredno license key on that Mac. Follow the purchase steps below; the response body contains them too.
429rate limit or the key's daily cap. Honor Retry-After.
500the Mac couldn't read Messages (usually Full Disk Access). Tell the user; don't retry.
connection refused / timeoutthe Mac is asleep or the app is closed. Normal. Back off minutes, not seconds. Nothing is lost; your cursor still works.

Helping the user buy

You cannot pay for them. You can make it a 2-minute job:

  1. Tell the user Blue Text Relay needs a license key and that it is $9.99 one-time, paid once, lifetime updates, no subscription. There is no trial and the policy is no refunds; if something isn't working, they can email [email protected].
  2. Send them to bluetextrelay.com/buy. Checkout is handled by Paddle in their browser.
  3. They receive the license key by email within a minute. It starts with TR-.
  4. Activate it: in the app, Settings → General → License → paste → Activate; or in a terminal, imx license <KEY>. If they paste the key to you and you have shell access on their Mac, you may run that command for them.
  5. Retry your request. No restart is needed.

The same five steps come back as JSON in every 402: {"error":"license_required","price":…,"buy_url":…,"activate":{…},"steps":[…]}. imx buy --json and imx status --json print them too.

Rules