Sub-Agents MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Sub-Agents MCP Server
一个基于 Model Context Protocol (MCP) 的 AI 子代理服务,为各类AI编程IDE和Cli工具提供专业化的代理能力扩展。
📖 项目简介
Sub-Agents 允许你的 AI 助手调用专门的 Gemini 子代理来执行特定任务:
Reviewer - 代码审查专家,检测 Bug、逻辑漏洞、安全风险
Explorer - 代码结构分析师,理解代码架构、追踪逻辑流程
Doc Keeper - 外部知识管理员,获取和整理外部文档
flowchart LR
A["AI Assistant<br/>(IDE/Agent)"] <-->|MCP| B["Sub-Agents<br/>MCP Server"]
B <-->|CLI| C["LLM Backend<br/>(Gemini/Claude)"]Related MCP server: Roundtable AI MCP Server
🚀 快速开始
前置依赖
Python 3.10+
Gemini CLI - 请参考 Gemini CLI 官方安装指南 进行安装
依赖安装
pip install -r requirements.txt
配置
复制示例配置文件:
cp mcp_config.example.json mcp_config.json cp .env.example .env编辑
mcp_config.json,配置 Python 路径和项目路径(参见下方示例)
⚙️ MCP 配置示例
Sub-Agents 支持两种传输模式:STDIO 和 SSE (HTTP)。不同的 IDE 对这两种模式的支持程度不同。
模式 1: STDIO 模式(推荐)
STDIO 模式通过标准输入输出进行通信,配置简单,适用于大多数场景。
{
"mcpServers": {
"sub-agents": {
"command": "D:/your/project/.venv/Scripts/python.exe",
"args": [
"D:/your/project/subAgent/src/server.py"
],
"env": {
"SUB_AGENT_CWD": "D:/your/working/directory",
"USE_PREVIEW_MODELS": "true",
"GEMINI_TIMEOUT": "360"
}
}
}
}模式 2: SSE 模式 (HTTP)
SSE 模式通过 HTTP 进行通信,支持更复杂的场景(如远程部署、多客户端)。
步骤 1: 先启动 HTTP 服务器
python src/server.py --transport http --host 127.0.0.1 --port 8000步骤 2: 在 IDE 中配置 MCP 客户端
{
"mcpServers": {
"sub-agents": {
"url": "http://127.0.0.1:8000/sse",
"headers": {
"X-Sub-Agent-Config": "{\"SUB_AGENT_CWD\": \"D:/your/working/directory\", \"USE_PREVIEW_MODELS\": \"true\", \"GEMINI_TIMEOUT\": \"360\"}"
}
}
}
}⚠️ 注意: SSE 模式下,配置信息通过 HTTP Header 传递,需要将 JSON 转义为字符串。
🔧 IDE 兼容性与已知问题
Antigravity (Google)
模式 | 支持状态 | 说明 |
STDIO | ✅ 完全支持 | 推荐使用 |
SSE | ❌ 不支持 | 当前版本不支持 HTTP 传输 |
已知问题:
❌ Windows stdout 污染: Antigravity 的 STDIO 模式对输出格式要求严格。本项目已内置静默日志配置,避免任何非协议输出。
❌ Windows CR/LF 问题: Windsurf 在 Windows 上可能发送包含
\r\n的消息,导致 JSON 解析失败。本项目已内置BinaryCRStripper修复此问题。
Trae
模式 | 支持状态 | 说明 |
STDIO | ✅ 完全支持 | 推荐使用 |
SSE | ✅ 支持 | 推荐使用 |
📁 项目结构
subAgent/
├── src/
│ ├── __init__.py # 包初始化
│ ├── server.py # MCP 服务器入口
│ ├── router.py # Agent 路由器
│ ├── config.py # 配置加载器(单例)
│ ├── launcher.py # Gemini CLI 启动器
│ └── model_resolver.py # 模型别名解析
├── prompts/
│ ├── reviewer.md # Reviewer Agent 提示词
│ ├── explorer.md # Explorer Agent 提示词
│ └── doc_keeper.md # Doc Keeper Agent 提示词
├── tools/
│ ├── doc_mcp.py # Doc Keeper 专用 MCP 工具
│ └── gen_header_config.py # SSE Header 配置生成器
├── agents.yaml # Agent 配置文件
├── mcp_config.example.json # MCP 配置示例
└── requirements.txt # Python 依赖🔑 环境变量
变量名 | 说明 | 默认值 |
| 子代理工作目录 | 必须指定 |
| Gemini CLI 可执行文件路径 | 自动查找 |
| 是否使用预览模型 |
|
| 自动模型别名 |
|
| 专业模型别名 |
|
| 闪存模型别名 |
|
| 闪存轻量模型别名 |
|
| CLI 超时时间(秒) |
|
📝 使用示例
配置完成后,你可以在 AI 助手中这样使用:
请调用 reviewer 检查 src/router.py 中的潜在问题请调用 explorer 帮我理解 ConfigLoader 的单例实现请调用 doc_keeper 整理 PyTorch DataLoader 的官方文档要点🛠️ 开发
本地调试
# STDIO 模式
python src/server.py
# HTTP 模式
python src/server.py --transport http --port 8000📄 License
MIT License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Multiplayer for the coding agents your team already uses: shared tasks, decisions, skills and tools.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Command center for developers coordinating AI coding agents across projects.
Hand off work between AI agents in any tool. Start Devin or Cursor cloud and share memory.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables an AI assistant to delegate coding tasks to local Codex or Claude Code CLIs, monitor their progress, read results, continue sessions, and browse the files in user-approved project workspaces. It exposes these capabilities over Streamable HTTP through a Cloudflare tunnel or locally over stdio, so a remote or cloud client can drive agents running on the user's own machine.71 npm1MIT
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI coding assistant to delegate tasks to specialized local CLI agents such as Gemini, Claude, Codex, and Cursor, coordinating shared context, parallel execution, and synthesized responses from within an IDE.-
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI coding assistant to delegate tasks to specialized sub-agents in parallel, share project context, and synthesize their responses. It uses existing local CLI tools and API subscriptions to coordinate Codex, Claude, Cursor, and Gemini without extra cost.-
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI assistant in an IDE to delegate tasks to multiple specialized AI sub-agents in parallel, share project context, and synthesize their responses. It coordinates existing local CLI tools like Gemini, Claude, Codex, and Cursor without extra markup or manual copy-pasting.-