← Back to Plugins
Channels

Multiply Openclaw Connector

bpweber1 By bpweber1 👁 53 views ▲ 0 votes

OpenClaw channel plugin for the Multiply agent platform - first-class bidirectional messaging integration

GitHub

Install

openclaw plugins install -l

Configuration Example

// In your pushToAgent function, ensure the payload includes:
const payload = {
  message_id: message.id,
  thread_id: thread.id,
  thread_title: thread.title,
  content: message.content,
  sender: {
    id: message.sender_id,
    name: message.sender_name || "User",
    type: "user"
  },
  agent_id: agent.slug || agent.id,
  callback_url: `${process.env.SERVER_URL}/api/agents/callback`,
  callback_secret: process.env.AGENT_WEBHOOK_SECRET,
  timestamp: message.created_at,
};

README

# Multiply OpenClaw Connector

OpenClaw channel plugin that connects your OpenClaw agents to the [Multiply](https://github.com/bpweber1/Multiply) agent platform as a first-class messaging channel.

## Features

- **Bidirectional messaging** โ€” Messages flow seamlessly between Multiply and OpenClaw
- **Webhook-based integration** โ€” Reliable HTTP-based message delivery
- **Multi-agent routing** โ€” Map Multiply agents to different OpenClaw agent configurations
- **Typing indicators** โ€” Show when agents are processing messages
- **Session persistence** โ€” Conversation context maintained per thread
- **Status reporting** โ€” Agents report online/offline status to Multiply

## Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     MULTIPLY PLATFORM                        โ”‚
โ”‚                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   Next.js App   โ”‚          โ”‚   Socket Server (Railway) โ”‚  โ”‚
โ”‚  โ”‚   (Vercel)      โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                           โ”‚  โ”‚
โ”‚  โ”‚                 โ”‚   WS     โ”‚  Socket.io namespaces     โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                          โ”‚                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚
                              HTTP Webhook (bidirectional)
                                           โ”‚
                              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                              โ”‚   OpenClaw Gateway          โ”‚
                              โ”‚                             โ”‚
                              โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
                              โ”‚   โ”‚  Multiply Connector โ”‚   โ”‚
                              โ”‚   โ”‚  (this plugin)      โ”‚   โ”‚
                              โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
                              โ”‚                             โ”‚
                              โ”‚   Agents: Jarvis, Harvey... โ”‚
                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

## Installation

### From local source

```bash
cd /path/to/multiply-openclaw-connector
openclaw plugins install -l .
```

### Enable the plugin

```bash
openclaw plugins enable multiply
```

## Configuration

Add to your `openclaw.json`:

```json5
{
  channels: {
    multiply: {
      enabled: true,
      webhookSecret: "your-shared-secret",
      socketServerUrl: "https://your-multiply-socket-server.railway.app",
      agentId: "jarvis", // Your agent's ID in Multiply
      
      // Optional: Map Multiply agent IDs to OpenClaw agent IDs
      agentMapping: {
        "jarvis": "main",
        "harvey": "talent",
        "hemingway": "content"
      },
      
      // Optional settings
      typingIndicator: true,
      textChunkLimit: 4000
    }
  }
}
```

### Environment Variables

Instead of hardcoding secrets, use environment variables:

- `MULTIPLY_WEBHOOK_SECRET` โ€” Shared secret for webhook authentication
- `MULTIPLY_SOCKET_SERVER_URL` โ€” URL of your Multiply socket server
- `MULTIPLY_AGENT_ID` โ€” Default agent ID

## Socket Server Setup

Update your Multiply socket server to push messages to OpenClaw:

### 1. Register the OpenClaw webhook URL

In your socket server's agent configuration, set the agent's webhook URL:

```sql
UPDATE agents 
SET webhook_url = 'http://your-openclaw-host:18789/multiply'
WHERE slug = 'jarvis';
```

### 2. Update the webhook push function

Your socket server already has `agentPush.js`. Update it to include the callback URL:

```javascript
// In your pushToAgent function, ensure the payload includes:
const payload = {
  message_id: message.id,
  thread_id: thread.id,
  thread_title: thread.title,
  content: message.content,
  sender: {
    id: message.sender_id,
    name: message.sender_name || "User",
    type: "user"
  },
  agent_id: agent.slug || agent.id,
  callback_url: `${process.env.SERVER_URL}/api/agents/callback`,
  callback_secret: process.env.AGENT_WEBHOOK_SECRET,
  timestamp: message.created_at,
};
```

## How It Works

### Inbound (Multiply โ†’ OpenClaw)

1. User sends message in Multiply UI
2. Socket server receives message via WebSocket
3. Socket server POSTs to OpenClaw's `/multiply` webhook
4. Multiply plugin processes the message
5. OpenClaw agent generates response
6. Plugin POSTs response to callback URL
7. Socket server broadcasts to Multiply UI

### Outbound (OpenClaw โ†’ Multiply)

1. Agent uses `message` tool with `channel: "multiply"`
2. Plugin POSTs to socket server's `/api/agents/callback`
3. Socket server broadcasts to appropriate thread

## Multi-Agent Routing

Map different Multiply agents to different OpenClaw configurations:

```json5
{
  agents: {
    list: [
      { id: "main", name: "Jarvis", workspace: "~/.openclaw/agents/jarvis" },
      { id: "talent", name: "Harvey", workspace: "~/.openclaw/agents/harvey" },
      { id: "content", name: "Hemingway", workspace: "~/.openclaw/agents/hemingway" }
    ]
  },
  channels: {
    multiply: {
      agentMapping: {
        "jarvis": "main",
        "harvey": "talent",
        "hemingway": "content"
      }
    }
  }
}
```

## Security

### Webhook Authentication

All webhook requests are authenticated using the shared secret:

- `Authorization: Bearer <secret>` header
- `X-Agent-Secret: <secret>` header (Multiply convention)

### Recommendations

1. Use HTTPS in production
2. Generate a strong random secret: `openssl rand -hex 32`
3. Store secrets in environment variables
4. Consider IP allowlisting if possible

## Troubleshooting

### Check plugin status

```bash
openclaw status
openclaw plugins list
```

### View webhook logs

```bash
# OpenClaw gateway logs
./scripts/clawlog.sh | grep multiply

# Or check the log file
tail -f ~/.openclaw/gateway.log | grep multiply
```

### Test webhook manually

```bash
curl -X POST http://localhost:18789/multiply \
  -H "Authorization: Bearer YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "thread_id": "test-123",
    "content": "Hello from test",
    "sender": { "id": "user-1", "name": "Test User" },
    "agent_id": "jarvis",
    "callback_url": "http://localhost:3001/api/agents/callback"
  }'
```

## Development

```bash
# Link for development
openclaw plugins install -l /path/to/multiply-openclaw-connector

# Restart gateway after changes
openclaw gateway restart
```

## License

MIT
channels

Comments

Sign in to leave a comment

Loading comments...