@ema.co/mcp-toolkit 2026.1.25 → 2026.1.26-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @ema.co/mcp-toolkit might be problematic. Click here for more details.
- package/README.md +10 -2
- package/dist/mcp/handlers/action/index.js +3 -18
- package/dist/mcp/handlers/data/index.js +385 -41
- package/dist/mcp/handlers/data/templates.js +107 -0
- package/dist/mcp/handlers/deprecation.js +50 -0
- package/dist/mcp/handlers/env/index.js +8 -4
- package/dist/mcp/handlers/knowledge/index.js +44 -237
- package/dist/mcp/handlers/persona/create.js +47 -18
- package/dist/mcp/handlers/persona/index.js +14 -11
- package/dist/mcp/handlers/persona/update.js +4 -2
- package/dist/mcp/handlers/persona/version.js +234 -0
- package/dist/mcp/handlers/sync/index.js +3 -18
- package/dist/mcp/handlers/template/index.js +75 -10
- package/dist/mcp/handlers/workflow/analyze.js +171 -0
- package/dist/mcp/handlers/workflow/compare.js +70 -0
- package/dist/mcp/handlers/workflow/deploy.js +73 -0
- package/dist/mcp/handlers/workflow/generate.js +350 -0
- package/dist/mcp/handlers/workflow/index.js +294 -0
- package/dist/mcp/handlers/workflow/modify.js +456 -0
- package/dist/mcp/handlers/workflow/optimize.js +136 -0
- package/dist/mcp/handlers/workflow/types.js +4 -0
- package/dist/mcp/handlers/workflow/utils.js +30 -0
- package/dist/mcp/handlers-consolidated.js +73 -2696
- package/dist/mcp/prompts.js +83 -43
- package/dist/mcp/resources.js +382 -57
- package/dist/mcp/server.js +199 -391
- package/dist/mcp/{tools-v2.js → tools.js} +20 -54
- package/dist/mcp/workflow-operations.js +2 -2
- package/dist/sdk/client-adapter.js +267 -32
- package/dist/sdk/client.js +45 -16
- package/dist/sdk/ema-client.js +183 -0
- package/dist/sdk/generated/deprecated-actions.js +171 -0
- package/dist/sdk/generated/template-fallbacks.js +123 -0
- package/dist/sdk/guidance.js +65 -11
- package/dist/sdk/index.js +3 -1
- package/dist/sdk/knowledge.js +139 -86
- package/dist/sdk/workflow-intent.js +27 -0
- package/dist/sdk/workflow-transformer.js +0 -342
- package/docs/mcp-tools-guide.md +37 -45
- package/package.json +10 -4
- package/dist/mcp/handlers/persona/analyze.js +0 -275
- package/dist/mcp/handlers/persona/compare.js +0 -32
- package/dist/mcp/tools-consolidated.js +0 -875
- package/dist/mcp/tools-legacy.js +0 -736
- package/docs/CODEBASE-ANALYSIS-2026-01-23.md +0 -936
- package/docs/CODEBASE-ANALYSIS-PRIORITIZED.md +0 -774
- package/docs/api-contracts.md +0 -216
- package/docs/auto-builder-analysis.md +0 -271
- package/docs/blog/mcp-tool-design-lessons.md +0 -309
- package/docs/data-architecture.md +0 -166
- package/docs/demos/ap-invoice-generation.md +0 -347
- package/docs/demos/ap-invoice-processing.md +0 -271
- package/docs/ema-auto-builder-guide.html +0 -394
- package/docs/lessons-learned.md +0 -209
- package/docs/llm-native-workflow-design.md +0 -252
- package/docs/local-generation.md +0 -508
- package/docs/mcp-flow-diagram.md +0 -135
- package/docs/migration/action-composition-migration.md +0 -270
- package/docs/naming-conventions.md +0 -278
- package/docs/proposals/HANDOFF-tool-restructure.md +0 -526
- package/docs/proposals/action-composition.md +0 -490
- package/docs/proposals/explicit-method-restructure.md +0 -328
- package/docs/proposals/mcp-tool-restructure-2026-01.md +0 -366
- package/docs/proposals/self-contained-guidance.md +0 -427
- package/docs/proto-sdk-generation.md +0 -242
- package/docs/release-impact.md +0 -102
- package/docs/release-process.md +0 -157
- package/docs/staging.RULE.md +0 -142
- package/docs/test-persona-creation.md +0 -196
- package/docs/tool-consolidation-v2.md +0 -225
- package/docs/tool-response-standards.md +0 -256
- package/resources/demo-kits/README.md +0 -175
- package/resources/demo-kits/finance-ap/manifest.json +0 -150
- package/resources/demo-kits/tags.json +0 -91
- package/resources/docs/getting-started.md +0 -97
- package/resources/templates/auto-builder-rules.md +0 -224
- package/resources/templates/chat-ai/README.md +0 -119
- package/resources/templates/chat-ai/persona-config.json +0 -111
- package/resources/templates/dashboard-ai/README.md +0 -156
- package/resources/templates/dashboard-ai/persona-config.json +0 -180
- package/resources/templates/demo-scenarios/README.md +0 -63
- package/resources/templates/demo-scenarios/test-published-package.md +0 -116
- package/resources/templates/document-gen-ai/README.md +0 -132
- package/resources/templates/document-gen-ai/persona-config.json +0 -316
- package/resources/templates/voice-ai/README.md +0 -123
- package/resources/templates/voice-ai/persona-config.json +0 -74
- package/resources/templates/voice-ai/workflow-prompt.md +0 -121
package/dist/mcp/prompts.js
CHANGED
|
@@ -338,15 +338,19 @@ Environment: ${args.env || "demo"}
|
|
|
338
338
|
|
|
339
339
|
Follow this review workflow using the consolidated tools:
|
|
340
340
|
|
|
341
|
-
### Step 1: Fetch
|
|
342
|
-
Call \`
|
|
341
|
+
### Step 1: Fetch Workflow Data
|
|
342
|
+
Call \`workflow(mode="get", persona_id="${args.persona_id}", env="${args.env || "demo"}")\` to get the workflow_def, schema, and examples.
|
|
343
343
|
|
|
344
|
-
### Step 2: Analyze (
|
|
345
|
-
|
|
344
|
+
### Step 2: Analyze (YOU do this)
|
|
345
|
+
Review the workflow_def for:
|
|
346
|
+
- Missing WORKFLOW_OUTPUT (required for activation)
|
|
347
|
+
- Missing Fallback category in categorizers
|
|
348
|
+
- Type mismatches between connected nodes
|
|
349
|
+
- Orphan nodes not connected to output
|
|
346
350
|
|
|
347
|
-
### Step 3:
|
|
348
|
-
If issues are found
|
|
349
|
-
Call \`workflow(mode="
|
|
351
|
+
### Step 3: Propose Fixes
|
|
352
|
+
If issues are found, generate a corrected workflow_def and deploy:
|
|
353
|
+
Call \`workflow(mode="deploy", persona_id="${args.persona_id}", workflow_def={...}, env="${args.env || "demo"}")\`.
|
|
350
354
|
|
|
351
355
|
## Output Format
|
|
352
356
|
|
|
@@ -456,9 +460,9 @@ ${args.symptoms.toLowerCase().includes("hitl") || args.symptoms.toLowerCase().in
|
|
|
456
460
|
` : ""}
|
|
457
461
|
${args.symptoms.toLowerCase().includes("type") || args.symptoms.toLowerCase().includes("mismatch") ? `
|
|
458
462
|
**Type Compatibility Issues:**
|
|
459
|
-
- Call \`workflow(mode="
|
|
463
|
+
- Call \`workflow(mode="get", persona_id="${args.persona_id}", env="${args.env || "demo"}")\` and analyze the workflow_def
|
|
464
|
+
- Check wellKnownType compatibility between connected nodes
|
|
460
465
|
- Common issues: chat_conversation → search (should be user_query)
|
|
461
|
-
- Check wellKnownType compatibility
|
|
462
466
|
` : ""}
|
|
463
467
|
${args.symptoms.toLowerCase().includes("loop") || args.symptoms.toLowerCase().includes("infinite") || args.symptoms.toLowerCase().includes("hang") ? `
|
|
464
468
|
**Loop/Hang Issues:**
|
|
@@ -467,8 +471,8 @@ ${args.symptoms.toLowerCase().includes("loop") || args.symptoms.toLowerCase().in
|
|
|
467
471
|
- Verify workflow has proper termination paths
|
|
468
472
|
` : ""}
|
|
469
473
|
|
|
470
|
-
### Step 4:
|
|
471
|
-
Call \`workflow(mode="
|
|
474
|
+
### Step 4: Review Workflow
|
|
475
|
+
Call \`workflow(mode="get", persona_id="${args.persona_id}", env="${args.env || "demo"}")\` and analyze the workflow_def for issues.
|
|
472
476
|
|
|
473
477
|
### Step 5: Propose Fix
|
|
474
478
|
Based on findings, provide specific fix with before/after configuration.
|
|
@@ -642,13 +646,15 @@ Call in parallel:
|
|
|
642
646
|
- \`persona(id="${args.persona_id_1}", include_workflow=true, env="${args.env_1 || "demo"}")\`
|
|
643
647
|
- \`persona(id="${args.persona_id_2}", include_workflow=true, env="${args.env_2 || args.env_1 || "demo"}")\`
|
|
644
648
|
|
|
645
|
-
### Step 2:
|
|
646
|
-
Call \`persona(
|
|
649
|
+
### Step 2: Get Both Personas
|
|
650
|
+
Call \`persona(method="get", id="${args.persona_id_1}", include_workflow=true, env="${args.env_1 || "demo"}")\`
|
|
651
|
+
Call \`persona(method="get", id="${args.persona_id_2}", include_workflow=true, env="${args.env_2 || args.env_1 || "demo"}")\`
|
|
647
652
|
|
|
648
|
-
### Step 3: Compare
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
653
|
+
### Step 3: Compare (YOU do this)
|
|
654
|
+
Compare the two workflow_def structures:
|
|
655
|
+
- Node differences (added/removed/renamed)
|
|
656
|
+
- Connection differences
|
|
657
|
+
- Configuration differences
|
|
652
658
|
|
|
653
659
|
## Output Format
|
|
654
660
|
|
|
@@ -754,8 +760,9 @@ ${args.action === "snapshot" ? `
|
|
|
754
760
|
1. List versions first to see available:
|
|
755
761
|
\`persona(id="${args.persona_id}", mode="version_list", env="${args.env || "demo"}")\`
|
|
756
762
|
|
|
757
|
-
2.
|
|
758
|
-
\`persona(id="${args.persona_id}", mode="
|
|
763
|
+
2. Get two versions and compare (YOU compare the results):
|
|
764
|
+
\`persona(id="${args.persona_id}", mode="version_get", version="${args.version || "v1"}", env="${args.env || "demo"}")\`
|
|
765
|
+
\`persona(id="${args.persona_id}", mode="version_get", version="latest", env="${args.env || "demo"}")\`
|
|
759
766
|
|
|
760
767
|
3. Present changes:
|
|
761
768
|
- Fields that changed
|
|
@@ -937,7 +944,7 @@ Provide examples of common tasks:
|
|
|
937
944
|
2. **Search for specific persona**: \`persona(query="support", status="active", env="demo")\`
|
|
938
945
|
3. **Get full persona details**: \`persona(id="xxx", include_workflow=true, env="demo")\`
|
|
939
946
|
4. **Sync a persona**: \`sync(id="my-bot", source="demo", target="dev")\`
|
|
940
|
-
5. **
|
|
947
|
+
5. **Get workflow data**: \`workflow(mode="get", persona_id="xxx", env="demo")\` (you analyze the result)
|
|
941
948
|
|
|
942
949
|
## Output Format
|
|
943
950
|
|
|
@@ -1027,11 +1034,19 @@ ${args.intents ? `**Intents**: ${args.intents}` : ""}
|
|
|
1027
1034
|
|
|
1028
1035
|
## Instructions
|
|
1029
1036
|
|
|
1030
|
-
### Step
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
-
|
|
1037
|
+
### Step 0: Check Deprecated Actions (DO THIS FIRST)
|
|
1038
|
+
Fetch \`ema://rules/deprecated-actions-summary\` to know which actions to AVOID.
|
|
1039
|
+
|
|
1040
|
+
**Key deprecated actions to avoid:**
|
|
1041
|
+
- search/v0 → use search/v2 (requires datastore_configs)
|
|
1042
|
+
- respond_with_sources → use respond_for_external_actions
|
|
1043
|
+
- call_llm/v0 → use call_llm/v2
|
|
1044
|
+
- web_search/v0 → use live_web_search or ai_web_search
|
|
1045
|
+
|
|
1046
|
+
### Step 1: Get Templates
|
|
1047
|
+
Get templates from API or use generated fallbacks:
|
|
1048
|
+
- \`template(config="voice")\` - Voice AI persona configuration (API-first with fallback)
|
|
1049
|
+
- \`ema://catalog/persona-templates\` - Live API templates
|
|
1035
1050
|
- \`ema://catalog/agents-summary\` - Available agents for workflow composition
|
|
1036
1051
|
|
|
1037
1052
|
### Step 2: Read Validation Rules (Resources)
|
|
@@ -1056,16 +1071,18 @@ Using the templates from Step 1 and guidance from Steps 3-4, generate:
|
|
|
1056
1071
|
**Folder structure:**
|
|
1057
1072
|
\`\`\`
|
|
1058
1073
|
${args.name.toLowerCase().replace(/\s+/g, "-")}/
|
|
1059
|
-
├── README.md # Deployment guide
|
|
1060
|
-
├── workflow-prompt.md # Auto Builder prompt
|
|
1061
|
-
├── persona-config.json # Voice settings (
|
|
1074
|
+
├── README.md # Deployment guide
|
|
1075
|
+
├── workflow-prompt.md # Auto Builder prompt
|
|
1076
|
+
├── persona-config.json # Voice settings (from template(config="voice"))
|
|
1062
1077
|
└── proto-config.json # Full API config
|
|
1063
1078
|
\`\`\`
|
|
1064
1079
|
|
|
1080
|
+
**IMPORTANT**: Only use non-deprecated actions from Step 0.
|
|
1081
|
+
|
|
1065
1082
|
### Step 6: Validate
|
|
1066
1083
|
Call \`reference(validate_prompt=<generated_prompt>)\` to verify the prompt.
|
|
1067
1084
|
|
|
1068
|
-
Now begin by reading the
|
|
1085
|
+
Now begin by reading the deprecated actions, then proceed with generation.`,
|
|
1069
1086
|
},
|
|
1070
1087
|
},
|
|
1071
1088
|
],
|
|
@@ -1108,10 +1125,19 @@ ${args.data_sources ? `**Data Sources**: ${args.data_sources}` : ""}
|
|
|
1108
1125
|
|
|
1109
1126
|
## Instructions
|
|
1110
1127
|
|
|
1111
|
-
### Step
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1128
|
+
### Step 0: Check Deprecated Actions (DO THIS FIRST)
|
|
1129
|
+
Fetch \`ema://rules/deprecated-actions-summary\` to know which actions to AVOID.
|
|
1130
|
+
|
|
1131
|
+
**Key deprecated actions to avoid:**
|
|
1132
|
+
- search/v0 → use search/v2 (requires datastore_configs)
|
|
1133
|
+
- respond_with_sources → use respond_for_external_actions
|
|
1134
|
+
- call_llm/v0 → use call_llm/v2
|
|
1135
|
+
- web_search/v0 → use live_web_search or ai_web_search
|
|
1136
|
+
|
|
1137
|
+
### Step 1: Get Templates
|
|
1138
|
+
Get templates from API or use generated fallbacks:
|
|
1139
|
+
- \`template(config="chat")\` - Chat AI persona configuration (API-first with fallback)
|
|
1140
|
+
- \`ema://catalog/persona-templates\` - Live API templates
|
|
1115
1141
|
- \`ema://catalog/agents-summary\` - Available agents for workflow composition
|
|
1116
1142
|
- \`ema://catalog/patterns\` - Common workflow patterns
|
|
1117
1143
|
|
|
@@ -1131,12 +1157,14 @@ Call \`reference(guidance="conversation-vs-query")\` to understand:
|
|
|
1131
1157
|
### Step 5: Generate Output
|
|
1132
1158
|
Using the templates from Step 1 and guidance from Steps 3-4, generate:
|
|
1133
1159
|
|
|
1160
|
+
**IMPORTANT**: Only use non-deprecated actions from Step 0.
|
|
1161
|
+
|
|
1134
1162
|
**Folder structure:**
|
|
1135
1163
|
\`\`\`
|
|
1136
1164
|
${args.name.toLowerCase().replace(/\s+/g, "-")}/
|
|
1137
|
-
├── README.md # Deployment guide
|
|
1165
|
+
├── README.md # Deployment guide
|
|
1138
1166
|
├── workflow-prompt.md # Auto Builder prompt
|
|
1139
|
-
├── persona-config.json # Chat settings (
|
|
1167
|
+
├── persona-config.json # Chat settings (from template(config="chat"))
|
|
1140
1168
|
└── docs/ # Knowledge base documents
|
|
1141
1169
|
└── _metadata.json
|
|
1142
1170
|
\`\`\`
|
|
@@ -1184,6 +1212,16 @@ Now begin by reading the resources, then proceed with generation.`,
|
|
|
1184
1212
|
**Type**: ${args.type}
|
|
1185
1213
|
**Description**: ${args.description}
|
|
1186
1214
|
|
|
1215
|
+
## Step 0: Check Deprecated Actions (DO THIS FIRST)
|
|
1216
|
+
|
|
1217
|
+
Fetch \`ema://rules/deprecated-actions-summary\` to see which actions to AVOID.
|
|
1218
|
+
|
|
1219
|
+
Common deprecated actions:
|
|
1220
|
+
- search/v0 → use search/v2 (requires datastore_configs)
|
|
1221
|
+
- respond_with_sources → use respond_for_external_actions
|
|
1222
|
+
- call_llm/v0 → use call_llm/v2
|
|
1223
|
+
- web_search/v0 → use live_web_search or ai_web_search
|
|
1224
|
+
|
|
1187
1225
|
## Step 1: Preview the workflow
|
|
1188
1226
|
|
|
1189
1227
|
\`\`\`
|
|
@@ -1194,6 +1232,7 @@ workflow(
|
|
|
1194
1232
|
\`\`\`
|
|
1195
1233
|
|
|
1196
1234
|
This returns workflow_def and proto_config. Review them before deploying.
|
|
1235
|
+
**Check for any deprecated actions in the generated workflow.**
|
|
1197
1236
|
|
|
1198
1237
|
## Step 2: Deploy when ready
|
|
1199
1238
|
|
|
@@ -1350,8 +1389,7 @@ ${args.workflow_def ? `**Workflow Definition**: Provided inline` : ""}
|
|
|
1350
1389
|
${args.persona_id ? `First, fetch the workflow:
|
|
1351
1390
|
\`persona(id="${args.persona_id}", include_workflow=true, env="${args.env || "demo"}")\`
|
|
1352
1391
|
|
|
1353
|
-
Then
|
|
1354
|
-
\`workflow(persona_id="${args.persona_id}", mode="analyze", env="${args.env || "demo"}")\`
|
|
1392
|
+
Then review the workflow_def for issues (missing WORKFLOW_OUTPUT, type mismatches, etc.).
|
|
1355
1393
|
` : ""}
|
|
1356
1394
|
|
|
1357
1395
|
## Required Analysis Sections
|
|
@@ -1507,10 +1545,11 @@ Proceed to Phase 1.
|
|
|
1507
1545
|
|
|
1508
1546
|
### Step 1.1: Fetch and Analyze
|
|
1509
1547
|
\`\`\`
|
|
1510
|
-
|
|
1511
|
-
workflow(persona_id="${args.persona_id}", mode="analyze", env="${args.env || "demo"}")
|
|
1548
|
+
workflow(mode="get", persona_id="${args.persona_id}", env="${args.env || "demo"}")
|
|
1512
1549
|
\`\`\`
|
|
1513
1550
|
|
|
1551
|
+
Review the workflow_def for issues (missing WORKFLOW_OUTPUT, type mismatches, orphan nodes).
|
|
1552
|
+
|
|
1514
1553
|
### Step 1.2: Document Existing Logic
|
|
1515
1554
|
Before making changes, document:
|
|
1516
1555
|
- **Current intents**: List all categories and their handlers
|
|
@@ -1612,8 +1651,8 @@ workflow(
|
|
|
1612
1651
|
|
|
1613
1652
|
## Phase 4: Validate & Deploy
|
|
1614
1653
|
|
|
1615
|
-
### Step 4.1:
|
|
1616
|
-
\`workflow(persona_id="${args.persona_id}"
|
|
1654
|
+
### Step 4.1: Review Changes
|
|
1655
|
+
\`workflow(mode="get", persona_id="${args.persona_id}")\` and verify the workflow_def is correct.
|
|
1617
1656
|
|
|
1618
1657
|
Verify:
|
|
1619
1658
|
- [ ] No type mismatches
|
|
@@ -1710,10 +1749,11 @@ Provide:
|
|
|
1710
1749
|
## Step 1: Fetch Workflow Data
|
|
1711
1750
|
|
|
1712
1751
|
\`\`\`
|
|
1713
|
-
|
|
1714
|
-
workflow(persona_id="${args.persona_id}", mode="analyze", env="${args.env || "demo"}")
|
|
1752
|
+
workflow(mode="get", persona_id="${args.persona_id}", env="${args.env || "demo"}")
|
|
1715
1753
|
\`\`\`
|
|
1716
1754
|
|
|
1755
|
+
Review the workflow_def for issues (missing WORKFLOW_OUTPUT, type mismatches, orphan nodes).
|
|
1756
|
+
|
|
1717
1757
|
## Step 2: Intent Analysis Framework
|
|
1718
1758
|
|
|
1719
1759
|
### Business Intent Layer
|