关于 Mcp Server Dingtalk
MCP Server DingTalk 让 MCP 客户端通过已配置的机器人向钉钉群发送消息,支持多种消息格式,并使用 HMAC-SHA256 对 Webhook 请求签名。
主要功能
- 01通过已配置机器人发送消息
- 02支持五种消息格式
- 03使用 HMAC-SHA256 签名请求
- 04通过 JSON 配置机器人
适用场景
- 01向钉钉群发送文本更新
- 02分享链接或格式化公告
- 03发布互动卡片或信息流卡片
MCP 相关
它向 MCP 客户端提供 dingtalk_bot_send_message 工具,通过已配置的机器人向钉钉群发送消息。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
1收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| message | object | 是 | 要发送的消息。 type Message = TextMessage | LinkMessage | MarkdownMessage | ActionCardMessage | FeedCardMessage; interface TextMessage { type: 'text'; content: string; } interface LinkMessage { type: 'link'; text: string; title: string; picUrl?: string; messageUrl: string; } interface MarkdownMessage { type: 'markdown'; title?: string; text: string; } interface ActionCardMessage { type: 'actionCard'; title: string; text: string; // markdown text btnOrientation?: '0' | '1'; // 0: vertical, 1: horizontal singleTitle?: string; // single button title singleURL?: string; // single button URL btns?: Array<{ title: string; // button title actionURL: string; // button URL }>; // array of buttons } interface FeedCardMessage { type: 'feedCard'; links: Array<{ title: string; // title of the link messageURL: string; // URL to open when the link is clicked on picURL: string; // image URL for the link }>; // array of links } |
| message.btnOrientation | enum | 否 | 0 | 1 |
| message.btns | array | 否 | |
| message.content | string | 否 | |
| message.links | array | 否 | |
| message.messageUrl | string | 否 | |
| message.picUrl | string | 否 | |
| message.singleTitle | string | 否 | |
| message.singleURL | string | 否 | |
| message.text | string | 否 | |
| message.title | string | 否 | |
| message.type | enum | 是 | 要发送的消息类型text | link | markdown | actionCard | feedCard |
| name | string | 是 | 用于发送消息的机器人名称 |
| notify | object | 是 | |
| notify.atMobiles | array | 否 | 要通知的手机号码 |
| notify.atUserIds | array | 否 | 要通知的用户 ID |
| notify.isAtAll | boolean | 否 | 是否通知所有用户 |
详细介绍
MCP Server DingTalk
用于集成 DingTalk 的模型上下文协议(MCP)服务。
功能
- 🤖 支持发送 DingTalk 机器人消息
- 📦 支持多种消息类型(文本、链接、Markdown、actionCard、feedCard)
- 🔐 使用 HMAC-SHA256 安全签署 webhook
- 🎯 支持 TypeScript,并进行严格的类型检查
前置条件
- Node.js 18+
用法
{
"mcp-server-dingtalk": {
"transport": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-server-dingtalk"
],
"env": {
"DINGTALK_BOT_CONFIGS": "[{\"name\": \"your-bot-name\", \"accessToken\": \"your-access-token\", \"signSecret\": \"your-sign-secret\"}]"
}
}
}
环境变量
| 变量 | 描述 | 必填 | 默认值 |
|---|---|---|---|
DINGTALK_BASE_URL | DingTalk API 基础 URL | 否 | https://oapi.dingtalk.com/robot/send |
DINGTALK_BOT_CONFIGS | 机器人配置的 JSON 数组 | 是 | [] |
可用工具
该服务提供以下 MCP 工具:
dingtalk_bot_send_message
通过已配置的机器人向 DingTalk 聊天群组发送消息。
参数:
name(string):用于发送消息的机器人名称message(object):包含特定类型字段的消息内容notify(object):@ 提及的通知设置
支持的消息类型:
-
文本消息
{ "type": "text", "content": "Hello, World!" } -
链接消息
{ "type": "link", "text": "Link description", "title": "Link Title", "messageUrl": "https://example.com" } -
Markdown 消息
{ "type": "markdown", "title": "Markdown Title", "text": "## Markdown Content\n- Item 1\n- Item 2" } -
Action Card 消息
{ "type": "actionCard", "title": "Action Card Title", "text": "Action card content", "singleTitle": "Read More", "singleURL": "https://example.com" } -
Feed Card 消息
{ "type": "feedCard", "links": [ { "title": "Feed Item", "messageURL": "https://example.com", "picURL": "https://example.com/image.png" } ] }
许可证
MIT
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。