Update GITEE repository path and add macOS quarantine attribute removal for darwin platform binaries. generated by llmgit Co-Authored-By: Claude <noreply@anthropic.com>
cc-connect
English | 中文
Bridge your local AI coding assistants (Claude Code / Cursor / Gemini CLI / Codex) to messaging platforms like Feishu (Lark), DingTalk, Slack, and more. Chat with your local AI agent from anywhere — no public IP required.
Architecture
┌──────────────┐ ┌────────────┐ ┌──────────────┐
│ Feishu/Ding │◄───►│ Engine │◄───►│ Claude Code │
│ Slack/... │ │ (Router) │ │ Cursor/... │
└──────────────┘ └────────────┘ └──────────────┘
Platform Core Agent
- Platform — Messaging platform adapter. Handles receiving/sending messages over WebSocket, Stream, etc.
- Agent — AI assistant adapter. Invokes the local AI tool and collects its response.
- Engine — Core router. Manages sessions, routes messages between platforms and agents, handles slash commands.
All components are decoupled via Go interfaces — fully pluggable and extensible.
Support Matrix
| Component | Type | Status |
|---|---|---|
| Agent | Claude Code | ✅ Supported |
| Agent | Cursor Agent | 🔜 Planned |
| Agent | Gemini CLI | 🔜 Planned |
| Agent | Codex | 🔜 Planned |
| Platform | Feishu (Lark) | ✅ Supported |
| Platform | DingTalk | ✅ Supported |
| Platform | Telegram | ✅ Supported |
| Platform | Slack | ✅ Supported |
| Platform | Discord | ✅ Supported |
| Platform | LINE | ✅ Supported |
| Platform | WeChat Work (企业微信) | ✅ Supported |
Quick Start
Prerequisites
- Go 1.22+
- Claude Code CLI installed and configured
Install
git clone https://github.com/chenhg5/cc-connect.git
cd cc-connect
make build
Configure
cp config.example.toml config.toml
vim config.toml
Run
./cc-connect # uses config.toml by default
./cc-connect -config /path/to/config.toml # custom path
Execution Modes
Claude Code adapter supports two modes, controlled by the mode option:
| Mode | Behavior | Use Case |
|---|---|---|
interactive (default) |
Respects tool permissions. Shows tool-use details in every response. Use allowed_tools to grant specific tools. |
Daily development — you stay in control. |
auto |
Auto-approves all operations (--dangerously-skip-permissions). |
Trusted / sandboxed environments. |
[projects.agent.options]
mode = "interactive"
# allowed_tools = ["Read", "Grep", "Glob", "Bash"]
In both modes, Claude Code can ask clarifying questions. The conversation continues naturally — just reply on the messaging platform.
Session Management
Each user gets an independent session with full conversation context. You can manage multiple sessions via slash commands directly from the messaging platform:
| Command | Description |
|---|---|
/new [name] |
Create a new session (and switch to it) |
/list |
List all your sessions |
/switch <id|name> |
Switch to a different session |
/current |
Show current session info |
/history [n] |
Show last n messages (default 10) |
/help |
Show available commands |
Sessions are isolated — switching to a different session resumes a completely independent Claude Code conversation.
Configuration
Each [[projects]] entry binds one code directory to its own agent and platforms. A single cc-connect process can manage multiple projects simultaneously.
# Project 1
[[projects]]
name = "my-backend"
[projects.agent]
type = "claudecode"
[projects.agent.options]
work_dir = "/path/to/backend"
mode = "interactive"
[[projects.platforms]]
type = "feishu"
[projects.platforms.options]
app_id = "cli_xxxx"
app_secret = "xxxx"
# Project 2 — different folder, different bot
[[projects]]
name = "my-frontend"
[projects.agent]
type = "claudecode"
[projects.agent.options]
work_dir = "/path/to/frontend"
mode = "auto"
[[projects.platforms]]
type = "dingtalk"
[projects.platforms.options]
client_id = "xxxx"
client_secret = "xxxx"
Feishu (Lark)
- Create an app at Feishu Open Platform
- Enable the Bot capability
- Add the
im.message.receive_v1event under Event Subscriptions - Select WebSocket long connection mode (no public IP needed)
- Copy the App ID and App Secret into your config
DingTalk
- Create an app at DingTalk Open Platform
- Create a Bot and select Stream mode
- Copy the Client ID and Client Secret into your config
Telegram
- Message @BotFather on Telegram, send
/newbot - Copy the bot token into your config
- Connection: Long polling (no public URL needed)
Slack
- Create an app at Slack API
- Enable Socket Mode (Settings > Socket Mode)
- Subscribe to bot events:
message.channels,message.im - Install app to workspace, copy Bot Token (
xoxb-...) and App Token (xapp-...) - Connection: Socket Mode WebSocket (no public URL needed)
Discord
- Create an app at Discord Developer Portal
- Under Bot, create a bot and copy the token
- Enable Message Content Intent under Privileged Gateway Intents
- Invite bot to server via OAuth2 URL Generator (scopes:
bot; permissions:Send Messages) - Connection: Gateway WebSocket (no public URL needed)
LINE
- Create a Messaging API channel at LINE Developers Console
- Copy the Channel Secret and Channel Access Token (long-lived)
- Set your webhook URL in LINE console to
http(s)://<your-domain>:<port>/callback - Connection: HTTP Webhook — you must expose the local port via ngrok, cloudflared, etc.
WeChat Work (企业微信)
- Log in to WeChat Work Admin
- App Management > Create a custom app > note the AgentId and Secret
- My Enterprise > note the Corp ID
- In your app > Receive Messages > Set API Receive:
- URL:
http(s)://<your-domain>:<port>/wecom/callback - Token: any random string
- EncodingAESKey: click "Random Generate"
- Start cc-connect first, then save to pass verification
- URL:
- Trusted IP > add your server's outbound public IP
- (Optional) My Enterprise > WeChat Plugin > scan QR to link personal WeChat — this allows chatting from regular WeChat too
- Connection: HTTP Webhook — you must expose the local port via ngrok, cloudflared, etc.
Extending
Adding a New Platform
Implement the core.Platform interface and register it:
package myplatform
import "github.com/chenhg5/cc-connect/core"
func init() {
core.RegisterPlatform("myplatform", New)
}
func New(opts map[string]any) (core.Platform, error) {
return &MyPlatform{}, nil
}
// Implement Name(), Start(), Reply(), Stop()
Then add a blank import in cmd/cc-connect/main.go:
_ "github.com/chenhg5/cc-connect/platform/myplatform"
Adding a New Agent
Same pattern — implement core.Agent and register via core.RegisterAgent.
Project Structure
cc-connect/
├── cmd/cc-connect/ # Entrypoint
│ └── main.go
├── core/ # Core abstractions
│ ├── interfaces.go # Platform + Agent interfaces
│ ├── registry.go # Plugin-style factory registry
│ ├── message.go # Unified message / event types
│ ├── session.go # Multi-session management
│ └── engine.go # Routing engine + slash commands
├── platform/ # Platform adapters
│ ├── feishu/ # Feishu / Lark (WebSocket)
│ ├── dingtalk/ # DingTalk (Stream)
│ ├── telegram/ # Telegram (Long Polling)
│ ├── slack/ # Slack (Socket Mode)
│ ├── discord/ # Discord (Gateway WebSocket)
│ ├── line/ # LINE (HTTP Webhook)
│ └── wecom/ # WeChat Work (HTTP Webhook + AES)
├── agent/ # Agent adapters
│ └── claudecode/ # Claude Code CLI (auto + interactive)
├── config/ # Config loading
├── config.example.toml # Config template
├── Makefile
└── README.md
License
MIT