Skip to main content

dingtalk-alert-mcp-py

钉钉群机器人告警 MCP Server,复刻 base_server DingTalkUtils 的钉钉机器人协议(OapiRobot + HmacSHA256 签名)。

特性

  • 多群配置(DINGTALK_GROUPS 环境变量)
  • 文本消息发送 + 可选 @指定手机号
  • 加签模式(webhook + secret → HmacSHA256 签名,与 DingTalkUtils.getDrainageServerUrl 算法一致)

配置

export DINGTALK_GROUPS='{
  "中台群": {"webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxx", "secret": "SECxxx"},
  "监控群": {"webhook": "https://oapi.dingtalk.com/robot/send?access_token=yyy", "secret": "SECyyy"}
}'

工具

工具 说明
list_groups 列出已配置群(不含敏感信息)
send_message(content, group?, at_phones?) 发送文本消息到指定群或默认群

开发

uv sync
python3 -m unittest discover tests

接入 Claude Code

在 ~/.mcp.json 注册:

{
  "mcpServers": {
    "dingtalk-alert": {
      "command": "uvx",
      "args": ["--from", "git+https://.../dingtalk-alert-mcp-py", "dingtalk-alert-mcp"],
      "env": {
        "DINGTALK_GROUPS": "{\"中台群\": {\"webhook\": \"...\", \"secret\": \"...\"}}"
      }
    }
  }
}

(或本地安装:uv sync 后 DINGTALK_GROUPS=... dingtalk-alert-mcp)

Metadata

Release files for dingtalk-alert-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dingtalk-alert-mcp 0.1.0
File Size Uploaded
dingtalk_alert_mcp-0.1.0.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dingtalk-alert-mcp 0.1.0
File Interpreter ABI Platform
dingtalk_alert_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / dingtalk_alert_mcp-0.1.0.tar.gz

Download URL dingtalk_alert_mcp-0.1.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fcedca6cf581cd9fb952a3ad5c1f93912987546d82a8b5bf63a47197122ef9be
BLAKE2b-256 checksum
How to use checksums
d8818356c67f946f2b24c45afa1a8dc6e5792fce25844048071445894a0f04f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release files / dingtalk_alert_mcp-0.1.0-py3-none-any.whl

Download URL dingtalk_alert_mcp-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
170996832cf6b12f6ea55742ebfff552fb3c4b9f4b2db51418b2f97d5d67ece1
BLAKE2b-256 checksum
How to use checksums
55c29cc3896a5be2725aee5611153f9b24f5046dbbb2e75e8bb5cdec7bab138c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page