Content
# DingTalk MCP Service
This is a DingTalk service based on MCP (Model Control Protocol) that provides access to the DingTalk API.
## Features
1. Obtain DingTalk Access Token
2. Retrieve department list
3. Get user list of a department
4. Query user details by name (including searching through departments)
## Environment Requirements
- Python 3.12+
- Docker (recommended)
- DingTalk application credentials
## Installation and Configuration
### 1. Obtain DingTalk Application Credentials
1. Log in to the [DingTalk Open Platform](https://open.dingtalk.com/)
2. Create an internal enterprise application
3. Obtain the application's AppKey and AppSecret
### 2. Configure Environment Variables
You need to set the following environment variables:
```bash
DINGDING_APP_KEY=yourAppKey
DINGDING_APP_SECRET=yourAppSecret
```
## Usage
### Using in Claude Desktop Client
1. Add the following configuration to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"dingding": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "DINGDING_APP_KEY=yourAppKey",
"-e", "DINGDING_APP_SECRET=yourAppSecret",
"ghcr.io/yourUsername/dingding-mcp:latest"
]
}
}
}
```
### Local Development
1. Clone the repository:
```bash
git clone <repository_url>
cd dingding_chat
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Run the service:
```bash
python src/server.py
```
### Docker Deployment
1. Pull the image:
```bash
docker pull ghcr.io/yourUsername/dingding-mcp:latest
```
2. Run the container:
```bash
docker run -d --name dingding-mcp \
-e DINGDING_APP_KEY=yourAppKey \
-e DINGDING_APP_SECRET=yourAppSecret \
ghcr.io/yourUsername/dingding-mcp:latest
```
## API Description
### 1. Obtain Access Token
- Function: Get the access token for the DingTalk API
- Tool Name: `get_access_token`
- Parameters: None
- Returns: Access token string
### 2. Retrieve Department List
- Function: Get the list of departments in the enterprise
- Tool Name: `get_department_list`
- Parameters:
- fetch_child: Whether to fetch the child department list (optional, default is true)
- Returns: Department list information (including department ID, name, parent department ID, etc.)
### 3. Get User List of a Department
- Function: Get the user list of a specified department
- Tool Name: `get_department_users`
- Parameters:
- department_id: Department ID (required)
- Returns: User list of the department (including user ID, name, etc.)
### 4. Query User by Name
- Function: Query user details by user name
- Tool Name: `search_user_by_name`
- Parameters:
- name: User name
- Returns: User details (including user ID, name, phone, email, position, department, etc.)
## Notes
1. Ensure that the DingTalk application credential information is configured correctly.
2. Due to DingTalk API limitations, querying user information requires traversing all departments, which may take some time.
3. It is recommended to use Docker deployment in production environments to ensure environment consistency.
## License
MIT License
Connection Info
You Might Also Like
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
Appwrite
Build like a team of hundreds