The DingTalk MCP Server V2 is a Model Control Protocol implementation that allows integration with DingTalk robots. It provides functionality for sending messages, retrieving conversation information, user details, and calendar events through DingTalk's platform.
Before using the server, you need to set the following environment variables:
DINGTALK_APP_KEY
: Your DingTalk application's AppKeyDINGTALK_APP_SECRET
: Your DingTalk application's AppSecretAdd the following configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"dingding": {
"command": "sh",
"args": [
"-c",
"docker ps -a | grep mcp-dingding-v2 | awk '{print $1}' | xargs -r docker rm -f > /dev/null 2>&1; docker pull ghcr.io/wllcnm/mcp-dingding-v2:latest > /dev/null 2>&1; docker run -i --rm --name mcp-dingding-v2 -e DINGTALK_APP_KEY=your_AppKey -e DINGTALK_APP_SECRET=your_AppSecret ghcr.io/wllcnm/mcp-dingding-v2:latest"
]
}
}
}
your_AppKey
and your_AppSecret
in the configuration with your actual DingTalk credentialsNote: The startup command will:
pip install -r requirements.txt
Run the server directly:
python src/server.py
Run using Docker:
# Clean up old containers
docker ps -a | grep mcp-dingding-v2 | awk '{print $1}' | xargs -r docker rm -f
# Build and run new container
docker build -t dingding-mcp-v2 .
docker run -i --rm --name mcp-dingding-v2 \
-e DINGTALK_APP_KEY=your_app_key \
-e DINGTALK_APP_SECRET=your_app_secret \
dingding-mcp-v2
Sends a message to a DingTalk conversation.
Parameters:
conversation_id
: The conversation IDmessage
: Message contentmsg_type
: Message type (optional, defaults to "text")Retrieves information about a DingTalk conversation.
Parameters:
conversation_id
: The conversation IDRetrieves information about a DingTalk user.
Parameters:
user_id
: The user IDQueries a user's calendar events.
Parameters:
userid
: User ID (required)start_time
: Start timestamp in milliseconds (optional)end_time
: End timestamp in milliseconds (optional)max_results
: Maximum number of results (optional, defaults to 50)next_token
: Pagination token (optional)Returns:
In Claude, you can use the tools as follows:
{
"tool": "send_message",
"arguments": {
"conversation_id": "your_conversation_id",
"message": "Hello, DingTalk!",
"msg_type": "text"
}
}
{
"tool": "get_calendar_list",
"arguments": {
"userid": "user_id",
"start_time": 1704067200000, // 2024-01-01 00:00:00
"end_time": 1704153600000, // 2024-01-02 00:00:00
"max_results": 10
}
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "dingding" '{"command":"sh","args":["-c","docker ps -a | grep mcp-dingding-v2 | awk '{print $1}' | xargs -r docker rm -f > /dev/null 2>&1; docker pull ghcr.io/wllcnm/mcp-dingding-v2:latest > /dev/null 2>&1; docker run -i --rm --name mcp-dingding-v2 -e DINGTALK_APP_KEY=\u4f60\u7684AppKey -e DINGTALK_APP_SECRET=\u4f60\u7684AppSecret ghcr.io/wllcnm/mcp-dingding-v2:latest"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"dingding": {
"command": "sh",
"args": [
"-c",
"docker ps -a | grep mcp-dingding-v2 | awk '{print $1}' | xargs -r docker rm -f > /dev/null 2>&1; docker pull ghcr.io/wllcnm/mcp-dingding-v2:latest > /dev/null 2>&1; docker run -i --rm --name mcp-dingding-v2 -e DINGTALK_APP_KEY=\u4f60\u7684AppKey -e DINGTALK_APP_SECRET=\u4f60\u7684AppSecret ghcr.io/wllcnm/mcp-dingding-v2:latest"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"dingding": {
"command": "sh",
"args": [
"-c",
"docker ps -a | grep mcp-dingding-v2 | awk '{print $1}' | xargs -r docker rm -f > /dev/null 2>&1; docker pull ghcr.io/wllcnm/mcp-dingding-v2:latest > /dev/null 2>&1; docker run -i --rm --name mcp-dingding-v2 -e DINGTALK_APP_KEY=\u4f60\u7684AppKey -e DINGTALK_APP_SECRET=\u4f60\u7684AppSecret ghcr.io/wllcnm/mcp-dingding-v2:latest"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect