Skip to content

Commit a4cd2e3

Browse files
committed
docs: add MCP configuration requirements for Ali workflow builder
- Add MCP configuration section for sub-agents (agent-coordination) - Add MCP configuration section for controllers (workflow-signals) - Add MCP requirements to step-03-agents.md, workflow.md, quick-workflow.md - Update validation checklists to include MCP verification - Add MCP to success/failure metrics - Update config file generation templates with MCP fields - Add MCP to plan file XML schema
1 parent bf50f09 commit a4cd2e3

File tree

3 files changed

+376
-13
lines changed

3 files changed

+376
-13
lines changed

prompts/templates/ali/chained/step-03-agents.md

Lines changed: 150 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,41 @@ codemachine run \"db 'setup' && frontend & backend\"
430430

431431
---
432432

433+
#### Sub-Agent MCP Configuration (REQUIRED)
434+
435+
"**⚠️ REQUIRED: Agent Coordination MCP**
436+
437+
Any main agent that has sub-agents **MUST** have the `agent-coordination` MCP configured. Without this, the agent cannot spawn or communicate with sub-agents.
438+
439+
**MCP Configuration for '\{agent.name\}':**
440+
441+
```javascript
442+
mcp: [
443+
\{
444+
server: 'agent-coordination',
445+
only: ['run_agents', 'get_agent_status', 'list_available_agents'],
446+
targets: ['\{subAgent1.id\}', '\{subAgent2.id\}', ...],
447+
\},
448+
]
449+
```
450+
451+
**MCP Fields:**
452+
453+
| Field | Required | Description |
454+
|-------|----------|-------------|
455+
| `server` | Yes | Must be `'agent-coordination'` |
456+
| `only` | Yes | Tools to expose: `run_agents`, `get_agent_status`, `list_available_agents` |
457+
| `targets` | Yes | Array of sub-agent IDs this agent can invoke |
458+
459+
**Important:**
460+
- The `targets` array must list ALL sub-agent IDs this agent can call
461+
- Both `subAgentIds` in workflow AND `mcp` on the agent must be configured
462+
- Sub-agents are defined in `config/sub.agents.js`"
463+
464+
Store MCP config as `agents[n].mcp`.
465+
466+
---
467+
433468
### 4d. Controller Agent (If Autonomous Mode)
434469

435470
*[Skip this section entirely if `controller = false` from Step 02]*
@@ -440,7 +475,9 @@ codemachine run \"db 'setup' && frontend & backend\"
440475

441476
You enabled autonomous mode with a controller in Step 02. The controller is the brain of autonomous execution - it responds on behalf of the user and drives the entire workflow.
442477

443-
**⚠️ This configuration is critical.** A poorly configured controller will cause workflow failures, wasted tokens, and endless loops. Let's design it carefully."
478+
**⚠️ This configuration is critical.** A poorly configured controller will cause workflow failures, wasted tokens, and endless loops. Let's design it carefully.
479+
480+
**⚠️ MCP REQUIRED:** Both the controller AND all step agents must have `workflow-signals` MCP configured for autonomous mode to work. Step agents propose completion, controller approves or rejects. We'll configure this automatically."
444481

445482
---
446483

@@ -684,6 +721,69 @@ Wait. Store as `controller.loopDepth`.
684721

685722
---
686723

724+
#### 4c.5b Workflow Signals MCP Configuration (REQUIRED)
725+
726+
"**⚠️ REQUIRED: Workflow Signals MCP**
727+
728+
For autonomous mode to work, both the controller AND all step agents must have the `workflow-signals` MCP configured. This is how they communicate.
729+
730+
**How it works:**
731+
1. Step agent completes work → proposes completion via MCP
732+
2. Controller receives proposal → approves or rejects
733+
3. If approved → workflow advances to next step
734+
4. If rejected → step agent continues or retries
735+
736+
**Controller MCP Configuration:**
737+
738+
```javascript
739+
mcp: [
740+
\{
741+
server: 'workflow-signals',
742+
only: ['approve_step_transition', 'get_pending_proposal'],
743+
\},
744+
]
745+
```
746+
747+
**Step Agent MCP Configuration (for ALL step agents):**
748+
749+
```javascript
750+
mcp: [
751+
\{
752+
server: 'workflow-signals',
753+
only: ['propose_step_completion'],
754+
\},
755+
]
756+
```
757+
758+
**MCP Fields:**
759+
760+
| Field | Required | Description |
761+
|-------|----------|-------------|
762+
| `server` | Yes | Must be `'workflow-signals'` |
763+
| `only` | Yes | Tools to expose (different for controller vs step agents) |
764+
765+
**Controller Tools:**
766+
| Tool | Description |
767+
|------|-------------|
768+
| `approve_step_transition` | Approve step completion and advance workflow |
769+
| `get_pending_proposal` | Check if a step agent has proposed completion |
770+
771+
**Step Agent Tools:**
772+
| Tool | Description |
773+
|------|-------------|
774+
| `propose_step_completion` | Signal that step work is done, request controller approval |
775+
776+
**Important:**
777+
- WITHOUT this MCP, autonomous mode will not function
778+
- Controller cannot receive proposals without `workflow-signals`
779+
- Step agents cannot signal completion without `workflow-signals`
780+
- This is configured automatically when you confirm the controller"
781+
782+
Store controller MCP as `controller.mcp`.
783+
Mark all step agents to receive workflow-signals MCP: `agents[*].mcp = workflow-signals-step`.
784+
785+
---
786+
687787
#### 4c.6 Controller Summary
688788

