All Products
Search
Document Center

Simple Application Server:Call iMessage using OpenClaw

Last Updated:Jan 30, 2026

Deploy an OpenClaw gateway on a Linux server and use Tailscale to create a secure tunnel to your Mac. This lets you manage iMessage on your Mac through OpenClaw.

Architecture

┌──────────────────────────────┐          SSH (imsg rpc)          ┌──────────────────────────┐
│ Gateway host (Linux/VM)      │──────────────────────────────────▶│ Mac with Messages + imsg │
│ - clawdbot gateway           │          SCP (attachments)        │ - Messages signed in     │
│ - channels.imessage.cliPath  │◀──────────────────────────────────│ - Remote Login enabled   │
└──────────────────────────────┘                                   └──────────────────────────┘
              ▲
              │ Tailscale tailnet (hostname or 100.x.y.z)
              ▼
        user@gateway-host

Procedure

Tailscale configuration

  1. Configure Tailscale on your Mac and server to establish a network connection. First, register for an account at Tailscale.

  2. Download and install Tailscale on your Mac from the download page.

    image (57)

  3. After installation, start Tailscale from the command line:

    /Applications/Tailscale.app/Contents/MacOS/Tailscale up
  4. To install Tailscale on your Linux server, go to this page to get the installation script. Then, run the script on your Linux operating system.

    image

    image (59)

  5. After the script runs, your Mac and Linux server are on the same local area network and can communicate with each other.

    image

  6. Tailscale might overwrite the DNS settings on your Linux server, which can cause network connection failures. To fix this, configure the nameserver to use 1.1.1.1 or 8.8.8.8.

    image (62)

    image

Mac configuration

  1. Enable remote connection permissions on your Mac. Go to System Settings > General > Sharing > Remote Login.

  2. Grant permissions to sshd-keygen-wrapper. Go to System Settings > Privacy & Security > Full Disk Access.

  3. Make sure you are logged on to iMessage on your Mac.

Clawdbot configuration

  1. Edit the configuration file at /root/.clawdbot/clawdbot.json and add the channel configuration.

    {
      "channels": {
        "imessage": {
          "enabled": true,
          "cliPath": "/root/.clawdbot/scripts/imsg-ssh",
          "dbPath": "/Users/{{YOUR_USER_NAME}}/Library/Messages/chat.db",
          "remoteHost": "{{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}}",
          "dmPolicy": "pairing",
          "groupPolicy": "allowlist",
          "includeAttachments": true
        }
      }
    }

    Pay attention to the following parameters:

    • YOUR_USER_NAME: Replace with your Mac username.

    • YOUR_MAC_MAGIC_DNS: Replace with the Magic DNS of your Mac from your Tailscale network.

    To get the Magic DNS:

    image

  2. Create the /root/.clawdbot/scripts/imsg-ssh file. This script forwards commands to your Mac using ssh. Replace {{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}} with the value from the previous step. Then, grant execute permission to the file.

    #!/usr/bin/env bash
    exec ssh -T {{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}} /usr/local/bin/imsg "$@"
  3. You can now connect to your Mac from the Linux server with a password using ssh {{YOUR_USER_NAME}}@{{YOUR_MAC_MAGIC_DNS}}. Configure passwordless logon from the Linux server to the Mac using SSH key authentication.

  4. Start and initialize the gateway:

    cd /home/clawdbot/
    pnpm clawdbot onboard --install-daemon

Results

  1. Connect to Chat through the TUI.

  2. Input: Send a poem to +86188xxxxxxxx using iMessage. The Mac then sends a poem to the specified number.

    image