Delegation MCP

Delegation MCP

Intelligent routing layer that analyzes tasks and guides your AI agent to delegate work to specialized tools (Gemini, Aider, Copilot) using rule-based and capability-based routing.

Category
访问服务器

README


title: Delegation MCP emoji: 🚀 colorFrom: blue colorTo: purple sdk: docker pinned: false license: mit short_description: Intelligent Multi-Agent Routing & Guidance tags:

  • mcp-server
  • building-mcp-track-enterprise
  • multi-agent
  • agent-orchestration

🚀 Delegation MCP Server

Intelligent Multi-Agent Routing & Guidance

Tests License MCP Version Anthropic

Built for the MCP 1st Birthday Hackathon - Winter 2025

⚡ Quick Start

# One command to install and configure everything
python install.py

That's it! Restart Claude Code and start delegating:

"scan this codebase for security vulnerabilities"
→ MCP suggests: "Delegate to Gemini"
→ Claude executes: gemini scan .

"design an authentication architecture"
→ MCP suggests: "Handle directly (Claude is best)"
→ Claude executes: (Internal reasoning)

"refactor the delegation engine"
→ MCP suggests: "Delegate to Aider"
→ Claude executes: aider --message "refactor delegation engine"

Features:

  • One-command installation - 30 seconds to full setup
  • Intelligent Routing - Rules + Capabilities analysis
  • Privacy-First - Your code never passes through this server
  • Lightweight - Minimal footprint, no heavy databases
  • Cross-platform - Windows, Mac, Linux

🎮 Try the Interactive Demo

Hugging Face Spaces

Experience the routing intelligence in action! Our HF Space demo lets you:

Interactive Features:

  • 🧪 Test Any Query - See routing decisions in real-time
  • 📊 Routing Transparency - View the complete decision-making process:
    • Task classification (security, architecture, refactoring, etc.)
    • Complexity assessment (simple/medium/complex)
    • Detected keywords and routing reasoning
    • CLI command that would be executed
  • ⚙️ Live Configuration - Toggle agents and routing strategies to see how settings affect decisions
  • 💡 Example Queries - Simple and complex multi-step scenarios

Try This:

  1. Visit the HF Space
  2. Enter: "Audit the authentication system for SQL injection, XSS, and CSRF vulnerabilities"
  3. Watch it route to Gemini with full reasoning
  4. Disable Gemini in settings → See it route to Claude instead!

Want to test with real agents? Duplicate the Space and add your API keys!


🌟 What Is This?

A lightweight MCP server that acts as a routing intelligence layer for AI coding agents. Instead of executing tasks itself (which creates a bottleneck and security risk), it analyzes your request and guides your main agent (like Claude Code) on which tool to use.

Key Insight: This follows the Routing Guidance pattern:

  1. Analyze: The server analyzes the prompt (e.g., "audit security").
  2. Route: It determines the best agent based on your presets and rules.
  3. Guide: It returns the exact command to run.
  4. Execute: The client (Claude) executes the command directly.

This ensures zero lock-in, maximum privacy, and native performance.


🎯 The Core Value Proposition

Problem

Developers manually switch between AI agents, losing context and productivity:

  • Claude for architecture
  • Gemini for security analysis
  • Aider for git operations
  • Copilot for GitHub integration

Solution

One MCP server that tells your agent who to call:

You → Claude Code → Delegation MCP → "Use Gemini for this" → Claude calls Gemini

You work with ONE agent, but get the power of ALL agents.


📦 Installation

Prerequisites

  • Python 3.10+
  • At least one AI agent CLI installed:

Automated Installation (Recommended)

# Clone repository
git clone https://github.com/carlosduplar/multi-agent-mcp.git
cd multi-agent-mcp

# One-command install
python install.py

# Or on Unix/Mac
bash install.sh

The installer will:

  1. Check system requirements
  2. Discover installed agents
  3. Configure Claude Code automatically
  4. Verify everything works

Restart Claude Code and you're ready!


🎯 How It Works

Intelligent Routing Guidance

We use a hybrid approach to determine the best agent for the job:

  1. Rule-Based Presets: Your configured rules take priority (e.g., "Always use Gemini for security").
  2. Capability Analysis: If no rule matches, we analyze agent capabilities to find the best fit.

Query: "scan for vulnerabilities"

  1. Check Rules: Matches security_audit preset? -> Gemini
  2. Guide: Return guidance to use Gemini

Example Interaction

User: "Audit my authentication code for SQL injection"

Claude Code calls get_routing_guidance:

{
  "query": "Audit auth.py for SQL injection"
}

MCP Server responds:

{
  "decision": "DELEGATE_TO: gemini",
  "agent": "gemini",
  "task_type": "security_audit",
  "cli_command": "gemini \"Audit auth.py for SQL injection\""
}

Claude Code then executes:

gemini "Audit auth.py for SQL injection"

🔧 MCP Tools

get_routing_guidance

Get routing guidance for a task. Returns which agent should handle it and the exact CLI command to run.

{
  "query": "Audit auth.py for SQL injection"
}

discover_agents

Automatically discover available CLI agents on the system and register them.

{
  "force_refresh": false  # Optional: force re-discovery
}

list_agents

List all registered agents and their availability status.

⚡ Token Overhead

One of the key advantages of this MCP server is its minimal context footprint. Here's the actual token usage:

MCP Tools:
├─ get_routing_guidance: 601 tokens
├─ discover_agents:      584 tokens
└─ list_agents:          554 tokens
                         ─────────
Total MCP overhead:      1,739 tokens (0.9% of 200k context)

What this means:

  • ✅ Less than 1% of your context budget
  • ✅ Leaves 99%+ for actual code and conversation
  • ✅ No heavy prompts or bloated instructions
  • ✅ Intelligent routing without sacrificing context

Compare this to running multiple agent instances or complex orchestration frameworks that can consume 10-20% of your context just for coordination overhead.


🏗️ Architecture

┌─────────────────────────────────────────┐
│  Claude Code (or other MCP client)      │
│  - User chats here                      │
│  - Calls get_routing_guidance           │
│  - EXECUTES the returned command        │
└──────────────┬──────────────────────────┘
               │ MCP Protocol (stdio)
               ▼
┌──────────────────────────────────────────┐
│  Delegation MCP Server                   │
│  - Analyzes task complexity & type       │
│  - Checks rules & capabilities           │
│  - Returns guidance (NO EXECUTION)       │
└──────────────────────────────────────────┘

v0.4.0 - Lightweight Architecture

Privacy & Security:

  • No Code Execution: The server never executes code or commands. It only suggests them.
  • No Data Persistence: No databases or logs of your code are kept by the server.
  • Direct Connection: Your agent talks directly to the delegated tool (e.g., Claude -> Gemini).

Agent Auto-Discovery:

  • Automatically detects installed CLI agents (Claude, Gemini, Aider, etc.)
  • Verifies agent availability
  • Graceful error handling

🗂️ Project Structure

multi-agent-mcp/
├── src/delegation_mcp/
│   ├── server.py              # MCP server (Routing Guidance) ⭐
│   ├── delegation.py          # Routing logic & scoring
│   ├── orchestrator.py        # Agent registry
│   ├── agent_discovery.py     # System scanner for agents
│   ├── tool_discovery.py      # Tool definitions
│   ├── config.py              # Configuration handling
│   ├── cli.py                 # CLI tools
│   └── adapters/              # Agent definitions
│       ├── claude.py
│       ├── gemini.py
│       ├── copilot.py
│       └── aider.py
├── tools/                     # Tool definitions (JSON)
├── tests/                     # Comprehensive tests
└── config/                    # Default delegation rules

🚀 Roadmap

✅ Phase 1: Foundation (COMPLETE)

  • MCP server with routing guidance
  • Capability-based routing
  • Agent auto-discovery
  • Production-grade architecture

🔜 Phase 2: Intelligence (Q1 2026)

  • ML-powered routing
  • Learning from user feedback
  • Custom agent definitions

🔮 Phase 3: Collaboration (Q2 2026)

  • Complex multi-step workflows
  • Parallel agent execution guidance

🤝 Contributing

We welcome contributions! Add new agent adapters, improve routing logic, or enhance documentation.


📄 License

MIT License - see LICENSE


🎯 The Vision

"You work with ONE agent, but get the power of ALL agents."

Today's AI landscape has amazing specialists, but they work in silos. Delegation MCP changes that. It's the intelligence layer that lets agents collaborate, creating something greater than the sum of its parts.


Built with ❤️ for the MCP ecosystem

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选