Go开发多智能体协作系统

MCP-CoDev-Golang 是一套基于 Claude AI、MCP 和 Go 构建的多智能体协作系统,通过持久化智能体、混合通信(SQLite/tmux/MCP)和 Oracle 审计原则,为 Go 项目开发、生产监控及团队 AI 协作提供完整解决方案。

  • by DeepSeaX-labs
  • Shell
  • 本地部署
  • 更新于
在 GitHub 查看 Deepsea1111/MCP-CoDev-Golang

使用说明

🤖 MCP-CoDev-Golang: Multi-Agent System for Go Development

A production-ready multi-agent system built with Claude AI, MCP (Model Context Protocol), and Go - featuring hybrid communication, persistent agents, and Oracle Framework principles


🌟 What Makes This Different?

Unlike Claude Code's built-in temporary agents, MCP-CoDev-Golang creates persistent, collaborative AI agents that work together like a software development team:

Feature Claude Code Built-in MCP-CoDev-Golang
Agent Lifespan Temporary (task-only) Persistent (always-on)
Communication Parent-child only Peer-to-peer + broadcast
Real-time No Yes (<100ms delivery)
Audit Trail Basic logs Full database (nothing deleted)
Collaboration Sequential Parallel + coordinated
Context Lost after task Persistent sessions

See detailed comparison: docs/COMPARISON.md


🎯 Key Features

🏗️ Multi-Agent Architecture

  • 5 specialized agents working as a team:
    • 🎯 Claude-Alpha - Chief of Staff (coordinator)
    • 💻 Claude-Dev - Developer (implementation)
    • 📚 Claude-Brain - Knowledge Manager (rules & patterns)
    • 🔧 Claude-Infra - DevOps (monitoring & deployment)
    • 🧪 Claude-QA - Quality Assurance (testing)

📡 Hybrid Communication System

  • Radio (SQLite): Persistent audit log (Oracle Principle: Nothing Deleted)
  • tmux Notifications: Real-time delivery (<100ms)
  • MCP Tools: send_to_agent, post_message, read_inbox, assign_task

🔮 Oracle Framework Integration

  1. Nothing is Deleted - Full audit trail
  2. Patterns Over Intentions - Learn from actual behavior
  3. External Brain, Not Command - AI assists, humans decide

🛠️ 6 Custom MCP Servers

  • mcp-radio - Agent communication
  • mcp-brain - Knowledge base management
  • mcp-monitor - Server health & token tracking
  • mcp-infra - Infrastructure automation
  • mcp-qa - Testing & quality checks
  • mcp-security - Security scanning

🚀 Quick Start

Prerequisites

# Required
- Go 1.24+
- tmux
- sqlite3
- Claude AI API access (or Moonshot AI)

# Optional
- PostgreSQL (for full FlowCFO features)

Installation

# 1. Clone repository
git clone https://github.com/DeepSeaX-labs/MCP-CoDev-Golang.git
cd MCP-CoDev-Golang

# 2. Copy environment template
cp examples/config-templates/.env.example .env

# 3. Edit .env with your API keys
nano .env

# 4. Run setup script
bash scripts/install.sh

# 5. Start agent sessions
tmux new -s dev    # Terminal 1
tmux new -s brain  # Terminal 2
tmux new -s infra  # Terminal 3

First Agent Communication

// In brain session, send message to dev:
{
  "from_agent": "Claude-Brain",
  "to_agent": "Claude-Dev",
  "content": "Hello! Testing hybrid communication system.",
  "priority": "high"
}

// Dev session receives instant notification! 🚀

See full guide: docs/GETTING_STARTED.md


🤖 Productivity Boost: Auto Yes Script

Problem: Claude Code agents frequently ask for confirmation ("Do you want to proceed?", "(Y/n)"), slowing down workflows.

Solution: scripts/auto_yes.sh - Auto-responds to confirmation prompts in all tmux sessions!

# Start auto-responder (monitors all tmux sessions)
bash scripts/auto_yes.sh

# Quiet mode (only show important messages)
bash scripts/auto_yes.sh --quiet

# Custom interval
bash scripts/auto_yes.sh --interval 1

# Stop: Ctrl+C

Features:

  • ✅ Detects 5 types of confirmation prompts
  • ✅ Works with all tmux sessions simultaneously
  • ✅ Real-time statistics
  • ✅ Safe (only responds to known patterns)
  • ✅ Essential for multi-agent workflows!

Example Output:

🤖 เริ่มต้นสคริปต์ตอบ Yes อัตโนมัติ...
✅ [14:23:45] session: dev - พบ 'Do you want to proceed?' - กด Enter...
✅ [14:23:52] session: brain - พบ [Y/n] prompt - กด Enter...
📊 สถิติ: ตอบไป 50 ครั้ง | เวลาทำงาน: 120 วินาที

