MCPcopy
hub / github.com/WuKongIM/WuKongIM

github.com/WuKongIM/WuKongIM @v2.2.5-20260422 sqlite

repository ↗ · DeepWiki ↗ · release v2.2.5-20260422 ↗
6,809 symbols 24,567 edges 583 files 2,205 documented · 32%
README

WuKongIM (Making Communication Simpler)

A high-performance universal communication service, refined over 10 years (2015-2025). Supports instant messaging, in-app/system notifications, messaging middleware, IoT communication, audio/video signaling, live streaming comments, customer service systems, AI communication, instant communities, and more.

This project requires Go 1.20.0 or higher to compile

Windows is no longer supported

Key Features of Distributed IM: Automatic failover, decentralized design, data redundancy between nodes, fast auto-scaling, proxy node mechanism

Technical Highlights: Custom protocol, Distributed Raft (modified pull mode), Multi-group Raft (modified pull mode), Relational database internals, Distributed database design, Reactors architecture, Innovative multi-layer distributed leadership mechanism, and more

中文

Architecture

Architecture

Cluster Architecture

Video Demonstrations

Failover Demo AI Demo
Failover AI + Streaming

Live Demo

Chat Demo

Web chat demo: http://imdemo.githubim.com

Backend monitoring demo: http://monitor.githubim.com/web

Stress test report: https://githubim.com/server/advance/stressSingleReport.html

Highlights

The only decentralized distributed IM in open source

The only IM capable of 200,000+ concurrent sends on a single machine in open source

The only IM with built-in self-developed distributed storage in open source

The only distributed IM that doesn't depend on any middleware in open source

Features

🎦 Uniqueness

No limit on group members, easily supports 100,000-member group chats, messages can be stored permanently.

📚 Low Resource Consumption

Self-developed binary protocol, heartbeat packets are only 1 byte, saves bandwidth and battery, faster transmission.

🔐 Security

End-to-end encryption for message channels and content, prevents man-in-the-middle attacks and message tampering, real-time server data backup, no data loss.

🚀 Performance

Built on PebbleDB KV database, we developed a specialized distributed database for IM services, eliminating performance overhead from generic databases. Fast storage means fast messaging.

🔥 High Availability

Modified Raft distributed protocol enables automatic disaster recovery - when one machine goes down, another automatically takes over, seamless to users.

Decentralized, no single point of failure, no central node, every node is independent and equal, all can provide service.

Easy scaling, just add machines, no downtime needed, no data migration required, automatic data distribution by policy.

0⃣️ Ease of Use

No dependency on any third-party middleware, simple deployment, start with a single command.

Channel-based publish/subscribe design philosophy, easy to understand, easy to get started.

Simple like Redis, high-performance like Kafka, reliable like MySQL

🌲 Technical Support

Official team provides technical support, documentation, community discussion groups, and issue feedback.

Feature List

  • [x] Custom message support
  • [x] Subscribe/Publish pattern support
  • [x] Personal/Group/Customer Service/Community channels
  • [x] Channel blacklist support
  • [x] Channel whitelist support
  • [x] Permanent message roaming, no message loss when switching devices
  • [x] Online status, multi-device online for same account
  • [x] Real-time message sync across devices
  • [x] Server-maintained recent conversation list
  • [x] Command messages support
  • [x] Offline command interface
  • [x] Webhook support for easy business system integration
  • [x] Datasource support for seamless business data integration
  • [x] WebSocket connection support
  • [x] TLS 1.3 support
  • [x] Proxy protocol support
  • [x] JSON protocol communication
  • [x] Prometheus monitoring support
  • [x] Monitoring system development
  • [x] Streaming messages (like ChatGPT output stream)
  • [x] Distributed support
    • [x] Decentralized design, cluster auto-repairs when any node goes down
    • [x] Data redundancy between cluster nodes, any node damage doesn't affect data integrity
    • [x] Fast automatic cluster scaling

Quick Start


git clone https://github.com/WuKongIM/WuKongIM.git

cd WuKongIM/docker/cluster

sudo docker compose up -d

Admin panel: http://127.0.0.1:15300/web

Chat demo: http://127.0.0.1:15172/login

Development

Standalone



go run main.go

(or go run main.go --config config/wk.yaml)

Distributed


# Start first node
go run main.go --config  ./exampleconfig/cluster1.yaml

# Start second node
go run main.go --config  ./exampleconfig/cluster2.yaml

# Start third node
go run main.go --config  ./exampleconfig/cluster3.yaml

Access

Admin panel: http://127.0.0.1:5300/web

Chat demo: http://127.0.0.1:5172/chatdemo

Client Usage

import { WKIM, WKIMChannelType, WKIMEvent } from 'easyjssdk';

