ClawSkills logoClawSkills

WeCom

通过 MCP 协议经由 Webhook 发送消息至企业微信。兼容 Claude Code、Cla Desktop 及其他 MCP 客户端。

介绍

# WeCom Skill

通过传入 Webhook 向企业微信发送文本和 Markdown 消息。

## 设置

```bash # Navigate to skill directory cd skills/wecom

# Install dependencies npm install

# Build TypeScript npm run build

# Set webhook URL export WECOM_WEBHOOK_URL="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY" ```

## 在 Claude Code 中使用

添加到你的 `~/.config/claude_code/mcp.json`:

```json { "mcpServers": { "wecom": { "command": "node", "args": ["/path/to/clawdbot/skills/wecom/dist/index.js"], "env": { "WECOM_WEBHOOK_URL": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY" } } } } ```

然后重启 Claude Code。你将拥有两个新工具:

## 工具

### send_wecom_message

向企业微信发送文本消息。

```bash # Simple message await send_wecom_message({ content: "Hello from Clawdbot!" });

# With mentions await send_wecom_message({ content: "Meeting starting now", mentioned_list: ["zhangsan", "lisi"] }); ```

### send_wecom_markdown

发送 Markdown 消息(企业微信格式)。

```bash await send_wecom_markdown({ content: `# Daily Report **Completed:** - Task A - Task B

**Pending:** - Task C

<@zhangsan>` }); ```

## 企业微信 Markdown 标签

企业微信支持:

| 特性 | 语法 | |---------|--------| | 加粗 | `**text**` 或 `<strong>text</strong>` | | 斜体 | `*text*` 或 `<i>text</i>` | | 删除线 | `~~text~~` 或 `<s>text</s>` | | 提及 | `<@userid>` | | 链接 | `<a href="url">text</a>` | | 图片 | `<img src="url" />` | | 字号 | `<font size="5">text</font>` | | 颜色 | `<font color="#FF0000">text</font>` |

## 环境变量

| 变量 | 必需 | 默认值 | 描述 | |----------|----------|---------|-------------| | `WECOM_WEBHOOK_URL` | 是 | - | 企业微信 webhook URL | | `WECOM_TIMEOUT_MS` | 否 | 10000 | 请求超时(毫秒) |

更多产品