OpenClaw iMessage (Legacy) Channel
Connect OpenClaw to Apple iMessage using the imsg CLI tool on macOS. This legacy integration uses a JSON-RPC interface over stdio to read and send iMessages through the native macOS Messages database. Note: This channel is deprecated — for new setups, we strongly recommend using BlueBubbles instead, which provides a more robust REST API-based integration with broader feature support.
iMessage (Legacy) Supported Features
Text Messages
Supported
Media & Files
Supported
Reactions
Not Supported
Threads
Not Supported
Voice Messages
Not Supported
Group Chat
Not Supported
iMessage (Legacy) Prerequisites
- A Mac running macOS with Messages signed in to an Apple ID
- Full Disk Access permission granted to both OpenClaw and the imsg binary
- Automation permission for sending messages (granted via macOS TCC prompts)
- The imsg CLI installed via Homebrew: brew install steipete/tap/imsg
- OpenClaw Gateway installed and running
iMessage (Legacy) Quick Setup
Install the imsg CLI
Run 'brew install steipete/tap/imsg' to install the iMessage CLI tool. After installation, run 'imsg' once in a GUI terminal to trigger the macOS permission prompts for Full Disk Access and Automation.
Grant macOS permissions
Open System Settings > Privacy & Security. Grant Full Disk Access to both the imsg binary and the OpenClaw process. The Automation permission for Messages should be granted automatically when imsg first attempts to send a message.
Configure and start
Add the iMessage channel configuration to ~/.openclaw/openclaw.json with the cliPath and dbPath settings. Start the Gateway with 'openclaw start' and send a test iMessage to verify the connection.
iMessage (Legacy) Configuration Example
{
"channels": {
"imessage": {
"enabled": true,
"cliPath": "/opt/homebrew/bin/imsg",
"dbPath": "/Users/<username>/Library/Messages/chat.db"
}
}
}
iMessage (Legacy) Deep Dive
Deprecation Notice
Architecture Overview
DM Policies
{
"channels": {
"imessage": {
"dmPolicy": "pairing",
"allowFrom": ["+1234567890", "user@icloud.com"]
}
}
}
Group Chat Configuration
{
"channels": {
"imessage": {
"groupPolicy": "allowlist",
"mentionPattern": "@bot"
}
}
}
Remote Mac Setup via SSH
{
"channels": {
"imessage": {
"remoteHost": "mac-server.local",
"cliPath": "/usr/local/bin/imsg"
}
}
}
macOS Permissions (TCC)
iMessage (Legacy) Configuration Reference
| Key | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enable or disable the iMessage channel |
| cliPath | string | "/usr/local/bin/imsg" | Path to the imsg CLI binary. Homebrew installs to /opt/homebrew/bin/imsg on Apple Silicon Macs or /usr/local/bin/imsg on Intel Macs |
| dbPath | string | "~/Library/Messages/chat.db" | Path to the macOS Messages SQLite database |
| dmPolicy | string | "pairing" | DM access policy: 'pairing', 'allowlist', 'open', or 'disabled' |
| groupPolicy | string | "disabled" | Group chat policy: 'open', 'allowlist', or 'disabled' |
| allowFrom | string[] | [] | Phone numbers or Apple IDs allowed to contact the bot |
| includeAttachments | boolean | false | Whether to ingest media attachments from incoming messages |
| mediaMaxMb | number | 10 | Maximum file size in MB for media attachments |
| textChunkLimit | number | 4000 | Maximum characters per outbound message chunk |
| chunkMode | string | "length" | Text splitting mode: 'length' (character limit) or 'newline' (paragraph boundaries) |
| historyLimit | number | 20 | Maximum previous messages included as conversation context |
| configWrites | boolean | true | Allow /config set|unset commands via iMessage |
| remoteHost | string | "" | SSH hostname for running imsg on a remote Mac |
Enable or disable the iMessage channel
Path to the imsg CLI binary. Homebrew installs to /opt/homebrew/bin/imsg on Apple Silicon Macs or /usr/local/bin/imsg on Intel Macs
Path to the macOS Messages SQLite database
DM access policy: 'pairing', 'allowlist', 'open', or 'disabled'
Group chat policy: 'open', 'allowlist', or 'disabled'
Phone numbers or Apple IDs allowed to contact the bot
Whether to ingest media attachments from incoming messages
Maximum file size in MB for media attachments
Maximum characters per outbound message chunk
Text splitting mode: 'length' (character limit) or 'newline' (paragraph boundaries)
Maximum previous messages included as conversation context
Allow /config set|unset commands via iMessage
SSH hostname for running imsg on a remote Mac
iMessage (Legacy) Frequently Asked Questions
iMessage (Legacy) Troubleshooting
Missing macOS permissions (Full Disk Access or Automation) for the imsg binary or OpenClaw process.
The process is running in a headless environment (SSH, launchd) where macOS cannot display TCC prompts.
The dbPath configuration is incorrect or Full Disk Access has not been granted.
SSH key authentication is not configured, or the remote host is unreachable.