Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DingTalk MCP Server

基于 Model Context Protocol (MCP) 的钉钉消息发送服务器。

✨ 特性

  • ✅ Discovery 模式自动发现工具
  • ✅ .env 配置支持
  • ✅ 支持多种消息类型:文本、Markdown、链接、ActionCard、FeedCard
  • ✅ 支持加签验证

环境要求

  • PHP 8.2+
  • Composer

安装

composer install

🔧 配置

复制 .env.example.env 并填写配置:

DINGTALK_TOKEN=your_access_token_here
DINGTALK_SECRET=your_secret_here

或使用环境变量:

export DINGTALK_TOKEN="your_access_token_here"
export DINGTALK_SECRET="your_secret_here"

🚀 使用

测试

npx @modelcontextprotocol/inspector php server.php

在 MCP 客户端中使用

{
  "mcpServers": {
    "dingtalk": {
      "command": "php",
      "args": ["/path/to/dingtalk-mcp/server.php"]
    }
  }
}

📦 可用工具

  1. dingtalk_send_text - 发送文本消息
  2. dingtalk_send_markdown - 发送 Markdown 消息
  3. dingtalk_send_link - 发送链接消息
  4. dingtalk_send_action_card - 发送 ActionCard 消息
  5. dingtalk_send_feed_card - 发送 FeedCard 图文消息

📚 相关文档

🔒 安全建议

  1. 不要提交 .env 文件到版本控制
  2. 生产环境建议配置 DINGTALK_SECRET
  3. 定期更换密钥

🐛 调试

查看 mcp.log 日志文件获取详细错误信息。

📄 License

MIT License

About

基于 Model Context Protocol (MCP) 的钉钉消息发送服务器。

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages