MCPcopy Index your code
hub / github.com/ceociocto/im-hub

github.com/ceociocto/im-hub @v0.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.4 ↗ · + Follow
190 symbols 347 edges 22 files 17 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

bot-hub

Universal messenger-to-agent bridge — connect WeChat/Feishu/Telegram to Claude Code/Codex/Copilot/OpenCode.

npm install -g bot-hub
bot-hub config wechat   # Scan QR to login
bot-hub start           # Start the bridge

Features

  • Universal multiplexer — one instance, multiple messengers, multiple agents
  • Plugin architecture — easy to add new messengers/agents
  • TypeScript native — no Go/Docker required
  • JSONL streaming — real-time agent responses

Installation

# Install globally
npm install -g bot-hub

Quick Start

# 1. Configure WeChat
bot-hub config wechat
# Scan the QR code with WeChat

# 2. Configure Claude Code (optional, auto-detected)
bot-hub config claude

# 3. Start the bridge
bot-hub start

Commands

bot-hub                 # Same as 'start'
bot-hub start           # Start the bridge
bot-hub config wechat   # Configure WeChat
bot-hub config claude   # Configure Claude Code
bot-hub agents          # List available agents
bot-hub messengers      # List available messengers
bot-hub help

Chat Commands

Send these as messages to the bot:

hello                  # Send to default agent
/status                # Show connection status
/help                  # Show available commands
/agents                # List available agents
/cc explain this code  # Switch to Claude Code
/cx explain this code  # Switch to Codex
/co explain this code  # Switch to Copilot
/oc explain this code  # Switch to OpenCode

Architecture

┌─────────────────────────────────────────────────────────────┐
│                        bot-hub core                         │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │ Plugin      │  │ Message     │  │ Session Manager     │  │
│  │ Registry    │  │ Router      │  │ (per conversation)  │  │
│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
└─────────────────────────────────────────────────────────────┘
         │                        │
         ▼                        ▼
┌─────────────────┐      ┌─────────────────┐
│ Messenger Plugins│      │  Agent Plugins  │
│ • wechat         │      │ • claude-code    │
│ • feishu (v2)    │      │ • codex          │
│ • telegram (v2)  │      │ • copilot        │
│                  │      │ • opencode       │
└─────────────────┘      └─────────────────┘

Project Structure

bot-hub/
├── src/
│   ├── core/
│   │   ├── types.ts              # Plugin interfaces
│   │   ├── registry.ts           # Plugin registration
│   │   ├── router.ts             # Message routing
│   │   └── session.ts            # Session management
│   ├── plugins/
│   │   ├── messengers/
│   │   │   └── wechat/           # WeChat adapter
│   │   └── agents/
│   │       ├── claude-code/      # Claude Code adapter
│   │       ├── codex/            # OpenAI Codex adapter
│   │       ├── copilot/          # GitHub Copilot adapter
│   │       └── opencode/         # OpenCode adapter
│   ├── index.ts                  # Main entry
│   └── cli.ts                    # CLI commands
├── package.json
├── tsconfig.json
└── README.md

Configuration

Config file: ~/.bot-hub/config.json

{
  "messengers": ["wechat"],
  "agents": ["claude-code"],
  "defaultAgent": "claude-code"
}

Requirements

  • Node.js 18+
  • Claude Code CLInpm install -g @anthropic-ai/claude-code

Development

# Clone
git clone https://github.com/ceociocto/bot-hub
cd bot-hub

# Install deps
npm install

# Build
npm run build

# Run in dev mode (watch)
npm run dev

# Run
npm start

Roadmap

v0.1.x (MVP)

  • [x] WeChat adapter with QR login
  • [x] Claude Code agent integration
  • [x] Codex agent
  • [x] Copilot agent
  • [x] OpenCode agent
  • [x] Basic command routing

v0.2.0

  • [ ] Feishu adapter
  • [ ] Telegram adapter
  • [ ] Session persistence

License

MIT

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 101
Interface 43
Class 28
Function 18

Languages

TypeScript100%

Modules by API surface

src/plugins/messengers/wechat/ilink-types.ts22 symbols
src/plugins/messengers/wechat/ilink-adapter.ts19 symbols
test/integration/router-integration.test.ts17 symbols
test/unit/session.test.ts13 symbols
src/plugins/messengers/wechat/ilink-client.ts13 symbols
src/core/types.ts13 symbols
test/integration/wechat-mock.test.ts11 symbols
src/core/session.ts10 symbols
src/core/registry.ts10 symbols
test/unit/registry.test.ts9 symbols
src/plugins/agents/opencode/index.ts8 symbols
src/plugins/agents/claude-code/index.ts8 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page