← Home

Guide

Connect iMessage to Your AI Agent

iMessage is the one channel that cannot run from a server alone. Apple has no bot API, so every setup routes through a Mac that is signed in to Messages. Read the first section before you invest time in this one.

Read This First

There is no iMessage bot API. The only way an agent can send and receive iMessages is through a Mac that is signed in to your Apple account, running software that drives the Messages app. That has three consequences worth knowing before you start:

  • You need a Mac that stays on and signed in. A spare Mac mini or an old laptop is the usual answer. If it sleeps, the bridge stops.
  • Your hosted bot does not replace the Mac — it talks to it. The Mac runs the bridge, and the agent connects to that bridge over the network.
  • You will grant fairly deep permissions on that Mac. Treat a dedicated Mac or a dedicated macOS user account as the sane setup, not your primary machine.

If that sounds like more than you want, Signal or Telegram will get you a working bot in minutes instead. See connecting Signal.

Two Bridges

Which bridge you use depends on which framework you run.

  • BlueBubbles — a server app you install on the Mac that exposes an HTTP API. This is the Hermes route.
  • imsg — a command-line tool that drives Messages directly. This is the OpenClaw route. OpenClaw can also work from BlueBubbles.

Hermes Setup with BlueBubbles

Install the BlueBubbles server on the Mac, sign it in to Messages, and note the server URL and password it gives you. Then configure Hermes:

hermes gateway setup

Or set it directly:

BLUEBUBBLES_SERVER_URL=http://192.168.1.10:1234
BLUEBUBBLES_PASSWORD=your-server-password
[email protected],+15551234567

One thing to get right: your hosted bot has to be able to reach that server URL. A LAN address like the one above works only if the agent runs on the same network. For a hosted instance, expose the BlueBubbles server through a private network such as Tailscale, or a tunnel, rather than opening it to the public internet — it is a bridge into your personal messages.

If you do not set an allowlist, unknown senders get a pairing code that you approve:

hermes pairing list
hermes pairing approve bluebubbles <CODE>

OpenClaw Setup with imsg

For the usual OpenClaw deployment, the gateway and imsg run on the same signed-in Mac. Install the tool, grant the permissions macOS asks for, then check the channel:

openclaw channels status --probe
openclaw pairing list imessage
openclaw pairing approve imessage <CODE>

If your gateway runs somewhere else — which is the case for a hosted instance — point channels.imessage.cliPath at a wrapper script that connects to the Mac and runs imsg there. OpenClaw only needs a command it can talk to over standard input and output, so a wrapper is enough.

Basic Mode Versus Full Features

Out of the box you get basic mode: sending and receiving text and media, watching for new messages, and listing chats. That is enough for most agents.

Reactions, edits, unsend, message effects and group operations need the private API mode, and enabling that requires turning off System Integrity Protection on the Mac. That is a genuine security trade-off — SIP is one of macOS's core protections, and on Apple Silicon disabling it also stops you running iOS apps on that Mac. Do it only on a dedicated machine you are comfortable weakening, and skip it entirely if basic mode covers what you need.

Permissions on the Mac

macOS will ask for Automation and Full Disk Access for the bridge process. Grant them in System Settings under Privacy and Security. If you drive the Mac over SSH, watch out for the permission being recorded against the SSH helper rather than the tool itself, which leaves you without a usable Messages toggle. Running the bridge as a normal logged-in session avoids that trap.

Troubleshooting

  • Nothing arrives. Check the Mac is awake and signed in to Messages, and that Messages itself receives the conversation.
  • The agent cannot reach the bridge. A LAN URL is not reachable from a hosted bot. Put both ends on the same private network.
  • Sends fail silently. Usually a missing Automation or Full Disk Access permission for the bridge process.
  • Reactions and edits do nothing. Those need private API mode, which basic mode does not include.

Need a Hand?

Contact support from your dashboard. We can configure the agent side for you, though the Mac and its permissions have to be set up by you — only you can sign in to your own Apple account.