MCP server
by sfyyy
Integrate notifications into your workflow with DingTalk. Send messages, updates, and team alerts via secure webhook con
Sends automated notifications to DingTalk chat groups from Claude via webhook integration, supporting text, markdown, and link messages with @mentions and signature authentication.
DingTalk is a community-built MCP server published by sfyyy that provides AI assistants with tools and capabilities via the Model Context Protocol. Integrate notifications into your workflow with DingTalk. Send messages, updates, and team alerts via secure webhook con It is categorized under communication, developer tools. This server exposes 5 tools that AI clients can invoke during conversations and coding sessions.
You can install DingTalk in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
MIT
DingTalk is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Share your MCP server with the developer community
DingTalk has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
DingTalk is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
Useful MCP listing: DingTalk is the kind of server we cite when onboarding engineers to host + tool permissions.
We evaluated DingTalk against two servers with overlapping tools; this profile had the clearer scope statement.
I recommend DingTalk for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
DingTalk is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
Strong directory entry: DingTalk surfaces stars and publisher context so we could sanity-check maintenance before adopting.
DingTalk reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Strong directory entry: DingTalk surfaces stars and publisher context so we could sanity-check maintenance before adopting.
We wired DingTalk into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
showing 1-10 of 41
Claude Code 集成钉钉机器人通知的 MCP Server 实现
npm install -g claude-code-dingtalk-mcp
claude mcp add dingtalk-mcp dingtalk-mcp-server
export DINGTALK_WEBHOOK="https://oapi.dingtalk.com/robot/send?access_token=YOUR_TOKEN"
export DINGTALK_SECRET="YOUR_SECRET"
创建 .mcp.json 文件:
{"mcpServers": {"dingtalk-notifications": {"command": "dingtalk-mcp-server"}}}
重启 Claude Code,然后运行:
dingtalk_send_text {"content": "测试成功!"}
✅ 完成!现在可以在每次对话结束时调用 dingtalk_notify_session_end 发送通知
npm install -g claude-code-dingtalk-mcp
# 如果您的 Claude Code 支持 MCP 管理器
npx @modelcontextprotocol/cli add claude-code-dingtalk-mcp
# 无需安装,直接使用
npx claude-code-dingtalk-mcp
选择以下任一方式安装:
# 方式1:全局安装(推荐)
npm install -g claude-code-dingtalk-mcp
# 方式2:项目本地安装
npm install claude-code-dingtalk-mcp
# 方式3:直接使用(无需安装)
npx claude-code-dingtalk-mcp
在您的项目根目录或 Claude Code 全局配置目录创建/编辑 .mcp.json 文件:
全局安装方式:
{
"mcpServers": {
"dingtalk-notifications": {
"command": "dingtalk-mcp-server",
"description": "钉钉通知服务器"
}
}
}
本地安装方式:
{
"mcpServers": {
"dingtalk-notifications": {
"command": "node",
"args": ["./node_modules/claude-code-dingtalk-mcp/dist/index.js"],
"description": "钉钉通知服务器"
}
}
}
NPX 方式:
{
"mcpServers": {
"dingtalk-notifications": {
"command": "npx",
"args": ["claude-code-dingtalk-mcp"],
"description": "钉钉通知服务器"
}
}
}
方式1:系统环境变量
# 添加到 ~/.bashrc 或 ~/.zshrc
export DINGTALK_WEBHOOK="https://oapi.dingtalk.com/robot/send?access_token=YOUR_ACCESS_TOKEN"
export DINGTALK_SECRET="YOUR_SECRET_KEY"
export DINGTALK_KEYWORDS="Claude,任务完成,通知" # 可选
方式2:项目 .env 文件
# 在项目根目录创建 .env 文件
DINGTALK_WEBHOOK=https://oapi.dingtalk.com/robot/send?access_token=YOUR_ACCESS_TOKEN
DINGTALK_SECRET=YOUR_SECRET_KEY
DINGTALK_KEYWORDS=Claude,任务完成,通知
# 重启 Claude Code 以加载新的 MCP 配置
claude code restart
# 或者关闭 Claude Code 后重新打开
在 Claude Code 中运行以下命令测试:
# 测试基本连接
dingtalk_send_text {"content": "🎉 Claude Code 钉钉通知测试成功!"}
# 测试会话结束通知
dingtalk_notify_session_end {
"sessionType": "配置测试",
"summary": "成功配置了 Claude Code 钉钉通知功能"
}
Claude Code 会在以下位置查找 .mcp.json 配置:
./mcp.json 或 ./.mcp.json~/.claude/mcp.json~/.config/claude-code/mcp.jsonQ: 提示找不到 dingtalk_xxx 命令?
A: 检查 .mcp.json 配置是否正确,重启 Claude Code
Q: 钉钉通知发送失败?
A: 检查环境变量配置,确保 Webhook URL 和密钥正确
Q: 如何确认 MCP Server 是否运行?
A: 在 Claude Code 中输入 dingtalk_ 按 Tab 键,应该会显示可用命令
Q: 支持团队共享配置吗?
A: 是的,将 .mcp.json 提交到代码仓库即可团队共享
如果您已设置环境变量,MCP Server 将自动初始化,无需手动配置:
# 直接发送通知,无需配置步骤
dingtalk_notify_task_complete {
"taskName": "项目构建",
"status": "success",
"details": "构建成功,所有测试通过",
"duration": "2分30秒"
}
如果未设置环境变量,可以在 Claude Code 中手动配置:
dingtalk_configure {
"webhook": "https://oapi.dingtalk.com/robot/send?access_token=YOUR_ACCESS_TOKEN",
"secret": "YOUR_SECRET_KEY"
}
dingtalk_configure手动配置钉钉机器人设置
参数:
webhook (必需): 钉钉机器人 Webhook URLsecret (可选): 签名验证密钥keywords (可选): 安全关键字数组dingtalk_send_text发送文本消息
参数:
content (必需): 文本内容atAll (可选): 是否 @所有人,默认 falsedingtalk_send_markdown发送 Markdown 格式消息
参数:
title (必需): 消息标题text (必需): Markdown 格式文本内容atAll (可选): 是否 @所有人,默认 falsedingtalk_send_link发送链接消息
参数:
title (必需): 链接标题text (必需): 链接描述文本messageUrl (必需): 目标 URLpicUrl (可选): 图片 URLdingtalk_notify_session_end发送会话结束通知(新功能)
参数:
sessionType (可选): 会话类型,如 "开发协助"、"代码审查"、"问题解决",默认 "开发协助"duration (可选): 会话时长,如 "30分钟"、"1小时20分"mainTasks (可选): 主要任务列表summary (可选): 会话摘要,默认 "会话已完成"filesCount (可选): 修改/创建的文件数量,默认 0toolsUsed (可选): 使用的工具/命令数量,默认 0atAll (可选): 是否 @所有人,默认 false重要功能:每次 Claude Code 对话完成后,自动推送通知到钉钉群!
在 Claude Code 对话即将结束时,直接调用:
dingtalk_notify_session_end {
"sessionType": "开发协助",
"duration": "45分钟",
"mainTasks": ["实现钉钉MCP Server", "添加环境变量支持", "编写使用文档"],
"summary": "成功开发并部署了钉钉通知MCP Server,支持多种消息格式和自动会话通知",
"filesCount": 8,
"toolsUsed": 15
}
设置环境变量后,使用脚本自动触发:
# 设置会话信息
export CLAUDE_SESSION_TYPE="代码审查"
export CLAUDE_SESSION_DURATION="30分钟"
export CLAUDE_MAIN_TASKS="代码质量检查,安全漏洞扫描,性能优化建议"
export CLAUDE_SESSION_SUMMARY="完成了全面的代码审查,发现并修复了3个安全问题"
export CLAUDE_FILES_COUNT="5"
export CLAUDE_TOOLS_USED="12"
# 触发通知
npm run notify-session-end
安装钩子后,每次会话结束自动触发:
# 安装钩子
./claude-hook.sh install
# 钩子会在 Claude Code 会话结束时自动运行
# 无需手动操作!
dingtalk_notify_task_complete {
"taskName": "代码部署",
"status": "success",
"details": "✅ 部署到生产环境成功\
- 版本: v2.1.0\
- 测试: 100% 通过\
- 性能: 优化 15%",
"duration": "3分45秒"
}
dingtalk_send_markdown {
"title": "📊 每日构建报告",
"text": "## 📊 每日构建报告\
\
**日期**: 2025-01-15\
**状态**: ✅ 成功\
\
### 📈 统计数据\
- 构建次数: 12\
- 成功率: 100%\
- 平均耗时: 2分15秒\
\
### 🔧 修复问题\
- 修复了登录超时问题\
- 优化了数据库查询性能\
\
---\
*来自 Claude Code 自动化构建*"
}
dingtalk_send_text {
"content": "🎉 代码审查完成!所有检查项目都已通过,可以开始合并到主分支。",
"atAll": false
}
# Webhook URL 示例
https://oapi.dingtalk.com/robot/send?access_token=f248fa5a2e04cf0c13abb23831c4a6190f3837fa7ddf3338f759db5a67079469
# 签名密钥示例(加签验证)
SECad12bf23f1e2e3c3d7dae0cd58e41c2b4daa9d1066cdf7ce452c4732ecf0c30e
Q: 提示"DingTalk client not configured"
A: 请检查环境变量设置或使用 dingtalk_configure 手动配置
Q: 消息发送失败 A: 请检查:
Q: npm 安装失败 A: 请确保 Node.js 版本 ≥ 18.0.0
# 启用调试日志
DEBUG=dingtalk-mcp-server npx claude-code-dingtalk-mcp
# 克隆仓库
git clone https://github.com/claude-code-community/dingtalk-mcp-server.git
cd dingtalk-mcp-server
# 安装依赖
npm install
# 开发模式运行
npm run dev
# 构建项目
npm run build
# 测试
npm test
claude-code-dingtalk-mcp/
├── src/
│ ├── dingtalk.ts # 钉钉客户端封装
│ ├── index.ts # MCP Server 主程序
│ └── test.ts # 测试用例
├── dist/ # 编译输出
├── .env.example # 环境变量示例
├── LICENSE # MIT 许可证
├── README.md # 说明文档
└── package.json # 项目配置
MIT License - 详见 LICENSE 文件
让 Claude Code 的任务完成通知更加便捷! 🚀
Prerequisites
Time Estimate
15-60 minutes depending on server complexity
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
Compatibility
✓ Use when
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid when
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.