All Products
Search
Document Center

Simple Application Server:Call iMessage using OpenClaw

Last Updated:Feb 05, 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

Billing overview

Deploying and using OpenClaw on a Simple Application Server incurs the following fees:

  • Simple Application Server fees: For more information, see Simple Application Server billing overview.

  • Model call fees: The OpenClaw image on Simple Application Server includes a default model configuration. The default model varies based on your purchase date.

    • On or after January 31, 2026: The default model is qwen3-max-2026-01-23. For pricing details, see Qwen Max model billing.

    • Before January 30, 2026: The default model is qwen-vl-plus. For pricing details, see Qwen-VL model billing.

Model call cost control

  • Purchase and configure a Coding Plan from Alibaba Cloud Model Studio: To avoid unexpected costs during initial use, subscribe to a Coding Plan. It provides a specific quota every 5 hours and is automatically disabled if the quota is exceeded. After deployment, modify configurations as described in Use a Coding Plan purchased from Alibaba Cloud Model Studio in OpenClaw. The Coding Plan supports deductions only for calls to qwen3-max-2026-01-23 and qwen3-coder-plus models.

  • Enable Stop on Free Quota Exhaustion (Singapore region only): By default, Alibaba Cloud Model Studio (Singapore region) continues to incur charges after the free quota is exhausted. To avoid charges beyond the free quota, go to Alibaba Cloud Model Studio and enable Stop on Free Quota Exhaustion.