689789
"**Controller Configuration Complete!**
@@ -1225,6 +1325,22 @@ module.exports = [
12251325
engine: '\{agent.engine\}',
12261326
model: '\{agent.model\}',
12271327
modelReasoningEffort: '\{agent.modelReasoningEffort\}', // Only for codex
1328+
// MCP Configuration - REQUIRED if agent has sub-agents
1329+
mcp: [
1330+
\{
1331+
server: 'agent-coordination',
1332+
only: ['run_agents', 'get_agent_status', 'list_available_agents'],
1333+
targets: ['\{subAgent1.id\}', '\{subAgent2.id\}'],
1334+
\},
1335+
],
1336+
// MCP Configuration - REQUIRED if controller enabled (autonomous mode)
1337+
// Add to ALL step agents when controller is enabled:
1338+
mcp: [
1339+
\{
1340+
server: 'workflow-signals',
1341+
only: ['propose_step_completion'],
1342+
\},
1343+
],
12281344
\},
12291345
];
12301346
```
@@ -1305,6 +1421,13 @@ module.exports = [
13051421
// Only if non-default engine
13061422
engine: '\{controller.engine\}',
13071423
model: '\{controller.model\}',
1424+
// MCP Configuration - REQUIRED for controller
1425+
mcp: [
1426+
\{
1427+
server: 'workflow-signals',
1428+
only: ['approve_step_transition', 'get_pending_proposal'],
1429+
\},
1430+
],
13081431
\},
13091432
```
13101433

@@ -1567,6 +1690,19 @@ module.exports = [
15671690
<model>\{model or null if using default\}</model>
15681691
<model-reasoning-effort>\{low|medium|high\}</model-reasoning-effort> <!-- Only for codex -->
15691692

1693+
<!-- MCP Configuration (REQUIRED if agent has sub-agents OR if controller enabled) -->
1694+
<mcp>
1695+
<!-- For agents with sub-agents: agent-coordination -->
1696+
<server name="agent-coordination">
1697+
<tools>run_agents, get_agent_status, list_available_agents</tools>
1698+
<targets>\{sub-agent-id-1\}, \{sub-agent-id-2\}</targets>
1699+
</server>
1700+
<!-- For step agents when controller enabled: workflow-signals -->
1701+
<server name="workflow-signals">
1702+
<tools>propose_step_completion</tools>
1703+
</server>
1704+
</mcp>
1705+
15701706
<!-- Character Configuration -->
15711707
<character style="\{style-name or 'custom'\}">
15721708
<base-face>\{baseFace\}</base-face>
@@ -1674,6 +1810,13 @@ module.exports = [
16741810
<engine>\{controller.engine\}</engine>
16751811
<model>\{controller.model or null\}</model>
16761812

1813+
<!-- MCP Configuration - REQUIRED for controller -->
1814+
<mcp>
1815+
<server name="workflow-signals">
1816+
<tools>approve_step_transition, get_pending_proposal</tools>
1817+
</server>
1818+
</mcp>
1819+
16771820
<!-- Communication Efficiency -->
16781821
<communication
16791822
response-length="\{minimal|brief|detailed\}"
@@ -1745,6 +1888,7 @@ Press **Enter** to proceed to the next step."
17451888
- Static: persona, instructions, expected input/output, success/failure indicators
17461889
- Dynamic: generation instructions, trigger condition
17471890
- MCP/CLI invocation documented in Expert mode
1891+
- **Agent-coordination MCP configured on parent agent (REQUIRED)**
17481892
- **Engine configured for each agent**
17491893
- **Model configured (or default used) for each agent**
17501894
- **Reasoning effort configured for codex agents**
@@ -1766,6 +1910,8 @@ Press **Enter** to proceed to the next step."
17661910
- Failure indicators (signals to retry/reject)
17671911
- Communication efficiency configured (response length, total turn limit)
17681912
- Behavior configured (pacing, loop depth)
1913+
- **Workflow-signals MCP configured on controller (REQUIRED)**
1914+
- **Workflow-signals MCP configured on ALL step agents (REQUIRED)**
17691915
- Summary reviewed and confirmed
17701916
- **Config files generated:**
17711917
- `config/main.agents.js` updated for regular agents
@@ -1786,6 +1932,7 @@ Press **Enter** to proceed to the next step."
17861932
- **Missing module config fields for modules (loopSteps, loopMaxIterations)**
17871933
- **Not asking about sub-agents for agents that may need them**
17881934
- **Missing sub-agent configuration (static: persona, instructions; dynamic: generation instructions)**
1935+
- **Not configuring agent-coordination MCP on agents with sub-agents (REQUIRED)**
17891936
- **Not explaining MCP/CLI invocation in Expert mode**
17901937
- **Not asking about engine for each agent**
17911938
- **Not asking about reasoning effort for codex agents**
@@ -1800,6 +1947,8 @@ Press **Enter** to proceed to the next step."
18001947
- **Not showing full workflow context (tracks, conditions, agents) to user during controller setup**
18011948
- **Not defining agent interactions for EACH main agent**
18021949
- **Missing critical controller fields (max turns, approval criteria, expected output, expected behavior, success/failure indicators)**
1950+
- **Not configuring workflow-signals MCP on controller (REQUIRED - autonomous mode will not work)**
1951+
- **Not configuring workflow-signals MCP on step agents when controller enabled (REQUIRED)**
18031952
- **Not configuring communication efficiency (allows token waste)**
18041953
- **Not generating config files after user confirmation**
18051954
- Proceeding without user confirmation

0 commit comments

Comments
 (0)