# Netease Yunxin MCP

> Netease Yunxin / 网易云信 manages large-scale real-time chat and messaging infrastructure. Use it with your AI client to create IM accounts, manage user groups, send direct or bulk messages, and audit message histories—all without touching a dashboard. It handles complex communication tasks through simple conversational commands.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** instant-messaging, real-time-communication, rtc-api, chat-groups, user-account-management, message-auditing

## Description

This server connects your AI client directly to Netease Yunxin, one of China's massive real-time communication platforms. It gives your agent full operational control over chat infrastructure—you can manage user accounts, moderate groups, and audit message history without ever touching a dashboard or running manual commands. If your job involves automated support, managing large user bases, or tracking complex communications flow, this is what you need.

### Account Setup and Maintenance
Your agent handles the full lifecycle of an IM account. You can use `create_account` to spin up entirely new user identities from scratch. Once an account exists, you'll often need to make tweaks; that's where `update_account` comes in. It lets your client change details like a display name on an existing profile. Critically, connections expire, so you can use `refresh_user_token` to keep any IM account active and prevent connection failures due to token expiry.

### Group Creation and Moderation
Building teams is straightforward. You'll start by calling `create_team` to establish an entirely new chat group structure. Once the team exists, you control who's in it. Use `add_team_member` to bring a specific user into the existing group roster. When someone needs to be cut loose or leaves the project, you don't have to manually remove them; simply call `kick_team_member`. To see exactly who’s in the group and what its current rules are, your agent pulls all that data using `get_team_detail`.

### Sending Targeted Messages
Sending messages is done with precision. If you need to talk to one person privately—a direct chat—you use `send_p2p_message`. But if you're sending out an alert or a general announcement, you don't want to repeat the message hundreds of times. Instead, your client uses `send_batch_message`, which fires off the exact same content simultaneously to multiple users across different lists.

### Reviewing Communication History and Metadata
For auditing purposes, you have full access to chat logs. You can retrieve complete conversation histories between any two people by calling `get_session_history` over a specific time range. This is essential for compliance or debugging. Furthermore, when you need context about the groups themselves—the current member list, group settings, etc.—you pull all that structural data with `get_team_detail`. You're running a complete communications ops team through simple conversational commands. Your agent handles every step: setting up accounts, managing memberships, sending messages one-by-one or in bulk, and pulling detailed historical logs for review.

## Tools

### add_team_member
Adds a specific user to an existing chat team or group.

### create_account
Creates and initializes a new IM account for a user.

### create_team
Establishes an entirely new chat group or team structure.

### get_session_history
Retrieves and reads the full chat log between two users over a defined time range.

### get_team_detail
Pulls current metadata about an existing team, including its member list and settings.

### kick_team_member
Removes a specified user from a chat group or team.

### refresh_user_token
Updates an IM account's token to prevent connection failures due to expiry.

### send_batch_message
Sends the exact same message content to multiple users simultaneously.

### send_p2p_message
Delivers a direct, private message between two specified users.

### update_account
Changes specific details (like display name) for an existing IM account.

## Prompt Examples

**Prompt:** 
```
Create a new IM account with accid 'user_8821'.
```

**Response:** 
```
I've successfully created the IM account 'user_8821'. The account is now active and ready for real-time communication. Would you like to set a display name or custom token for this user?
```

**Prompt:** 
```
Send a message from 'admin' to 'user_8821' saying 'Welcome to the platform!'.
```

**Response:** 
```
Done! I've sent your P2P message to 'user_8821'. The message has been successfully delivered to the Yunxin IM system. Would you like to check the session history for this pair?
```

**Prompt:** 
```
Create a chat team 'Project Alpha' with owner 'admin' and members 'user_01,user_02'.
```

**Response:** 
```
I've created the chat team 'Project Alpha'. The Team ID (TID) is `12345678`. The owner and initial members have been added successfully. Should I send an invitation message to the group now?
```

## Capabilities

### Create User Accounts
The agent creates new IM accounts, managing the initial setup of user identities.

### Modify Account Details
You can update an existing account's details or refresh its security token to keep it active.

### Build and Manage Groups
The agent creates multi-user teams, adding members and removing users as needed for moderation.

### Send Targeted Messages
It sends private one-on-one messages or executes bulk messaging to entire user lists.

