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 syncDINGTALK_GROUPS=... dingtalk-alert-mcp

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dingtalk_alert_mcp-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dingtalk_alert_mcp-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file dingtalk_alert_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: dingtalk_alert_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for dingtalk_alert_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fcedca6cf581cd9fb952a3ad5c1f93912987546d82a8b5bf63a47197122ef9be
MD5 5e2987934ee6b12aa8d2d6da8e258da8
BLAKE2b-256 d8818356c67f946f2b24c45afa1a8dc6e5792fce25844048071445894a0f04f6

See more details on using hashes here.

File details

Details for the file dingtalk_alert_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dingtalk_alert_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 170996832cf6b12f6ea55742ebfff552fb3c4b9f4b2db51418b2f97d5d67ece1
MD5 d17539174385d15ac0008d79ce7e4dc9
BLAKE2b-256 55c29cc3896a5be2725aee5611153f9b24f5046dbbb2e75e8bb5cdec7bab138c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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