wxkingstar

Clawrelay Wecom Server — Development skill for Claude Code

Development community

Claude Code 企业微信中转服务 — 通过 WebSocket 让企业微信机器人接入 Claude Code,无需公网IP,流式回复,开箱即用.

How to install Clawrelay Wecom Server

This entry records only its repository, not the path inside it, so there is no exact command to give. Open wxkingstar/clawrelay-wecom-server and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Clawrelay Wecom Server does

Claude Code 企业微信中转服务 — 通过 WebSocket 让企业微信机器人接入 Claude Code,无需公网IP,流式回复,开箱即用。A WeCom bot relay for Claude Code.

Alternatives in Development

  • Telegram — Show Telegram bot status and manage global session 1.3k ★
  • Claude Agent Server — Run Claude Agent (Claude Code) in a sandbox, control it via websocket 556 ★
  • Claude Telegram Relay — Minimal pattern for running Claude Code as an always-on Telegram bot 326 ★

README

ClawRelay WeCom Server

Claude Code 企业微信中转服务 —— 三步启动,开箱即用。

A WeCom (Enterprise WeChat) bot relay for Claude Code. Open-source alternative to [Openclaw](https://github.com/nicepkg/openclaw).

![Python 3.12+](https://img.shields.io/badge/Python-3.12+-blue.svg) ![License MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

将 [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) 接入企业微信的开源中转方案。支持流式回复、多模态消息、多机器人管理,**无需公网 IP**。

企业微信用户发消息 → 本服务 WebSocket 接收 → clawrelay-api → Claude Code 处理 → 流式回复推送

无需回调 URL,无需数据库。通过 WebSocket 长连接直连企业微信,YAML 配置即用。


30 秒了解

你需要准备:

  1. 企业微信智能机器人bot_idsecret(从企业微信管理后台 → 应用管理 → 智能机器人 获取)
  2. clawrelay-api 运行在本机(默认端口 50009)

然后:

git clone https://github.com/wxkingstar/clawrelay-wecom-server.git
cd clawrelay-wecom-server
pip install -r requirements.txt
python main.py

首次启动会自动进入**配置向导**,按提示填入 `bot_id` 和 `secret` 即可:

============================================================
  ClawRelay WeCom Server — 首次配置向导
============================================================

  bot_id(企业微信机器人 ID): __________
  secret(企业微信机器人密钥): __________
  relay_url(clawrelay-api 地址)[http://localhost:50009]: __________

  配置已保存到 config/bots.yaml

配置完成,服务自动启动 WebSocket 连接。去企业微信给机器人发条消息试试吧。


Docker 部署

git clone https://github.com/wxkingstar/clawrelay-wecom-server.git
cd clawrelay-wecom-server

# 编辑配置(Docker 中不支持交互式向导,需提前填写)
cp config/bots.yaml.example config/bots.yaml
vim config/bots.yaml

docker compose up -d

Docker 模式下 `relay_url` 需使用 `http://host.docker.internal:50009`(而非 `localhost`)连接宿主机的 clawrelay-api。

docker compose logs -f app   # 查看日志
docker compose down           # 停止

功能一览

特性 说明
WebSocket 长连接 无需公网 IP、回调 URL,WSS 直连企业微信
零外部依赖 无数据库,YAML 配置 + 内存会话 + JSONL 日志
首次配置向导 启动即引导,无需手动编辑配置文件
多机器人 一个服务托管多个机器人,YAML 中加一段配置即可
流式回复 300ms