Subagent MCP

io.github.Thang1710由 GitHub 帳號 Thang1710 發布v1.0.31更新於 Oct 24, 2026

Let Codex orchestrate external coding agents through their native harnesses.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

讓 Codex 透過各外部編碼代理的原生執行環境委派有限任務,並觀察與介入執行過程。

可以做什麼
透過原生執行環境把任務委派給外部編碼代理,由 Codex 保留最終判斷,並可介入或關閉每次執行。設定執行環境與模型選擇,設定具修訂版本檢查,並提供本機設定與活動介面。檢視執行環境狀態、能力,以及依代理列出的活動,包括去識別化的最終結果。在原生回合前以 SHA-256 驗證檔案身分,並為並行寫入宣告寫入範圍。對長時間執行的任務進行有界的本機等待觀察。
適用情境
適合希望由獨立模型實作或審查變更、避免審查者與作者共享相同脈絡與盲點,同時仍由 Codex 擔任協調者的情境。也適合已有 Claude Code 或 DeepSeek 訂閱額度、想用於有限子任務的情況。
執行需求
以 PyPI 套件形式透過 uvx 在本機以 stdio 執行,需先安裝 uv;穩定版以 Windows 為目標。需要一個 Codex 用戶端來註冊此伺服器,並在固定回送埠提供本機設定介面。每個外部執行環境都需要各自的原生執行環境,並透過作業系統瀏覽器登入;伺服器本身不儲存憑證。
安裝前請注意
任務及其讀取的原始碼會傳送給所選外部供應商,派送前應確認權限與原始碼授權。寫入權限影響較大:省略寫入範圍時預設涵蓋整個工作區,且租約並非作業系統沙箱。任務可能消耗訂閱額度;伺服器不會購買額度或變更計費,但供應商呼叫可能產生費用。代理輸出應視為不可信任的建議。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Subagent MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Subagent MCP

Independent harnesses. One Codex orchestrator.

When one model plans a change, implements it, and reviews it, the reviewer shares the author's context and blind spots. It can end up confirming its own plan instead of testing it.

Subagent MCP keeps Codex as the main agent and final decision-maker while delegating bounded work to external agent runtimes. Each runtime is a model paired with its native harness, so Codex can get implementation or review from an independent model with different context and assumptions.

That expands Codex's effective sub-agent pool and can use provider quota you already have. Subagent MCP never enables, purchases, auto-reloads, or silently opts into usage credits or paid overage.

Adapters translate every native harness into the same lifecycle: delegate, observe, steer, and close. The core hard-codes no provider role or model name.

Stable: 1.0.31 targets Windows. The MCP, package, localhost UI, and Claude Code and DeepSeek native-harness integrations are ready.

Runtime status

  • Claude Code — Ready. Uses the native Claude Code harness, provider-native model and reasoning settings, subscription OAuth identity, and live no-overage evidence before accepting its output. Project/local context and exact auto-compaction-trigger attestation remain explicit capability gaps.
  • DeepSeek Harness — Ready. Uses its native ACP transport and harness-published model catalog for bounded tasks. Resume after an MCP restart, exact provider quota evidence, interactive input, and declared MCP remain explicit capability gaps. A provider-retired model route fails terminally and is never replaced without the user's explicit selection.
  • Grok Build — Ready for read-only review. The Windows adapter uses cached native login only and allows no credits, paid overage, or model fallback. Version 1.0.31 advertises and accepts repo_read only. Bounded writing remains In development and workspace_write requests fail before a native process starts. Other explicit gaps are terminal/test/Git execution, network/web/browser, MCP/plugins/hooks, nested agents, native worktrees, restart recovery, macOS/Linux support, and exact pre-request quota.

Runtime behavior comes from adapters rather than provider-specific branches in the core.

Quick start

1. Install

Install uv if needed, then register the exact isolated release and start its background UI:

powershell
winget install --id=astral-sh.uv -ecodex mcp add subagent-mcp -- uvx --isolated --from subagent-harness-mcp==1.0.31 subagent-harness-mcp serveuvx --isolated --from subagent-harness-mcp==1.0.31 subagent-harness-mcp ui --background

Start a new Codex task after registration.

2. Configure runtimes

Open http://127.0.0.1:8765 in a browser. If the background UI was stopped, start the same exact release again:

powershell
uvx --isolated --from subagent-harness-mcp==1.0.31 subagent-harness-mcp ui --background

The settings and read-only activity UI stays on the fixed loopback port and does not depend on an active MCP connection.

If a runtime shows Sign in required, click Sign in. Its native harness opens the operating system's default browser; Subagent MCP never asks for or stores credentials. Complete login there, then click Refresh. A status check never opens a browser by itself.

