|
1 | | -#!/usr/bin/env -S deno run --allow-all |
| 1 | +#!/usr/bin/env -S deno run --allow-all --unstable-kv |
2 | 2 |
|
3 | 3 | /** |
4 | | - * Plugin-Workflows MCP Server - Multi-Step Workflow Demonstrations |
| 4 | + * @module examples/2-plugin-workflows |
| 5 | + * |
| 6 | + * # Plugin-Workflows MCP Server - Multi-Step Workflow Demonstrations |
5 | 7 | * |
6 | 8 | * This demonstrates advanced workflow capabilities with bb-mcp-server: |
7 | 9 | * - Multi-step workflow implementations with state management |
|
63 | 65 | * ====== |
64 | 66 | * |
65 | 67 | * # STDIO transport (default): |
66 | | - * deno run --allow-all main.ts |
| 68 | + * deno run --allow-all --unstable-kv main.ts |
67 | 69 | * |
68 | 70 | * # HTTP transport: |
69 | | - * MCP_TRANSPORT=http deno run --allow-all main.ts |
| 71 | + * MCP_TRANSPORT=http deno run --allow-all --unstable-kv main.ts |
70 | 72 | * # Then access: http://localhost:3000 |
71 | 73 | * |
72 | 74 | * # Test workflows: |
73 | | - * deno test --allow-all src/tests/ |
| 75 | + * deno test --allow-all --unstable-kv src/tests/ |
74 | 76 | * |
75 | 77 | * WORKFLOW EXAMPLES: |
76 | 78 | * ================== |
|
108 | 110 | * 1. Try 3-plugin-api-auth to learn OAuth and external API integration |
109 | 111 | * 2. Explore 4-manual-deps for complete infrastructure control |
110 | 112 | * 3. Build your own workflows for specific business processes |
| 113 | + * |
| 114 | + * @example Run this example directly from JSR |
| 115 | + * ```bash |
| 116 | + * # Run with STDIO transport (default) |
| 117 | + * deno run --allow-all --unstable-kv jsr:@beyondbetter/bb-mcp-server/examples/2-plugin-workflows |
| 118 | + * |
| 119 | + * # Run with HTTP transport |
| 120 | + * MCP_TRANSPORT=http deno run --allow-all --unstable-kv jsr:@beyondbetter/bb-mcp-server/examples/2-plugin-workflows |
| 121 | + * ``` |
| 122 | + * |
| 123 | + * @example Execute a workflow |
| 124 | + * ```typescript |
| 125 | + * // Data processing workflow example |
| 126 | + * const result = await workflow.execute({ |
| 127 | + * userId: 'user123', |
| 128 | + * data: [{name: 'Alice', score: 95}], |
| 129 | + * transformations: ['normalize', 'sort'], |
| 130 | + * outputFormat: 'json', |
| 131 | + * analysisType: 'summary' |
| 132 | + * }); |
| 133 | + * ``` |
| 134 | + * |
| 135 | + * @see {@link https://github.com/beyond-better/bb-mcp-server/tree/main/examples/2-plugin-workflows | Full example documentation} |
| 136 | + * @see {@link https://github.com/beyond-better/bb-mcp-server/tree/main/examples/1-simple | Previous example: Simple MCP Server} |
111 | 137 | */ |
112 | 138 |
|
113 | 139 | // Import the bb-mcp-server library - handles ALL infrastructure |
@@ -155,7 +181,7 @@ async function main(): Promise<void> { |
155 | 181 | console.log(' - content_generation_pipeline (plan → generate → review → publish)'); |
156 | 182 | console.log('🛠️ Available tools: current_datetime, validate_json'); |
157 | 183 | console.log('🔄 Transport:', process.env.MCP_TRANSPORT || 'stdio'); |
158 | | - console.log('🧪 Run tests: deno test --allow-all src/tests/'); |
| 184 | + console.log('🧪 Run tests: deno test --allow-all --unstable-kv src/tests/'); |
159 | 185 | } catch (error) { |
160 | 186 | console.error('❌ Failed to start Plugin-Workflows MCP Server:', error); |
161 | 187 | Deno.exit(1); |
|
0 commit comments