Skip to main content
Glama

flow-control-mcp

极简、稳定的业务控制原语 MCP Server。

flow-control-mcp 只做一件事:把 Agent/Skill 调用的 flow.* 业务控制工具,写成 .runs/state.json.businessControl 中可验证、可审计、可调度消费的结构化事实。

1. Install

npm install -g flow-control-mcp

本地开发:

npm install
npm run build

Node.js 要求 >=20

Related MCP server: relaycore

2. Generate Claude Code Config

flow-control-mcp config claude --json

输出可作为跨用户共享模板:

{
  "mcpServers": {
    "flow-control-mcp": {
      "command": "flow-control-mcp",
      "args": [],
      "env": {
        "FLOW_MCP_REQ_PATH": "${FLOW_MCP_REQ_PATH}"
      }
    }
  }
}

FLOW_MCP_REQ_PATH 应由 Agent Runtime 按会话注入;不同会话可以注入不同 request path。

前提:目标环境已通过 npm install -g flow-control-mcp 安装,并且 flow-control-mcp 在 Runtime PATH 中可用。Server 启动时仍会校验 Node.js >=20

3. Verify

flow-control-mcp doctor --req-path /absolute/request/path --json

doctor 会检查实际 Node 路径、Node 版本、.runscontrol-context.jsonstate.json、写权限和锁。

开发门禁:

npm run typecheck
npm run build
npm test
npm run test:integration
npm pack --dry-run

打包:

# 默认:不包含 runtime dependencies,安装时由 npm 拉取依赖
npm run pack:default

# 离线部署:包含 runtime dependencies
npm run pack:bundled

Contract

  • Server 名称:flow-control-mcp

  • Tools:flow.finishflow.pauseflow.resumeflow.rewindflow.abort

  • Context:FLOW_MCP_REQ_PATH/.runs/control-context.json

  • State:FLOW_MCP_REQ_PATH/.runs/state.json.businessControl

  • Logs:运行日志只写 stderr;stdout 只用于 MCP 协议或 CLI 输出

最小 control-context.json

{
  "runId": "run-123",
  "stage": "design",
  "actionIndex": 1
}

更多 Claude Code、Linux、Windows 和故障定位说明见 docs/claude-code.md

Skill 中如何调用 5 个业务控制原语见 docs/skill-usage.md

Available Tools

5 tools
flow.abortAbort business flowC
Destructive

Terminate the current business flow without treating it as business failure.

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonYes
messageNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
okYes
serverYes
commandYes
stateYes
runIdYes
stageYes
actionIndexYes
seqYes
updatedAtYes
operationIdYes

TDQS

C2.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructiveHint=true, and the description adds that termination is not treated as failure. However, it does not disclose other behavioral traits like side effects or required permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that communicates the core action and key distinction. No superfluous text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Description covers the basic purpose but lacks details on parameters, usage context, and return values (output schema exists but is not summarized). Adequate for a simple tool, but incomplete for full understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the description provides no explanation of the 'reason' and 'message' parameters. The agent has no semantic hints beyond the schema types and constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'terminate current business flow' and distinguishes from failure by saying 'without treating it as business failure'. This gives a specific verb and resource, but lacks explicit differentiation from siblings like flow.finish.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like flow.finish, flow.pause, etc. The phrase 'without treating it as business failure' hints at a use case but does not provide explicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

flow.finishFinish business executionA
Destructive

End the current business action with an explicit success or failure conclusion.

ParametersJSON Schema
NameRequiredDescriptionDefault
resultYes
reasonNo
messageNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
okYes
serverYes
commandYes
stateYes
runIdYes
stageYes
actionIndexYes
seqYes
updatedAtYes
operationIdYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructiveHint=true and readOnlyHint=false, which align with the description's 'End' and 'conclusion' – implying state modification is final. The description adds the key behavior of explicitly setting success or failure, but does not elaborate on side effects (e.g., irreversible state changes or downstream triggers). No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence containing only essential information. Every word contributes to the core purpose. No extraneous content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that terminates execution, the description is adequate but minimal. It does not explain what happens after ending (e.g., flow cleanup, trigger events), how the result affects the system, or when to use optional parameters. Given output schema exists, return value details are not needed, but behavioral completeness is lacking for a destructive, terminating action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning the description carries the full burden for parameter explanation. However, the description provides no details about the parameters (result, reason, message) beyond what the schema already shows (enum, min/max length). The parameters are simple, but the description fails to add value, e.g., clarifying when to use reason vs message or how they affect the conclusion.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'End the current business action with an explicit success or failure conclusion,' which is a specific verb+resource phrase. The title 'Finish business execution' and the sibling tools (abort, pause, resume, rewind) provide clear differentiation, indicating this tool is for successful or failure-based termination.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly indicates when to use the tool (to end an action with success or failure). It implicitly differentiates from siblings like flow.abort (likely for abnormal termination) and flow.pause/resume (for halting and continuing). However, it lacks explicit 'when not to use' guidance or alternative tool mentions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

