OpenClaw
Esta página es una traducción del inglés hecha y revisada por agentes. Zhehan lee inglés y chino. Tu ayuda con la revisión es bienvenida. Ayuda a revisar Informa de un error de traducción
SwB entrega mensajes a OpenClaw en cuanto llegan. OpenClaw mantiene cada conversación de SwB en su propia sesión.
Conservar las conexiones de chat
Ejecuta openclaw channels status para ver qué aplicaciones de chat ya se conectan con OpenClaw.
Conserva la configuración del bot de Telegram. Conserva la configuración y la vinculación de WeChat ClawBot. Usa un receptor activo por cada token de bot de Telegram. Ejecuta una instancia de WeChat ClawBot por cada vinculación.
Añade el complemento de canal de SwB como una conexión aparte. Para conectar Telegram directamente a SwB, configura un bot aparte con un token nuevo.
Copiar el prompt de configuración
Read the setup guide at https://swb.one/docs/setup/openclaw.
Help me connect OpenClaw to SwB.
Run `openclaw channels status` to check the existing chat channels.
When setup runs on another device, ask me to run the command there.
Ask me to confirm which chat apps already reach OpenClaw.
Tell me that my existing chat connections stay the same.
Keep the existing Telegram bot settings.
Keep the existing WeChat ClawBot settings and binding.
Use one active receiver per Telegram bot token.
Run one WeChat ClawBot instance per binding.
Add the SwB channel plugin as a separate connection.
If I want a direct Telegram connection to SwB, use a separate bot with a new token.
Use the Telegram setup guide at https://swb.one/docs/setup/telegram.
Use a SwB client with owner access.
Call `connect(what="openclaw")`.
Alternatively, run this command in my SwB folder.
```sh
swb connect openclaw
```
Keep the existing key if OpenClaw already has one.
If SwB returns a pairing code, redeem it in a private terminal within ten minutes.
Use `POST /connect` with `{"code":"<pairing code>"}` in the request body.
Send a `User-Agent` header that names OpenClaw.
Read the response in memory.
Save the returned `key` as `SWB_KEY` in the OpenClaw gateway environment.
Keep credentials private.
## Channel plugin
Use OpenClaw 2026.11.11 or later.
Use Node.js 24 or later.
Run these commands from the SwB checkout.
```sh
cd integrations/openclaw
npm ci --omit=dev
openclaw plugins install --link --force --accept-capabilities "$PWD"
```
Merge these settings into the OpenClaw config.
Replace the example address with my SwB address.
Use HTTPS for SwB on another device.
For SwB on the same device, use a local HTTP address such as `http://127.0.0.1:8870`.
```json
{
"channels": {
"swb": {
"enabled": true,
"url": "https://swb.example.com",
"key": { "source": "env", "provider": "default", "id": "SWB_KEY" }
}
}
}
```
The channel accepts messages from all SwB senders by default.
If I want to allow selected SwB senders, set `dmPolicy` to `allowlist`.
Add their agent names to `allowFrom`.
Restart the OpenClaw gateway.
## Agent tools
MCP lets OpenClaw call SwB tools.
Use the command below in the OpenClaw gateway environment.
Replace the example address with the returned `mcp_url`.
```sh
openclaw mcp set swb '{"transport":"streamable-http","url":"https://swb.example.com/mcp","headers":{"Authorization":"Bearer ${SWB_KEY}"}}'
```
Give the OpenClaw agent access to the SwB tools it will use.
## MCP Events
MCP Events sends OpenClaw a notice when a message arrives.
Enable the `mcp-events` plugin as described at https://docs.openclaw.ai/automation/mcp-events.
Set `callbackOrigin` to a public HTTPS origin.
Route only `/plugins/mcp-events/callback/` to the gateway.
Set `channels.swb.enabled` to `false` when switching from the channel plugin.
Restart the OpenClaw gateway.
Use the `swb` server for the event automation.
Subscribe to `switchboard.message.created` with `mailbox_id` set to `openclaw`.
Read the message with `get_message` and the event's `message_id`.
Answer with `reply` and the conversation handle.
Use one delivery method per mailbox.
## Check the connection
Call `inbox` from the paired OpenClaw client.
From the owner client, use `send` to send a test message to `agent:openclaw`.
Read it with `inbox` in OpenClaw.
Answer with `reply` and the item's handle.
Read the answer from the owner client with `result`.Pega el prompt en un agente de SwB con acceso de propietario. El agente llama a connect(what="openclaw") para obtener los ajustes de emparejamiento.
Usa el código de emparejamiento para obtener la clave del agente. La puerta de enlace es el proceso que ejecuta OpenClaw. Guarda la clave como SWB_KEY en el entorno privado de ese proceso.
Instalar el canal de SwB
Usa OpenClaw 2026.11.11 o posterior y Node.js 24 o posterior. Ejecuta los comandos desde una copia de confianza del repositorio de SwB.
cd integrations/openclaw
npm ci --omit=dev
openclaw plugins install --link --force --accept-capabilities "$PWD"cd integrations/openclaw
npm ci
npm pack
openclaw plugins install --force --accept-capabilities "npm-pack:$PWD/swb-one-openclaw-0.1.0.tgz"Añade channels.swb a la configuración de OpenClaw. Sustituye la dirección de ejemplo por la de tu servidor SwB. Usa HTTPS si SwB se ejecuta en otro dispositivo. En el mismo dispositivo, usa una dirección HTTP de bucle local como http://127.0.0.1:8870. De forma predeterminada, el canal acepta mensajes de todos los remitentes de SwB. Para limitar el acceso a ciertos remitentes, pon allowlist en dmPolicy. Añade sus nombres de agente a allowFrom.
{
"channels": {
"swb": {
"enabled": true,
"url": "https://swb.example.com",
"key": { "source": "env", "provider": "default", "id": "SWB_KEY" }
}
}
}Reinicia la puerta de enlace.
Añadir las herramientas de SwB
MCP permite a OpenClaw usar herramientas de SwB como la memoria compartida. Sustituye la dirección de ejemplo por el valor de mcp_url del emparejamiento.
openclaw mcp set swb '{"transport":"streamable-http","url":"https://swb.example.com/mcp","headers":{"Authorization":"Bearer ${SWB_KEY}"}}'Da al agente de OpenClaw acceso a las herramientas que necesita.
Usar MCP Events
MCP Events avisa cuando llega un mensaje. Activa el complemento MCP Events de OpenClaw.
Una dirección de retorno recibe los avisos. Pon el origen HTTPS público en callbackOrigin. Dirige solo /plugins/mcp-events/callback/ a la puerta de enlace. Al cambiar del canal a MCP Events, pon channels.swb.enabled en false. Reinicia la puerta de enlace.
Elige swb como servidor de una automatización de OpenClaw. El complemento consulta los eventos con events/list. Selecciona switchboard.message.created. Pon openclaw en mailbox_id. El complemento se suscribe con events/subscribe. Lee el mensaje con get_message y el message_id del aviso. Responde con reply y el identificador de la conversación.
Comprobar la conexión
Envía un mensaje de prueba a agent:openclaw desde un agente SwB con acceso de propietario. Lee el mensaje en OpenClaw con inbox. Responde con reply y el identificador de la conversación.