### Review Communication History
You retrieve complete chat logs and group metadata for auditing purposes over specific time ranges.

## Use Cases

### New Employee Onboarding
An HR manager needs to get a new hire, 'jane', set up in the system. They ask their agent: 'Create IM account for jane and add her to the #marketing team.' The agent runs `create_account` then `add_team_member`, completing the process in two steps.

### Crisis Communications
A company needs to send an urgent service update to 50,000 subscribers. Instead of logging into a separate broadcast system, they instruct their agent to run `send_batch_message` using the target list.

### Investigating User Behavior
A support team needs to check if a user complained about a specific feature last month. They ask their agent to use `get_session_history`, providing the user's ID and the date range, and the logs are returned immediately.

### Team Restructuring
The project scope changes, and 'user_x' needs to move from the 'Alpha' team to the 'Beta' team. The agent runs `kick_team_member` for Alpha and then `add_team_member` for Beta.

## Benefits

- Stop manually tracking group rosters. Use `get_team_detail` to instantly pull a team's current membership list, which is better than checking the UI tab by tab.
- Handle mass communication without writing scripts. Just tell your agent to 'send an alert to all marketing users,' and it runs `send_batch_message` for you.
- Eliminate account setup friction. Instead of a developer running a separate registration script, just ask your agent to `create_account`, and the user is ready to go.
- Audit conversations in seconds. Need to know what was said last week? Running `get_session_history` pulls complete logs between any two users based on dates you provide.
- Maintain connection integrity automatically. Use `refresh_user_token` so your agent doesn't fail mid-task because a user token expired overnight.

## How It Works

The bottom line is you're letting your AI client execute complex, multi-step communication operations through simple conversation.

1. Subscribe to the server, then provide your Yunxin AppKey and AppSecret credentials.
2. Point your AI client (Claude, Cursor, etc.) at the configured MCP endpoint.
3. Ask your agent a natural language prompt—e.g., 'Add user X to team Y and send them a welcome message.' — and watch it run the necessary tools.

## Frequently Asked Questions

**How do I check chat history using get_session_history?**
You provide the agent with two user IDs and a specific date range. The agent runs `get_session_history` and returns all messages exchanged between those users within that time window.

**What is the difference between send_p2p_message and send_batch_message?**
Use `send_p2p_message` for a one-to-one private chat. Use `send_batch_message` when you need to send the exact same message content out to many different users at once.

**How do I manage team members using add_team_member?**
You ask your agent to run `add_team_member`, specifying the target team ID and the user's unique account ID. The agent handles the join action for you.

**Does update_account handle all profile changes?**
It updates specific details on an existing IM account, like changing the display name or updating core credentials, keeping your user data current without recreating the whole account.

**If my user token expires, how does the `refresh_user_token` tool help me maintain connectivity?**
The `refresh_user_token` tool automatically retrieves and updates your IM access credentials. It validates your existing connection without requiring you to re-authenticate or manually input new security keys. This keeps your agent connected and ready for real-time chat operations.

**What are the necessary parameters required when I use `create_account`?**
You must provide a unique account ID (accid) and establish initial login credentials. The tool will prompt you to confirm if you need to set up any default display names or custom tokens immediately after creation. This ensures the account is fully operational right out of the gate.

**When I run into rate limits with `send_batch_message`, what should my agent do?**
If batch messaging fails due to volume, your agent should break the target list into smaller chunks and retry sending messages. The API is designed to handle bulk operations but requires controlled pacing for high-volume sends. Sending in batches of 50 is usually a good starting point.

**Does `kick_team_member` automatically notify the user that they have been removed from the team?**
The tool performs the removal action immediately, but it does not send an automated notification message. If you need to inform a kicked member, your agent must follow up with a separate P2P or broadcast message after running `kick_team_member`.

**How do I find my Yunxin AppKey and AppSecret?**
Log in to the [Yunxin Console](https://console.yunxin.163.com/), select your application from the dashboard, and you will find your AppKey and AppSecret in the application details overview.

**What is an accid?**
An accid is a unique account identifier for a user in the Yunxin IM system. It is defined by you during account creation and used for all subsequent user-related operations.

**How does the CheckSum authentication work?**
Yunxin requires a dynamic CheckSum in the HTTP header for every request. This server automatically calculates it for you using the SHA1(AppSecret + Nonce + CurTime) formula, ensuring secure authorized access.