← 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 a direct 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 direct way for an agent to 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.
  • A hosted bot does not replace the Mac, and it cannot reach a Mac on your home network by itself. The sections below say what that means for each framework.
  • 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.

On a hosted Hermes bot, skip the Mac altogether: Photon is a managed service that gives the bot an iMessage line. If you do not need iMessage specifically, 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 only OpenClaw route. OpenClaw removed its BlueBubbles support, so an old BlueBubbles config does nothing on current versions.

Hermes Setup with BlueBubbles

BlueBubbles suits a Hermes agent you run yourself, because it needs a connection in both directions. Hermes calls the Mac to send, and the Mac posts each new message back to a webhook on the agent. That webhook port is not published on hosted instances, so a hosted bot can reach out to the Mac but incoming messages have no way back in. On a hosted Hermes bot, use Photon instead.

Install the BlueBubbles server on the Mac, sign it in to Messages, and note the server URL and password it gives you. Then tell Hermes about it — the simplest way is your agent's own dashboard: open Channels, find BlueBubbles (iMessage), click Configure, paste the server URL and password, switch it on, and use Test to check the agent can reach the Mac.

You can also run the guided setup:

hermes gateway setup

Or set it directly in ~/.hermes/.env:

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

The webhook listens on 127.0.0.1 by default, which only works when Hermes and BlueBubbles share a machine. If they are on different machines, set BLUEBUBBLES_WEBHOOK_HOST to an address the Mac can reach, and keep both on a private network rather than opening them to the public internet — this 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 running macOS 14 or newer. Install the tool on the Mac and grant the permissions macOS asks for. If Homebrew will not install it, which can happen on an Intel Mac, use the signed build from the imsg releases page:

brew install steipete/tap/imsg
imsg chats

The iMessage channel is a plugin that is not bundled with OpenClaw. Install it on the machine running the gateway:

openclaw plugins install @openclaw/imessage

Turn the channel on in your OpenClaw config:

{
  channels: {
    imessage: {
      enabled: true,
      cliPath: "/usr/local/bin/imsg",
      dbPath: "/Users/user/Library/Messages/chat.db",
    },
  },
}

Restart the gateway, then check the channel and approve your first DM:

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

OpenClaw on a Hosted Instance

A hosted instance is the remote case: the gateway runs on the server and imsg stays on your Mac. Install the plugin from the Web Terminal, enable the channel, and point channels.imessage.cliPath at a wrapper script that connects to the Mac over SSH. OpenClaw only needs a command it can talk to over standard input and output, so a wrapper is enough. Keep the wrapper and its SSH key under ~/.openclaw so they survive a restart, use the key so it never stops for a password, and give the full path to imsg, because an SSH session may not load your shell's PATH. Run which imsg on the Mac to find it:

#!/usr/bin/env bash
exec ssh -i ~/.openclaw/imsg-key -T user@your-mac /opt/homebrew/bin/imsg "$@"

Set remoteHost as well. It is not optional here: with a wrapper that carries its own key or port, the channel refuses to start without it. The dbPath is the path on the Mac:

{
  channels: {
    imessage: {
      enabled: true,
      cliPath: "/home/node/.openclaw/scripts/imsg-ssh",
      remoteHost: "user@your-mac",
      dbPath: "/Users/you/Library/Messages/chat.db",
    },
  },
}

The hard part is the connection. A hosted instance has no Tailscale client and no VPN device, so it cannot join a private network out of the box. It can make outbound SSH connections, which means your Mac has to accept SSH at an address reachable from the internet, and a Mac on a home network does not do that by default. If you open that path, allow key-based logins only.

We tested this with our current OpenClaw image and a real Mac in basic mode: the gateway sent an iMessage, received one, and answered with a pairing code. That test reached the Mac through a private tunnel and messaged the Mac's own address, so the address your Mac exposes is the part you still have to solve. Treat this as an advanced setup. If you would rather not run a Mac at all, a hosted Hermes bot with Photon is the simpler way to iMessage.

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, threaded replies, message effects, polls and group operations need the private API mode, and enabling that requires turning off System Integrity Protection on the Mac and relaxing library validation. 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 address is not reachable from a hosted bot. The Mac has to be reachable from where the agent runs.
  • Hermes can send but never receives. The Mac cannot reach the webhook on the agent. Check BLUEBUBBLES_WEBHOOK_HOST, and on a hosted bot use Photon instead.
  • OpenClaw shows no iMessage channel. Install the plugin and restart the gateway. Settings under channels.bluebubbles are ignored.
  • 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 help with the instance side, though the Mac, its permissions and the connection to it have to be set up by you — only you can sign in to your own Apple account.