Sub Agents Mcp

io.github.shinpr由 GitHub 账号 shinpr 发布v0.15.1更新于 Oct 24, 2026

MCP server for delegating tasks to specialized AI sub-agents across coding tools

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

通过所选的 AI 编程 CLI 运行以 Markdown 定义的可复用编码子代理,并把结果返回助手对话。

可以做什么
  • 从代理目录中运行以 Markdown 或文本文件定义的具名代理,使用选定的编程 CLI 作为后端
  • 把代码审查、测试编写、缺陷排查和文档撰写交给专门的代理
  • 在多个 MCP 客户端间复用同一套代理定义,并集中管理后端与模型配置
  • 开启会话管理后,通过复用返回的 session id 在多次调用间延续同一代理
适用场景
适合希望在一处定义专门的编码代理(审查者、测试编写者、排查者)并在多个 MCP 客户端间共享、同时集中管理后端与模型设置的用户。若希望每个代理各自选择后端和模型,则有更轻量的替代方案。
运行要求
通过 npx 在本地运行,需要 Node.js 22 或更高版本。需要兼容 MCP 的客户端,以及一个已安装并登录的受支持编程 CLI(如 codex、claude、cursor-agent、gemini、grok、opencode)。AGENTS_DIR 必须是包含至少一个 .md 或 .txt 代理文件的绝对路径,AGENT_TYPE 用于选择后端。GLM 和 Kimi 需要 CLI_API_KEY,Cursor 需要 CURSOR_API_KEY。修改配置后需重启客户端。
安装前请注意
子代理会在本机运行真实的编程 CLI,可能修改文件:AGENT_PERMISSION 默认为 safe-edit,yolo 则允许不受限执行,且各后端的执行严格程度不同,官方称其为指引而非安全边界。CLI_API_KEY 与 CURSOR_API_KEY 为通过环境变量传入的密钥。开启 SESSION_ENABLED 后会话历史会写入磁盘,默认保留一天。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Sub Agents Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Sub-Agents MCP Server

[npm version] [License: MIT]

Run reusable coding agents from any MCP-compatible client.

Write a reviewer, test writer, or investigator in Markdown, then ask your assistant to use it. The MCP server runs that agent with the coding CLI you choose and returns the result to the same conversation.

What You Can Do

  • Delegate code review, test writing, investigation, and documentation to focused agents
  • Reuse the same agent definitions across MCP clients with one shared backend and model configuration
  • Continue the same agent across multiple calls for longer work

Quick Start

You need Node.js 22 or later, an MCP-compatible client, and one supported coding CLI installed and signed in. This example uses Codex.

1. Create an Agent

Create an agents folder anywhere on your machine, then add code-reviewer.md:

markdown
# Code Reviewer
Review code for bugs and maintainability issues.
## Task
- Find concrete problems in the requested changes- Explain why each problem matters- Point to the affected code
## Done When
- All requested files have been reviewed- Findings include evidence and suggested next steps

The filename becomes the agent name: code-reviewer.md becomes code-reviewer.

2. Add the MCP Server

Add the server to your client's MCP configuration. Replace AGENTS_DIR with the absolute path to the folder you created.

json
{  "mcpServers": {    "sub-agents": {      "command": "npx",      "args": ["-y", "sub-agents-mcp"],      "env": {        "AGENTS_DIR": "/absolute/path/to/agents",        "AGENT_TYPE": "codex"      }    }  }}

Restart or reconnect your MCP client after saving the configuration.

3. Run the Agent

Ask your assistant:

text
Use the code-reviewer agent to review the authentication changes.

Your assistant runs the agent with Codex and returns the review to the conversation.

Examples

text
Use the test-writer agent to add unit tests for the auth module.
text
Use the bug-investigator agent to find the cause of the failed checkout requests.
text
Use the doc-writer agent to document the public API changes.

Name both the agent and the work you want it to do.

When the MCP Server Fits

Use the MCP server when you want to share the same agents across MCP clients while keeping backend and model configuration in one place.

If you prefer a lighter installation or want each agent to choose its own backend and model, see Sub-Agents Skills.

Supported Backends

Set AGENT_TYPE to the backend you already use:

AGENT_TYPEBackendCommand
codexCodexcodex
claudeClaude Codeclaude
cursorCursor CLIcursor-agent
command-codeCommand Codecommand-code
glmGLM (Z.ai)claude
kimiKimiclaude
grokGrok Buildgrok
antigravityGoogle Antigravityagy 1.1.12+
geminiGemini CLI (compatibility)gemini
opencodeOpenCodeopencode
mcodeMiniMax Codemcode
piPipi

The selected CLI must be installed and configured before the MCP server starts.

GLM and Kimi require CLI_API_KEY in the MCP server environment. Other backends use the CLI's existing authentication.

For Google models, prefer Antigravity. Gemini CLI remains available for existing enterprise, API key, or Vertex AI configurations.

Shared Agent Settings

Set AGENT_MODEL to use one model for every agent. Omit it to use the backend's default.

AGENT_PERMISSION controls what agents may do:

  • read-only — review and investigation
  • safe-edit — edits allowed without approval (default)
  • yolo — unrestricted execution

If an agent reports that an action was blocked, choose a less restrictive mode.

How strictly each level is enforced depends on the backend, so treat it as guidance rather than a security boundary.

Continue Work Across Calls

Set SESSION_ENABLED to "true" when you want an agent to remember earlier calls and continue a longer task. Your assistant must reuse the returned session_id on the next call to continue that session.

If It Does Not Start

  • Run the selected backend command directly and confirm that it is installed and signed in
  • Make sure AGENTS_DIR is an absolute path and contains at least one .md or .txt file
  • Restart or reconnect the MCP client after changing its configuration

License

MIT

来源:README.md,提交 0dcb532

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

5
  1. v0.15.1最新Oct 22, 2026
  2. v0.15.0Oct 20, 2026
  3. v0.14.4Oct 15, 2026
  4. v0.14.3Oct 14, 2026
  5. v0.14.2Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分