Current and recent activity is listed by external agent. Select a row to inspect its model, native harness, workspace, permissions, write set, current stage, lifecycle, elapsed time, and redacted terminal result. Prompts, transcripts, hidden thinking, and raw provider events are never displayed.

3. Delegate

Ask Codex in plain language:

Use Subagent MCP to ask an external agent to review this change, then evaluate its findings independently.

Codex chooses what to delegate, observes the result, and keeps the final judgment. Lifecycle responses are compact by default; full redacted reports remain in local product state and can be read or relayed later by hash-bound reference.

For an approval tied to an exact file, pass inputs on agent_spawn (inside task) or agent_send:

json
[{"path":"docs/specs/review.md","expected_sha256":"<lowercase SHA-256>"}]

The MCP hashes each repository-relative file read-only immediately before the native turn. Status returns the verified hash and configured reasoning attestation; a changed file fails before the external agent runs.

Models and fallback order

Each native harness publishes its own model choices. The UI shows friendly names and an ordered priority stack; exact provider IDs remain available for advanced routes.

Claude choices come from the installed standalone CLI through the public Agent SDK. Discovery resolves native aliases to exact model IDs without sending a prompt, and caches the resulting metadata for up to 60 seconds. A CLI identity change invalidates the cache. Missing authentication or unavailable discovery leaves custom exact-ID input available; it does not change saved model choices. New model names do not require a new MCP release, but a model can still require a newer native CLI. The usual compatibility canary remains separate.

The model picker adds and removes models only through explicit actions. Opening and applying it leaves the existing order unchanged unless you edit it.

runtime_list includes config_revision. After user approval, configure a runtime through runtime_configure using that revision and a new request ID:

json
{  "request_id": "choose-claude-model-1",  "expected_revision": 7,  "patch": {    "runtimes": {      "claude-code": {        "options": {          "variant.0.model": "claude-opus-5-5",          "variant.0.reasoning.effort": "max"        }      }    }  }}

The example changes an existing variant. For a fresh runtime, supply enabled: true and options.model_priority with the chosen IDs plus its required reasoning options. Settings and MCP use the same validation and revision check. A repeated identical request observes its saved receipt; different input needs a new request ID. An interrupted mutation with no receipt requires inspecting current state before another change. This tool cannot change project trust and never starts authentication, a live canary, or a provider task automatically.

When a provider explicitly reports exhausted quota or credit (QUOTA_PAUSED), Subagent MCP moves that exact model to the bottom for future tasks. It does not retry the failed task. Ambiguous failures, crashes, and timeouts do not reorder models or trigger another paid request.

That failed task stays terminal, but the next explicit delegation checks the provider again live; no cached reset clock or wait-until checkpoint substitutes for that check. When the native harness exposes no safe pre-request quota endpoint, status stays unknown rather than inferred exhausted.

Operational recovery is capped at three actions. Local state work and explicit pre-provider failures may be retried. DeepSeek also retries an explicit temporary upstream HTTP 429 at most three total attempts. A generic provider failure is never replayed automatically: a read-only task returns bounded guidance for a new explicit attempt, while a write task remains non-retryable until its write set and possible effects are reconciled. Quota, credit, billing, timeout, and ambiguous lifecycle failures never trigger another provider call. Native ACP failures include bounded redacted RPC/provider details when the harness exposes them; unknown quota remains a provider error, not exhaustion.

DeepSeek routes may use an existing subscription, unlimited offer, or funded balance that the user authorizes. Subagent MCP never purchases, reloads, or increases that balance.

Review permissions and source consent

agent_spawn sends the task and source read by the native harness to the selected external provider. An omitted or null required_capabilities defaults to ["repo_read"]. Explicit lists, including [], are preserved; write permission is never inferred. runtime_list advertises each manifest's required_semantic_permissions; Claude and Grok require repo_read.

Missing mandatory permissions fail locally as REQUEST_INVALID, before a runtime probe, task-input read, execution claim or provider launch. The response includes recovery.action="repair", reason="declare_required_permissions" and max_attempts=1. Follow next_action: correct the payload with a new request_id only when the required provider/source access is already authorized. An explicit restriction must not be silently replaced. This correction does not permit replaying a failed native execution or retrying quota, authentication, access, policy or ambiguous-launch failures.

The controller should reuse existing authorization for the named provider and source scope. If a spec-only review needs additional private source, ask before dispatch, for example: "May the selected provider read this spec and these named source folders for a read-only review?" Use the host's supported approval or user-question tool; explain any host rejection, keep the question pending, and honor the answer. Do not repeat a rejected call without the required approval. task.inputs verifies file identities; it is not a read sandbox or consent receipt. The MCP server cannot display a question after the host rejects a call before it reaches the server, and chat consent does not grant OS/OAuth access.

Long-running work

agent_wait is a bounded local observation, not a model deadline. If it returns running with wait_policy=continue_while_running, the external agent may still be working or thinking. Keep observing the same conversation; elapsed time alone never triggers retry, fallback, interruption, or another provider request.

Concurrent writers

A write task can declare up to 32 repository-relative file or directory roots in write_set. External writers may run concurrently when their canonical absolute sets are disjoint. Equal paths and parent/child paths conflict; task and lane names do not affect locking.

Omitting write_set gives the execution the whole workspace for backwards compatibility. Each adapter also enforces the normalized paths at its native harness boundary. Inspect runtime_list before creating a write request: write_root_mode=path-prefix supports exact file or directory prefixes, while existing-directory requires an existing directory. The current DeepSeek Harness native session advertises existing-directory and one writable root. Subagent MCP never widens an exact-file scope to its parent directory; use that broader directory only when it is explicitly acceptable, otherwise choose a runtime that enforces path-prefix. Multiple valid directory roots are split into disjoint writer calls. These leases coordinate Subagent MCP executions; they are not an operating-system sandbox for unrelated local processes.

On the current Windows public slice, set cwd to the checkout root and use workspace="current". For a DeepSeek write, pass workspace_write and exactly one existing directory relative to cwd, for example write_set=["Assets/_Project/Core/Scripts/GameSettings"]. An absolute path, missing path, or exact file is not a valid existing-directory root.

On Windows, the DeepSeek native sandbox must materialize a restricted-token ACE, so the current user also needs WRITE_DAC on the selected directory. Subagent MCP checks that capability read-only before ACP or provider work. It does not change ownership or ACLs. A failed check stays CAPABILITY_MISSING; it never falls back to danger-full-access.

How it fits together

mermaid
flowchart LR    C["Codex<br/>Main agent & orchestrator"]    M["Subagent MCP<br/>Gateway"]    UI["Localhost UI<br/>Settings & activity"]
    C -->|"delegate · steer · observe"| M    UI --> M
    subgraph E["External agent runtimes — adapter-driven"]        R1["Model<br/>+<br/>native harness"]        R2["Model<br/>+<br/>native harness"]        RN["Future runtimes<br/>via adapters"]    end
    M -->|"normalized lifecycle"| R1    M -->|"normalized lifecycle"| R2    M -->|"normalized lifecycle"| RN

Subagent MCP owns lifecycle normalization, status, redaction, leases, and circuits. Each adapter translates that contract to its native harness. See Architecture for the full contract.

Update or roll back on Windows

Switch versions without reinstalling an environment that may still be running. The first command uses the source version; the add/start commands use the target version. This example upgrades 1.0.30 to 1.0.31:

powershell
uvx --isolated --from subagent-harness-mcp==1.0.30 subagent-harness-mcp ui --stopcodex mcp remove subagent-mcpcodex mcp add subagent-mcp -- uvx --isolated --from subagent-harness-mcp==1.0.31 subagent-harness-mcp serveuvx --isolated --from subagent-harness-mcp==1.0.31 subagent-harness-mcp ui --background

Start a fresh Codex task after changing the entry. Existing tasks keep their old runtime until they end. Use the same sequence with the exact versions reversed to roll back.

An already-running MCP that reports UPDATE_QUARANTINED cannot hot-load the replacement safely. Do not retry that resident; finish with native fallback and use the new exact registration from a fresh task.

For a one-time migration from a direct subagent-harness-mcp serve entry, replace the registration first and let the legacy task end naturally. After replacing it, close every Codex window once before optionally removing the now-unused persistent tool. Leaving it installed is safe because every new command above uses uvx --isolated.

Subagent MCP does not edit Codex configuration, kill Codex/provider processes, or clear uv caches on its own.

Safety and billing

  • Subagent MCP never enables usage credits or changes billing settings.
  • Claude tasks can consume included subscription quota. Each task validates the bound CLI, subscription authentication, credential precedence, and control connection, then requires safe rate evidence from the same response before accepting its output.
  • Provider Refresh sends no model prompt. If the native harness cannot expose exact rate evidence before a response, status remains unknown rather than inventing a quota result or using a reset clock.
  • Fallback occurs only after explicit quota exhaustion. Unsafe or ambiguous evidence never triggers another paid request.
  • Native transcripts remain owned by the native harness. Product state stays in explicit local roots, and agent output must be treated as untrusted advice.

Read Security and the Threat model before enabling write access.

Project

來源:README.md,提交 a00bb87

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v1.0.31最新Sep 24, 2026
  2. v1.0.30Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分