// 1. Initialize
const im = WKIM.init("ws://your-wukongim-server.com:5200", {
    uid: "your_user_id", // Current user's uid
    token: "your_auth_token" // Auth token (optional if auth is disabled)
});

// 2. Listen
im.on(WKIMEvent.Connect, () => {
    console.log("IM Connected!");
    // Send message
    const result = await im.send("target user",WKIMChannelType.Person,{ type: "text", content: "Hello from EasyJSSDK!" })
});

// Listen for incoming messages
im.on(WKIMEvent.Message, (message) => {
    console.log("Received:", message);
});

// Listen for errors
im.on(WKIMEvent.Error, (error) => {
    console.error("IM Error:", error);
});

// 3. Connect
await im.connect()




Production Deployment

Please refer to the Deployment Guide

SDKs and Demos

Project Github Example Docs Description
WuKongIM Github N/A Docs      WuKongIM server, handles connections and message delivery
WuKongIMAndroidSDK Github Example Docs WuKongIM Android SDK
WuKongIMiOSSDK Github Example Docs WuKongIM iOS SDK
WuKongIMUniappSDK Github Example Docs WuKongIM Uniapp SDK
WuKongIMJSSDK Github Example Docs WuKongIM JS SDK
WuKongIMFlutterSDK Github Example Docs WuKongIM Flutter SDK
WuKongIMReactNativeDemo Github N/A N/A WuKongIM React Native Demo (contributed by wengqianshan)
WuKongIMHarmonyOSSDK Github Example Docs WuKongIM HarmonyOS SDK

Node Failover Demo

Node Failover Demo

Screenshots

Star

Our team has been dedicated to instant messaging development. We need your encouragement! If you find this project helpful, please give us a star. Your support is our greatest motivation.

Case Study

Project Name

TangSengDaoDao

Open Source

https://github.com/TangSengDaoDao/TangSengDaoDaoServer

Screenshots

Contact

WeChat ID: wukongimgo (mention you want to join the group)

image

License

WuKongIM is licensed under the Apache License 2.0.

Extension points exported contracts — how you extend this code

ControlPacket (Interface)
controlPacket MQTT control packet codec interface [10 implementers]
pkg/mqtt/controlPacket.go
UserEventHandler (Interface)
用户事件处理者 [7 implementers]
internal/eventbus/event.go
Protocol (Interface)
(no doc) [10 implementers]
pkg/wkserver/proto/protocol.go
Transport (Interface)
(no doc) [15 implementers]
pkg/raft/raft/transport.go
Channel (Interface)
(no doc) [4 implementers]
pkg/cluster/icluster/channel.go
ISystemMetrics (Interface)
SystemMetrics 系统监控 [1 implementers]
pkg/trace/metrics.go
TotalDB (Interface)
type SessionDB interface { // AddOrUpdateSession 添加或更新session AddOrUpdateSession(session Session) (Session, error) // [1 …
pkg/wkdb/db.go
Log (Interface)
Log Log [1 implementers]
pkg/wklog/logger.go

Core symbols most depended-on inside this repo

Error
called by 1721
pkg/wklog/logger.go
String
called by 408
internal/types/tag.go
ResponseError
called by 386
pkg/wkhttp/http.go
Equal
called by 350
pkg/cluster/node/types/config.go
Equal
called by 346
pkg/wkdb/model.go
Close
called by 343
pkg/wkdb/db.go
Add
called by 310
pkg/raft/track/track.go
Unlock
called by 224
pkg/raft/raftgroup/raft.go

Shape

Method 4,235
Function 1,767
Struct 587
TypeAlias 78
Interface 68
Class 42
FuncType 32

Languages

Go97%
TypeScript3%

Modules by API surface

internal/types/pluginproto/plugin.pb.go316 symbols
pkg/trace/metrics.go247 symbols
pkg/wkdb/db.go153 symbols
pkg/wknet/conn.go138 symbols
pkg/trace/metrics_db.go132 symbols
internal/options/options.go131 symbols
pkg/cluster/cluster/model.go128 symbols
internal/api/connz.go108 symbols
pkg/cluster/node/types/config.pb.go103 symbols
pkg/wkdb/key/key.go95 symbols
pkg/raft/raft/node_step_test.go67 symbols
pkg/jsonrpc/types.go65 symbols

Dependencies from manifests, versioned

cloud.google.com/gov0.115.1 · 1×
cloud.google.com/go/auth/oauth2adaptv0.2.4 · 1×
cloud.google.com/go/compute/metadatav0.5.0 · 1×
cloud.google.com/go/pubsubv1.42.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/azcorev1.13.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/azidentityv1.7.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/internalv1.10.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5v5.7.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4v4.3.0 · 1×
github.com/AzureAD/microsoft-authentication-library-for-gov1.2.2 · 1×

For agents

$ claude mcp add WuKongIM \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact