YU

Yunxin MCP Server for IM/RTC/DATA Open-API Integration

Integrate an MCP server with Yunxin's IM, RTC, and DATA Open-API to enable real-time messaging, calls, and data syncing.

Quick Install
npx -y @netease-im/yunxin-mcp-server

Overview

The Yunxin MCP Server is a lightweight bridge that connects external AI or backend services with Yunxin’s IM, RTC, and DATA Open-API surfaces using the Model Context Protocol (MCP). It acts as a middle-tier service that receives model-generated intents or events (chat messages, call actions, data updates), interprets them, and calls Yunxin Open-APIs to deliver real-time messaging, manage audio/video sessions, or sync application data across clients.

This server is useful when you want to combine large language models, bots, or other automated systems with Yunxin’s real-time capabilities without exposing credentials or implementing protocol handling inside the model runtime. The MCP server normalizes incoming model context messages, performs authentication and retries for Yunxin APIs, and provides webhook/callback endpoints for bidirectional integration.

Features

  • Bridge between MCP-compliant model output and Yunxin IM/RTC/DATA Open-APIs
  • Authenticated, configurable calls to Yunxin services (IM messages, RTC signaling, DATA sync)
  • Webhook endpoints to accept model context and/or Yunxin callbacks
  • Simple configuration via environment variables or config file
  • Deployable as a container or run from source
  • Extensible routing for custom actions and business logic
  • Logging and basic error handling for API interactions

Installation / Configuration

Below are common installation and configuration patterns. Adjust values for your environment and follow Yunxin’s official docs to obtain API credentials.

Clone the repository:

git clone https://github.com/netease-im/yunxin-mcp-server.git
cd yunxin-mcp-server

Run locally (example using Node.js/npm — the repo can be built/run similarly if implemented in another runtime):

# install dependencies
npm install

# run with environment variables
export YUNXIN_APP_KEY="your_app_key"
export YUNXIN_APP_SECRET="your_app_secret"
export MCP_SECRET="mcp_shared_secret"
export MODEL_ENDPOINT="https://your-model-endpoint.example.com"
export PORT=8080

npm start

Docker (recommended for production):

docker build -t yunxin-mcp-server:latest .
docker run -d \
  -e YUNXIN_APP_KEY=your_app_key \
  -e YUNXIN_APP_SECRET=your_app_secret \
  -e MCP_SECRET=mcp_shared_secret \
  -e MODEL_ENDPOINT=https://your-model-endpoint.example.com \
  -p 8080:8080 \
  --name yunxin-mcp-server \
  yunxin-mcp-server:latest

Example configuration file (config.yml):

server:
  port: 8080
yunxin:
  appKey: "your_app_key"
  appSecret: "your_app_secret"
mcp:
  secret: "mcp_shared_secret"
model:
  endpoint: "https://your-model-endpoint.example.com"
logging:
  level: info

Common environment variables:

  • YUNXIN_APP_KEY — Yunxin application key
  • YUNXIN_APP_SECRET — Yunxin application secret
  • MCP_SECRET — shared secret to validate MCP messages
  • MODEL_ENDPOINT — optional URL for model callbacks or context fetching
  • PORT — HTTP port for the MCP server

Available Resources

  • Source repository: https://github.com/netease-im/yunxin-mcp-server
  • Yunxin Open-API documentation: consult your Yunxin account or vendor docs for up-to-date IM/RTC/DATA API reference and authentication guidelines
  • Example config and Dockerfile in the repo for quick deployment
  • Webhook/Curl examples in the repo demonstrating IM message forwarding and RTC signaling

Use Cases

  1. Chatbot in IM

    • A hosted LLM generates reply payloads and sends them to the MCP endpoint.
    • The MCP server validates and converts the payload to Yunxin IM send-message calls.
    • Example flow (model → MCP → Yunxin IM):
      curl -X POST https://mcp.example.com/mcp/message \
        -H "Authorization: Bearer <MCP_SECRET>" \
        -H "Content-Type: application/json" \
        -d '{"to":"user123","type":"text","content":"Hello from the bot"}'
      
  2. Automated call orchestration (RTC)

    • A service triggers a voice/video call via the MCP server when a user requests human assistance.
    • MCP translates the request into Yunxin RTC signaling and sends push notifications or SDP offers as required.
      curl -X POST https://mcp.example.com/mcp/call \
        -H "Authorization: Bearer <MCP_SECRET>" \
        -d '{"callee":"user123","media":"video","action":"invite"}'
      
  3. Data synchronization across devices (DATA)

    • When a model decides to update user session state or shared documents, it posts updates to MCP.
    • MCP writes the update to Yunxin DATA API so all connected clients receive consistent state.
      curl -X POST https://mcp.example.com/mcp/data \
        -H "Authorization: Bearer <MCP_SECRET>" \
        -d '{"collection":"sessions","key":"session123","value":{"status":"active"}}'
      
  4. Moderation and compliance