workflow-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LLM_MODEL | No | Default model to use for LLM calls. | |
| LLM_API_KEY | No | API key for the LLM endpoint. Required for auto execution mode (Plan A). | |
| LLM_BASE_URL | No | Base URL for the LLM endpoint (OpenAI-compatible or Anthropic). Required for auto execution mode (Plan A). | |
| LLM_PROTOCOL | No | Protocol for LLM calls: 'openai' or 'anthropic'. Auto-detected from URL if not set. | openai |
| LLM_MAX_TOKENS | No | max_tokens parameter for Anthropic protocol. | 4096 |
| WORKFLOW_TOOLS | No | Comma-separated server-level tool whitelist that overrides the default tool set for all steps. | |
| WORKFLOW_ALLOW_NET | No | Set to '1' to enable fetch_url networking (default off). | 0 |
| LLM_MAX_CONCURRENCY | No | Maximum number of concurrent LLM calls within a batch. | 4 |
| WORKFLOW_ALLOW_DANGEROUS | No | Set to '1' to allow dangerous bash commands (default blocked). | 0 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
确定性工作流编排:DAG + 布尔门 + 断点续跑。 手动循环:create_workflow → 循环 { next_step → 做事 → complete_step } → validate_workflow。 自动执行:把步骤标记 mode="auto" 后调 run_workflow(配置 LLM_BASE_URL/LLM_API_KEY 时服务器内 agent 循环执行;未配置则返回派发批次,由宿主并行派子代理后 complete_step 回填)。 每步可用 gate(如 "A && !B",只允许引用直接依赖)控制分支:依赖落定后求值一次,为假则自动跳过。
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| create_workflowA | 新建工作流。steps 为数组,每项 {id?, title, instruction?, dependsOn?, gate?, mode?, agentPrompt?, model?, timeoutMs?, maxRetries?, tools?, maxTurns?, outputSchema?, verify?, sandboxCwd?};gate 是布尔表达式(支持 && || ! 和括号),只允许引用该步骤的直接依赖,依赖落定后求值为假则该步骤被自动跳过。mode=auto 的步骤可被 run_workflow 自动执行:每个 auto 步骤由服务器内 agent 循环驱动(多轮工具调用:读/写文件、列目录、grep、bash、fetch_url,全部限定在 sandboxCwd 沙箱内);tools 为该步工具白名单,maxTurns 为循环轮数上限(默认取 WORKFLOW_MAX_TURNS,8),outputSchema 为结果 JSON Schema(不符自动重试一轮),verify 为完成后的质量关(JS 布尔断言或 reviewer 提示词),sandboxCwd 覆盖该步沙箱目录。顶层 finalVerify(提示词)在全部步骤落定后做整体一致性检查。创建时即做结构、环与 id 合法性校验。 |
| list_workflowsA | 列出全部工作流及各自进度(单个文件损坏时只标注该条,不影响整体列表)。 |
| get_workflowB | 读取工作流全文。format=json 返回结构化对象(含每步六态状态、结果与当前 ready 列表),format=md 额外返回人类可读的 WORKFLOW.md(含 mermaid 图)。 |
| next_stepB | 编译依赖图,返回当前可立即执行(READY)的步骤。这是执行循环的入口:next_step → 做事 → complete_step → 循环。 |
| complete_stepB | 提交步骤结果并完成该步骤;Runtime 随即自动求值下游门条件(假则跳过),并返回新的 READY 步骤。result 建议传结构化 JSON(摘要、数字、产出物路径等)。 |
| skip_stepB | 人工跳过某个未完成步骤(会触发下游门条件重算)。 |
| undo_stepB | 撤销某步骤及其全部下游(传递依赖)的完成/跳过/失败状态与结果,用于返工。 |
| workflow_statusB | 进度总览:完成/跳过/失败/运行中/待办计数及每步一行状态。 |
| validate_workflowA | 确定性结构校验(不调用模型):重复 id、非法 id 字符、悬空依赖、自依赖、门条件引用非直接依赖、依赖环。 |
| delete_workflowA | 归档删除工作流(移入 trash 目录,可用 restore_workflow 恢复)。 |
| list_trashA | 列出归档删除(trash 目录)里的工作流,供恢复时挑选。 |
| restore_workflowA | 从归档(trash)恢复一条工作流。id 可以是原工作流 id(取最近一次删除)或 trash 里的文件名;目标 id 已存在时需 overwrite=true。 |
| run_workflowA | 自动执行工作流:编译 READY 步骤,互不依赖的 auto 步骤批内并行、批间串行;跑完自动推进门条件,循环直到完成/卡住,全程可断点续跑(已 done 的步骤绝不重跑)。每个 auto 步骤由服务器内 agent 循环执行(多轮工具调用:读写文件/列目录/grep/bash/fetch_url,限定在沙箱内),之后过 outputSchema/verify 质量关;配了 finalVerify 且全部落定后做整体一致性检查。方案A(配置了 LLM_BASE_URL/LLM_API_KEY 时)直调 LLM API,支持 OpenAI 与 Anthropic 兼容端点(LLM_PROTOCOL 或按 URL 识别);未配置密钥或 mode=dispatch 时自动退化为方案B(返回派发批次,由宿主并行执行后 complete_step 回填)。某步失败(含质量关未过)按 maxRetries 重试后仍失败则只标记该步 failed(视为落定、门条件中为 false),其余分支照常推进,不会整条流崩;manual 步骤不会被代跑,会提示待人工处理。同一条流同时只允许一个执行,运行中可用 cancel_run 打断。 |
| dispatch_batchesA | 方案B入口:返回当前可并行的步骤批次 [{stepIds, prompts, upstreamResults}](批内并行、批间串行,按"全部成功"投影分组)+ runtimeDefaults(服务器级默认模型/超时/轮数/工具),宿主 agent 拿批次并行派子代理执行,每个完成后用 complete_step 回填;若中途有失败/跳过导致门条件变化,重新调用本工具取新批次。 |
| cancel_runB | 取消/打断当前 run_workflow 的自动执行:在途请求中止,运行中的步骤回到待办状态(续跑时会重新执行)。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Most tools target a clearly distinct resource+action (create/list/get/delete/restore/validate a workflow; next/complete/skip/undo a step). The main overlap is the trio of execution entry points — next_step, run_workflow, and dispatch_batches — plus workflow_status vs. get_workflow(format=md) vs. list_workflows progress, which all surface progress information; the descriptions do explain the mode split (方案A auto-run vs. 方案B host dispatch vs. manual loop), so an agent can recover, but it requires reading carefully.
Predominantly snake_case with a resource-oriented prefix (create/list/get/delete/restore/validate/run_workflow, list_trash, cancel_run). Deviations are minor: the step tools put the action first (next_step, complete_step, skip_step, undo_step) and workflow_status is noun_noun rather than verb_noun, but each grouping is internally coherent and readable.
15 tools sits at the top of the well-scoped range and is defensible for a DAG workflow engine with a step-execution loop. There is some redundancy that nudges it below ideal — workflow_status largely repeats what get_workflow/list_workflows already expose, and dispatch_batches is only meaningful in the no-API-key fallback mode.
Lifecycle for instances is strong (create, list, get, validate, delete/archive, restore, plus skip/undo for rework and cancel_run for interruption). The notable gap is definition mutation: there is no update/edit_workflow or add/remove-step tool, so a workflow's steps, gates, or finalVerify can only be changed by delete-and-recreate — a classic create+get-but-no-update hole. Secondary gaps: no explicit fail_step/mark-failed operation outside run_workflow, and no trash purge.