Skip to main content
Glama

Delegation Worker MCP

A universal Worker control plane exposed through MCP. The project keeps host integrations thin: a host such as Codex Official App Server Web only needs to connect this MCP server and render its MCP App. Worker model/provider configuration, secret storage, dynamic model capability discovery, Codex worker execution, progress, steering and cancellation live here.

What v0.1 implements

  • MCP tools for Worker lifecycle: worker_start, worker_status, worker_wait, worker_steer, worker_cancel.

  • A compact MCP App at ui://delegation-worker/control for selecting provider, model, reasoning control, access level and automatic verification.

  • App-only provider management: arbitrary OpenAI-compatible base URL + API key, not hard-coded to New API.

  • AES-256-GCM local secret vault. API keys are never returned by read APIs.

  • Dynamic /v1/models discovery and per-(provider, model) reasoning metadata normalization.

  • No model-name guessing. If the upstream does not advertise reasoning controls, the UI exposes only Auto unless an operator override is configured.

  • A local Responses-compatible gateway that can route many upstream providers and fall back to Chat Completions when Responses is not supported.

  • Codex-native model discovery for Worker route aliases: the gateway exposes a real Codex ModelsResponse, projects explicit/probed third-party tool capability into ModelInfo, and keeps unknown capabilities conservative instead of guessing from model names.

  • Active compatibility probes distinguish native Responses, ordinary function tools (including the wire shape used by MCP tools), and custom/freeform tools required for native apply_patch.

  • A Codex adapter that installs one namespaced provider (delegation_worker_gateway) without changing the user's top-level official model/provider selectors.

  • Third-party workers run as independent official Codex App Server threads, so they can use the Codex workspace/tool harness while official ChatGPT authentication remains separate.

  • Worker status reports a compatibility grade. full-candidate means native Responses plus function and custom/freeform tool schemas were actively accepted; archive-grade parity still requires the real target seal to prove actual tool execution.

Related MCP server: Codex Agent Orchestrator MCP

Product boundary

Codex Web / ChatGPT / OpenClaw / Hermes host
                  |
                  | MCP tools + MCP App
                  v
        Delegation Worker MCP
        - provider profiles
        - secret vault
        - model capability registry
        - worker lifecycle
        - runtime adapters
                  |
          Codex adapter (v0.1)
                  |
         official codex app-server
                  |
     delegation_worker_gateway
                  |
       third-party model provider

Codex-Official-App-Server-Web does not need Worker-specific APIs. It can treat this project as an MCP server. A lightweight /worker or @Worker launcher can invoke the worker_panel tool and let the existing MCP Apps Host render the returned UI resource.

Reasoning controls

Reasoning is model-specific. The registry can normalize:

  • effort scales (low, medium, high, ...);

  • on/off thinking;

  • adaptive modes;

  • budget-style controls.

The source is always retained (upstream_metadata, operator_override, or unknown). Unknown capability means Auto only.

Run

Requirements:

  • Node.js 20+

  • codex installed for Codex worker execution

npm test
npm run check
node mcp/server.mjs

The MCP server uses newline-delimited JSON-RPC over stdio. It also owns a loopback-only local model gateway on 127.0.0.1:8791 by default. Override with DWMCP_GATEWAY_PORT.

Data is stored under:

~/.local/share/delegation-worker-mcp

Override with DWMCP_DATA_DIR.

Connect to Codex

Add this MCP server through the normal Codex MCP configuration/plugin surface, pointing the command at:

scripts/run-mcp.sh

Then open the worker_panel MCP App. On first use, choose Connect Codex. The app-only codex_install operation adds only the namespaced delegation_worker_gateway provider to ~/.codex/config.toml; it does not replace the official provider/model selectors or touch ChatGPT OAuth state.

Provider setup

The compact panel asks for only:

  1. provider name;

  2. API base URL;

  3. API key.

On save, the project calls the provider model catalog, records the models and their explicit metadata, and stores the key encrypted locally. The first adapter supports OpenAI-compatible services such as New API and other compatible gateways. The provider adapter boundary is intentionally separate so native Anthropic/Gemini-style transports can be added without changing MCP or UI contracts.

Security notes

  • Provider configuration tools are marked MCP App-only where supported by the host, so models do not receive secret-management tools in their normal tool surface.

  • API keys are encrypted at rest with a local 256-bit AES-GCM master key and never returned by provider reads.

  • The local model gateway requires its own random bearer token.

  • Worker model/access/reasoning selection is saved by the human-facing panel. worker_start does not accept arbitrary provider/model/access parameters, preventing a model from self-upgrading its configured permissions.

  • danger-full-access is therefore an operator-selected Worker profile setting, not a model-controlled argument.

Current adapter scope

v0.1 fully implements the generic OpenAI-compatible path plus the Codex runtime adapter. Direct native Anthropic/Gemini transports are extension points rather than silently emulated. Providers reachable through an OpenAI-compatible gateway work without New API-specific assumptions.

Available Tools

21 tools
codex_installA

Install/update only the namespaced Delegation Worker provider without changing official top-level model/provider selectors.

Inputs: no named parameters.

codex_statusA
Read-only

Read whether the namespaced Delegation Worker Codex provider is installed.

Inputs: no named parameters.

delegation_statusA
Read-only

Read current session mode, redacted Worker profile, active Worker progress and Codex connection status. NATIVE means Delegation Worker is dormant for this session.

Inputs: no named parameters.

provider_deleteB

Delete a provider profile and its encrypted credential reference.

Inputs: id (required).

provider_model_overrideC

Advanced operator override for reasoning capability when upstream metadata is absent. Provenance remains operator_override.

Inputs: modelId (required), providerId (required), override.

provider_probeB
Read-only

Probe whether a configured provider/model accepts Responses or requires Chat Completions compatibility.

Inputs: id (required), modelId.

provider_refreshC
Read-only

Refresh one provider model catalog and explicit reasoning metadata.

Inputs: id (required).

provider_saveB

Create/update a provider profile and test its model catalog. API keys are encrypted locally and never returned.

Inputs: name (required), baseUrl (required), id, apiKey, +3 more.

session_mode_getA
Read-only

Read whether the current session is NATIVE or WORKER mode.

Inputs: no named parameters.

session_mode_setA

Set NATIVE or WORKER mode for the current session. Switching to NATIVE cancels active Workers for this session.

Inputs: mode (required).

worker_cancelB

Immediately interrupt and cancel an active Worker owned by the current supervisor session.

Inputs: taskId (required), reason.

worker_catalogA
Read-only

Read configured providers, discovered models, and explicitly advertised per-model reasoning controls. Secrets are never returned.

Inputs: refresh.

worker_extendB

Manually renew an active Worker lease within the operator-configured hard runtime limit. Automatic bounded renewal is enabled by default.

Inputs: taskId (required), reason, extraMs.

worker_panelWorkerB
Read-only

Open the Delegation Worker control panel for the current host session.

Inputs: no named parameters.

worker_profile_getA
Read-only

Read the operator-selected Worker model, reasoning, access and supervision settings for the current session.

Inputs: no named parameters.

worker_profile_setC

Save the human-selected Worker provider/model/reasoning/access settings for the current session.

Inputs: modelId (required), providerId (required), access, leaseMs, +4 more.

worker_respondA

Answer or reject a pending official Codex server request surfaced by worker_status. Pass the exact pending requestId and the official response object expected by that request.

Inputs: taskId (required), reason, reject, response, +1 more.

worker_startB

Start the operator-configured Worker for this session. Provider, model, reasoning, access and renewal policy are intentionally not arguments; the human Worker panel owns them.

Inputs: task (required), cwd.

worker_statusB
Read-only

Read a Worker task including current phase, plan, latest action, heartbeat/progress evidence, lease, pending Codex interaction, verifier and result.

Inputs: taskId (required).

worker_steerC

Give an active Worker a precise direction change through official Codex turn/steer.

Inputs: taskId (required), direction (required).

worker_waitB
Read-only

Wait for a Worker task to finish or until the bounded wait window elapses.

Inputs: taskId (required), waitMs.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 21 tools

    Disambiguation3/5

    Several read-status tools overlap: delegation_status aggregates session mode, profile, progress, and Codex state, duplicating session_mode_get, worker_profile_get, and codex_status. worker_status vs delegation_status and worker_catalog vs worker_profile_get also have fuzzy boundaries, though descriptions help somewhat.

    Naming Consistency4/5

    Most tools follow a consistent prefix_noun/prefix_noun_verb snake_case pattern (worker_*, provider_*, codex_*, session_*). The outlier is delegation_status, which breaks the prefix convention and stands apart from the otherwise predictable scheme.

    Tool Count3/5

    21 tools is on the heavy end for a delegation-worker server, and the surface feels bloated with multiple status/getter variants. It is defensible given the multi-domain scope (session, worker, provider, codex), but sits at the borderline-heavy range.

    Completeness4/5

    The surface covers session modes, full worker lifecycle (start/steer/extend/respond/status/wait/cancel), provider management (save/delete/refresh/probe/override), profile get/set, and Codex install/status. Minor gap: no explicit provider-list tool, though worker_catalog partly covers it.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A local-first control plane for AI agent tools, providing policy enforcement, spend caps, rate limiting, and audit trails for MCP servers.
      49 PyPI
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      A local MCP control plane for Codex that manages task queues, dynamic roles, and side-panel team collaboration with persistence, dependency gating, and structured reporting.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Codex to delegate bounded work to external LLMs through role-based MCP tools, with worker health checks and audit logging.
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      MCP control plane for Claude Code, Codex, Cursor, and OpenCode. Supports opt-in quota-aware rotation across multiple native Claude Code or Codex subscription accounts of the same harness, with isolated credentials, separate quotas, and bounded task handoffs.
      525
      MIT