Use Cases:

  • Long development sessions with multiple confirmations
  • Batch operations across agents
  • Automated testing workflows
  • Continuous monitoring by Claude-Infra

🔔 Dev Auto-Notify: Keep Team Informed

Problem: After Dev finishes work, manually notifying Infra/Brain/QA is repetitive and easy to forget.

Solution: scripts/dev-notify.sh - One command to notify the right agents automatically!

# Notify Infra for deployment review (default)
bash scripts/dev-notify.sh

# Notify Brain for architecture review
bash scripts/dev-notify.sh --brain

# Notify QA for testing
bash scripts/dev-notify.sh --qa

# Notify everyone!
bash scripts/dev-notify.sh --all

# Custom message
bash scripts/dev-notify.sh --infra --message "CSV export complete. Added 3 endpoints."

Features:

  • ✅ Auto-detects git context (branch, commit, changed files)
  • ✅ Sends tmux notifications to target agent sessions
  • ✅ Logs to radio database (audit trail)
  • ✅ Properly formatted with signature
  • ✅ Supports custom messages

Workflow Example:

# Dev completes feature
go test ./...                # All tests pass ✅
git commit -m "feat: CSV export"
bash scripts/dev-notify.sh --infra   # ← Auto-notify Infra!

# Infra receives instant tmux notification!
# Message logged to radio with full context

Quick Reference: docs/DEV_WORKFLOW_QUICK_REFERENCE.md


📚 Documentation

Core Concepts:

Agent Guides:

Quick References:


🏗️ Architecture Overview

┌─────────────────────────────────────────────────────┐
│              Claude-Alpha (Coordinator)             │
│                  tmux session: Alpha                │
└──────┬──────────────────────────────────────┬───────┘
       │ send_to_agent (instant)              │
   ┌───▼────────┐                        ┌────▼─────┐
   │ Claude-Dev │◄──► Claude-Brain       │Claude-QA │
   │ (tmux:dev) │     (tmux:brain)       │(tmux:qa) │
   └─────┬──────┘                        └────┬─────┘
         │                                    │
         └──────────┬─────────────────────────┘
                    ▼
            ┌───────────────┐
            │ Claude-Infra  │
            │ (tmux:infra)  │
            └───────┬───────┘
                    ▼
         ┌──────────────────────┐
         │   MCP-Radio Server   │
         │  ┌─────────────────┐ │
         │  │ SQLite Database │ │ ← Audit Trail
         │  │ (radio_logs.db) │ │
         │  └─────────────────┘ │
         └──────────────────────┘

Flow Example:

  1. Alpha assigns task to Dev
  2. Dev asks Brain about architecture (instant notification)
  3. Brain responds with patterns
  4. Dev implements → notifies Infra (instant)
  5. Infra deploys → requests QA review
  6. QA tests → reports to Alpha
  7. All logged to radio (audit trail) ✅

💡 Use Cases

✅ Perfect For:

  • Complex Go projects requiring coordination
  • Production systems needing monitoring
  • Teams wanting AI-assisted workflows
  • Long-running projects with persistent context
  • Compliance requiring full audit trails

🤔 Consider Built-in Instead If:

  • Quick one-off tasks
  • No need for agent collaboration
  • Temporary exploration/planning
  • Single-person workflows

🛠️ Tech Stack

  • Language: Go 1.24
  • AI: Claude Sonnet 4.5 (or Moonshot AI)
  • Communication: MCP (Model Context Protocol)
  • Database: SQLite (radio), PostgreSQL (optional)
  • Multiplexer: tmux
  • Framework: Oracle Framework principles

📊 Performance

  • Message Delivery: <100ms (real-time)
  • Audit Logging: <50ms
  • Agent Response: Depends on AI model
  • Concurrent Messages: 1000+/sec (WAL mode)
  • Database: Lightweight (153 messages ≈ 50KB)

🧪 Testing

# Run automated tests
bash scripts/test-hybrid-system.sh

# Manual test plan
cat docs/TEST_PLAN.md

# Test agent communication
# (See examples/multi-agent-workflow/)

🤝 Contributing

Contributions welcome! See CONTRIBUTING.md

Areas needing help:

  • Additional MCP servers
  • More agent types
  • Performance optimizations
  • Documentation improvements
  • Example workflows

📜 License

Apache License 2.0 - see LICENSE


🙏 Acknowledgments

  • Anthropic - Claude AI & Model Context Protocol
  • Oracle Framework - Architectural principles
  • mark3labs/mcp-go - MCP Go implementation
  • Go Community - Excellent tooling

📞 Support & Community


🗺️ Roadmap

  • [ ] Web UI for agent monitoring
  • [ ] Additional agent types (Design, Security)
  • [ ] K8s deployment templates
  • [ ] VS Code extension
  • [ ] Agent marketplace

⭐ Star History

If this project helps you, consider giving it a star! ⭐


Built with ❤️ for the Go & Claude AI community

Project Status: ✅ Production Ready (v2.0)