Skip to main content
Glama

Model Worker MCP

本機、受限範圍的 coding worker MCP。它只接受明確的 cwd、read_paths、write_paths,將 provider 回傳的 unified diff 在套用前驗證,並可執行指定驗證命令。

設定

  1. 在使用者環境變數設定 MODEL_WORKER_API_KEY,或執行 npm run credentials:set -- worker-primary(Windows DPAPI 加密儲存)。

  2. 設定 MODEL_WORKER_BASE_URL(任何 OpenAI-compatible /chat/completions endpoint,預設為阿里雲百煉 https://dashscope.aliyuncs.com/compatible-mode/v1;若使用百煉專屬 workspace,改成自己的 workspace endpoint)與 MODEL_WORKER_MODEL。預設主力是 qwen3.7-plus;單檔小修改可切換為 qwen3.6-flash。deepseek-flash-0731 會自動用於中低風險程式邏輯、bug 修復、測試與後端小功能,也支援手動指定。模型名稱與價格表在 worker/router.js、worker/usage-store.js,換 provider 時一併調整。

  3. .mcp.json 以相對路徑啟動 server/server.js;若你的 MCP client 不支援 cwd,把 args 改成此目錄的絕對路徑。

需求:Node.js 18 以上、Git(diff 以 git apply 套用,cwd 必須是 Git repository);驗證命令與 credential 加密目前透過 Windows PowerShell 執行。

Related MCP server: ForgeGuard MCP

本機測試

node server/server.js

MCP 工具:route_code_task、delegate_code_task、get_task_status、cancel_task、get_usage_summary。優先呼叫 route_code_task:CSS/文案/文件等低複雜度任務走 qwen3.6-flash;中低風險程式邏輯、bug 修復、測試與後端小功能走 deepseek-flash-0731;一般或跨檔 coding 走 qwen3.7-plus;審查走 glm-5.2。涉及 auth、payment、secret、migration、database、部署或正式環境時只回傳 guarded,不會自動委派。每個任務的 token、估算費用與失敗錯誤摘要會持久化到 %LOCALAPPDATA%\CodexModelWorker\usage.json,可用 get_usage_summary 查詢。DeepSeek 價格尚未填入,因此其費用會標為未知,不會猜算。錯誤內容會遮罩 Bearer 與 sk- 字串,API key 不會出現在設定檔、任務參數、diff 或 log 中。

License

MIT

Available Tools

5 tools
cancel_taskC

Cancel a running delegated task.

Inputs: task_id (required).

delegate_code_taskC

Run a bounded coding task through the configured provider.

Inputs: cwd (required), task (required), read_paths (required), write_paths (required), +4 more.

get_task_statusB

Get status, diff and validation output for a delegated task.

Inputs: task_id (required).

get_usage_summaryA

Get persisted token usage and estimated CNY cost, optionally filtered by model or time range.

Inputs: model, since, until.

route_code_taskC

Classify a coding task by risk and automatically delegate safe work to the discounted model tier.

Inputs: cwd (required), task (required), read_paths (required), write_paths (required), +4 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 5 tools

    Disambiguation4/5

    route_code_task and delegate_code_task both initiate delegated coding work, which could cause some initial confusion, but the descriptions clarify that one performs risk classification and auto-routing while the other directly runs a bounded task. The remaining tools (status, cancel, usage) are clearly distinct.

    Naming Consistency4/5

    Most tools follow a verb_noun pattern (route_code_task, delegate_code_task, get_task_status, get_usage_summary), but cancel_task breaks the pattern by omitting the 'code' qualifier used by the delegation tools. The set is still readable and predictable overall.

    Tool Count5/5

    Five tools is well-scoped for a task delegation worker: routing, execution, status, cancellation, and usage reporting. Each tool clearly earns its place with no redundancy.

    Completeness4/5

    The core lifecycle is covered: initiate/route, run, check status, cancel, and inspect usage. Minor gaps exist, such as no list/history operation to enumerate past tasks or a retry/resume capability, but these are workable around.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      B
      maintenance
      Enables coding agents to perform workspace-confined file operations, read-only Git inspection, and structured shell commands, while requiring out-of-band human approval for mutations and external executions and maintaining an audit trail.
      14
      3
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables coding agents to safely inspect and modify project files within explicitly allowed workspace roots, with controls for file operations, git status/diff, and optionally allowlisted command execution.
      11
      Apache 2.0
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables a primary coding agent to delegate bounded implementation and repair tasks to a local OpenAI-compatible model that edits a copy of the project, runs configured checks, and returns artifacts for review. Exposes stdio tools for capability discovery, task submission, progress polling, artifact reading, and cancellation.
      MIT