flow.pausePause business executionA
Destructive

Pause the current business action while waiting for a user, dependency, or external system.

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonYes
messageNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
okYes
serverYes
commandYes
stateYes
runIdYes
stageYes
actionIndexYes
seqYes
updatedAtYes
operationIdYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructiveHint=true and readOnlyHint=false. Description adds 'while waiting' context but lacks details on state changes, reversibility, or blocking behavior. Adds some value beyond structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, 14 words, front-loaded with essential purpose. No wasted words. Efficiently conveys core action and condition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Provides basic purpose but lacks context for selection among siblings, prerequisites, or handling of repeated pauses. Output schema exists but return behavior is not described. Minimal but adequate for a simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, yet description provides no explanation for 'reason' or 'message' parameters. Fails to compensate for missing schema documentation. Agent cannot infer parameter semantics from description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Pause', resource 'current business action', and condition 'while waiting for a user, dependency, or external system'. Effectively distinguishes from siblings like flow.abort (terminate), flow.finish (complete), flow.resume (continue), flow.rewind (go back).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly mentions when to use (while waiting). Provides clear context but does not specify when not to use or name alternatives beyond sibling list. Implies usage through condition.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

flow.resumeResume business executionB
Destructive

Mark a waiting business action as ready for continued scheduling.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
okYes
serverYes
commandYes
stateYes
runIdYes
stageYes
actionIndexYes
seqYes
updatedAtYes
operationIdYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate modifications (readOnlyHint=false) and destructiveness (destructiveHint=true). The description adds context that it only affects waiting actions and marks them for continued scheduling, but does not elaborate on side effects or irreversibility beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no extraneous words. Every word adds meaning, making it easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has one parameter and output schema, the description is minimal. It omits the message parameter's role, prerequisites (was it paused?), and differentiation from siblings. More detail is needed for proper use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter 'message' has no description in schema (0% coverage) and the tool description does not explain its purpose or usage. The agent receives no guidance on what to provide or how it affects behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (mark as ready) and the resource (a waiting business action). It distinguishes from siblings by using specific verb 'resume', contrasting with abort, finish, pause, rewind.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for resuming a waiting action but does not explicitly state when to use this tool versus alternatives like flow.pause or flow.finish. No when-not or alternative guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

flow.rewindRequest business rewindC
Destructive

Request a rewind to the last stable point or an authorized checkpoint before re-execution.

ParametersJSON Schema
NameRequiredDescriptionDefault
rewindToYes
reasonYes
messageNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
okYes
serverYes
commandYes
stateYes
runIdYes
stageYes
actionIndexYes
seqYes
updatedAtYes
operationIdYes

TDQS

C2.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructiveHint=true, and the description's mention of 'rewind' implies mutation and potential data loss. It adds context about re-execution but does not elaborate on specific effects like what state is affected or if the operation is reversible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence at 14 words. It is front-loaded with the action 'Request a rewind'. No extraneous content, though it could be slightly more structured with separate clauses.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature, complexity of parameters, and relationship to siblings, the description is insufficient. It lacks usage context, does not explain the rewind-to parameter's options, and provides no guidance on when to rewind instead of using alternative flow controls.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description should compensate but only vaguely references 'last stable point or checkpoint' for one parameter. It ignores the reason and message parameters, offering no additional meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool requests a rewind to a stable point or checkpoint, which is a specific action that distinguishes it from sibling tools like abort or resume. However, it could explicitly differentiate from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like flow.abort or flow.pause. It lacks any context about appropriate scenarios or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedflow.abort
    • First observedflow.finish
    • First observedflow.pause
    • First observedflow.resume
    • First observedflow.rewind

TDQS

A3.6/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct action in the flow lifecycle: abort (terminate without failure), finish (end with success/failure), pause (wait), resume (continue), rewind (go back to checkpoint). No overlap.

Naming Consistency5/5

All tool names are single lowercase verbs (flow.abort, flow.finish, etc.), following a consistent verb-only pattern that describes the action clearly.

Tool Count5/5

Five tools is appropriate for managing business flow lifecycle. It covers the essential operations without being excessive or too sparse.

Completeness4/5

The set covers key flow actions (abort, finish, pause, resume, rewind) but is missing a 'start' or 'initiate' tool, assuming flows are started externally. Minor gap for a complete lifecycle.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers