Dingtalk

Provides automated DingTalk group notifications for Claude Code tasks and sessions via an MCP server.
  • javascript

6

GitHub Stars

javascript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "sfyyy-claude-code-dingtalk-mcp": {
      "command": "dingtalk-mcp-server",
      "args": [],
      "env": {
        "DINGTALK_SECRET": "YOUR_SECRET_PLACEHOLDER",
        "DINGTALK_WEBHOOK": "YOUR_WEBHOOK_PLACEHOLDER",
        "DINGTALK_KEYWORDS": "Claude,任务完成,通知"
      }
    }
  }
}

You set up a dedicated MCP Server that bridges Claude Code with DingTalk群机器人 notifications. It enables automated task and session end alerts via DingTalk, supports multiple message formats, and validates requests securely. This guide shows you how to install, configure, and use the MCP Server to send notifications at the end of conversations and for routine task updates.

How to use

Install the server globally or locally, configure your DingTalk robot, then start the MCP Server and connect it to Claude Code. You can trigger notifications for individual tasks as well as automatic session-end alerts after each conversation. Use the provided commands to test connectivity and to send example messages in your DingTalk group.

How to install

# Prerequisites
- Node.js v18+ installed

# Option A: Global install (recommended)
npm install -g claude-code-dingtalk-mcp

# Option B: Local install (project-level)
npm install claude-code-dingtalk-mcp

# Option C: Run without install (npx)
npx claude-code-dingtalk-mcp
# If Claude Code supports the MCP Manager, you can also add the server via MCP manager
claude mcp add dingtalk-mcp dingtalk-mcp-server

Create or update the MCP configuration file in your project root as a JSON block to register the server under Claude Code's MCP system.

Configuration and usage details

{"mcpServers": {"dingtalk-notifications": {"command": "dingtalk-mcp-server"}}}
# Basic environment variables you need to configure the DingTalk integration
export DINGTALK_WEBHOOK="https://oapi.dingtalk.com/robot/send?access_token=YOUR_TOKEN"
export DINGTALK_SECRET="YOUR_SECRET"
# Example to test a basic text notification after a conversation ends
# This depends on Claude Code calling the respective MCP command
# The actual invocation is shown in the tool usage section below
{
  "mcpServers": {
    "dingtalk-notifications": {
      "command": "dingtalk-mcp-server",
      "description": "钉钉通知服务器"
    }
  }
}
# Restart Claude Code to load new MCP config (exact command may vary by installation)
claude code restart
# Test commands you will run inside Claude Code to verify connectivity
# 1) Basic text message
# dingtalk_send_text { "content": "🎉 Claude Code 钉钉通知测试成功!" }
# 2) Session end notification
# dingtalk_notify_session_end { "sessionType": "开发协助", "duration": "45分钟" }

安全与环境变量

Configure environment variables for secure and reliable notifications. Prefer signed requests and restrict access as needed. You can optionally specify keywords to help validate incoming messages.

export DINGTALK_WEBHOOK="https://oapi.dingtalk.com/robot/send?access_token=YOUR_ACCESS_TOKEN"
export DINGTALK_SECRET="YOUR_SECRET_KEY"
export DINGTALK_KEYWORDS="Claude,任务完成,通知"  # 可选
DINGTALK_WEBHOOK=https://oapi.dingtalk.com/robot/send?access_token=YOUR_ACCESS_TOKEN
DINGTALK_SECRET=YOUR_SECRET_KEY
DINGTALK_KEYWORDS=Claude,任务完成,通知

常见操作与示例

# 发送简单文本消息的示例
# dingtalk_send_text { "content": "🎉 代码审查完成!所有检查通过" }

# 发送会话结束通知示例
# dingtalk_notify_session_end { "sessionType": "开发协助", "duration": "45分钟", "summary": "完成全部任务" }
{
  "taskName": "代码部署",
  "status": "success",
  "details": "✅ 部署到生产环境成功\\n- 版本: v2.1.0",
  "duration": "3分45秒"
}
{
  "title": "📊 每日构建报告",
  "text": "## 日志\n- 构建通过\n- 测试通过",
  "atAll": false
}

可用工具与端点

以下工具可在 Claude Code 中直接调用,用于发送不同类型的 DingTalk 通知和管理配置。每个工具都提供了必填项和可选项的说明。

  • dingtalk_configure:手动配置钉钉机器人设置
  • dingtalk_send_text:发送文本消息
  • dingtalk_send_markdown:发送 Markdown 消息
  • dingtalk_send_link:发送链接消息
  • dingtalk_notify_session_end:发送会话结束通知(新功能)

常见问题与故障排查

若遇到问题,请先检查环境变量是否正确设置、Webhook URL 是否有效,以及签名密钥是否匹配。若消息发送频率受限,请确认是否超过了每分钟的发送上限。若找不到命令,请确保 MCP 配置已正确加载并重启 Claude Code。

开发与贡献提示

若你需要在本地开发、测试或贡献,请按以下步骤进行:克隆仓库、安装依赖、运行开发模式、构建与测试。你还可以查看项目结构以了解各文件的职责。

Available tools

dingtalk_configure

Manually configure the DingTalk robot settings including webhook, secret, and optional keywords.

dingtalk_send_text

Send a plain text message to the configured DingTalk webhook.

dingtalk_send_markdown

Send a Markdown-formatted message with a title and content to DingTalk.

dingtalk_send_link

Send a link message with a title, text, and target URL to DingTalk.

dingtalk_notify_session_end

Send a formatted session end notification including session type, duration, main tasks, and summary.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational