@mbc-cqrs-serverless/mcp-server 1.0.15

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.
Files changed (43) hide show
  1. package/LICENSE.txt +7 -0
  2. package/README.md +196 -0
  3. package/bin/mcp-server.js +13 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +50 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/prompts/cqrs-guide.d.ts +8 -0
  8. package/dist/prompts/cqrs-guide.js +467 -0
  9. package/dist/prompts/cqrs-guide.js.map +1 -0
  10. package/dist/prompts/index.d.ts +11 -0
  11. package/dist/prompts/index.js +33 -0
  12. package/dist/prompts/index.js.map +1 -0
  13. package/dist/resources/documentation.d.ts +12 -0
  14. package/dist/resources/documentation.js +131 -0
  15. package/dist/resources/documentation.js.map +1 -0
  16. package/dist/resources/errors.d.ts +12 -0
  17. package/dist/resources/errors.js +75 -0
  18. package/dist/resources/errors.js.map +1 -0
  19. package/dist/resources/index.d.ts +15 -0
  20. package/dist/resources/index.js +33 -0
  21. package/dist/resources/index.js.map +1 -0
  22. package/dist/resources/project.d.ts +12 -0
  23. package/dist/resources/project.js +193 -0
  24. package/dist/resources/project.js.map +1 -0
  25. package/dist/server.d.ts +12 -0
  26. package/dist/server.js +113 -0
  27. package/dist/server.js.map +1 -0
  28. package/dist/tools/analyze.d.ts +15 -0
  29. package/dist/tools/analyze.js +304 -0
  30. package/dist/tools/analyze.js.map +1 -0
  31. package/dist/tools/generate.d.ts +15 -0
  32. package/dist/tools/generate.js +153 -0
  33. package/dist/tools/generate.js.map +1 -0
  34. package/dist/tools/generator.d.ts +41 -0
  35. package/dist/tools/generator.js +241 -0
  36. package/dist/tools/generator.js.map +1 -0
  37. package/dist/tools/index.d.ts +15 -0
  38. package/dist/tools/index.js +39 -0
  39. package/dist/tools/index.js.map +1 -0
  40. package/dist/tools/validate.d.ts +15 -0
  41. package/dist/tools/validate.js +204 -0
  42. package/dist/tools/validate.js.map +1 -0
  43. package/package.json +60 -0
@@ -0,0 +1,467 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCqrsPrompts = getCqrsPrompts;
4
+ exports.getCqrsPromptMessages = getCqrsPromptMessages;
5
+ /**
6
+ * CQRS implementation guide prompts.
7
+ */
8
+ function getCqrsPrompts() {
9
+ return [
10
+ {
11
+ name: 'cqrs_implementation_guide',
12
+ description: 'Get guidance on implementing CQRS patterns with MBC CQRS Serverless framework',
13
+ arguments: [
14
+ {
15
+ name: 'feature_type',
16
+ description: 'Type of feature to implement (module, entity, command, query, event)',
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'feature_name',
21
+ description: 'Name of the feature (e.g., "Order", "Product")',
22
+ required: true,
23
+ },
24
+ ],
25
+ },
26
+ {
27
+ name: 'debug_command_error',
28
+ description: 'Get help debugging command-related errors',
29
+ arguments: [
30
+ {
31
+ name: 'error_message',
32
+ description: 'The error message you encountered',
33
+ required: true,
34
+ },
35
+ {
36
+ name: 'operation',
37
+ description: 'The operation being performed (create, update, delete)',
38
+ required: false,
39
+ },
40
+ ],
41
+ },
42
+ {
43
+ name: 'migration_guide',
44
+ description: 'Get guidance on migrating between framework versions',
45
+ arguments: [
46
+ {
47
+ name: 'from_version',
48
+ description: 'Current version',
49
+ required: true,
50
+ },
51
+ {
52
+ name: 'to_version',
53
+ description: 'Target version',
54
+ required: true,
55
+ },
56
+ ],
57
+ },
58
+ ];
59
+ }
60
+ function getCqrsPromptMessages(name, args) {
61
+ const safeArgs = args || {};
62
+ switch (name) {
63
+ case 'cqrs_implementation_guide':
64
+ return getImplementationGuideMessages(safeArgs.feature_type || 'module', safeArgs.feature_name || 'Example');
65
+ case 'debug_command_error':
66
+ return getDebugCommandMessages(safeArgs.error_message || 'Unknown error', safeArgs.operation);
67
+ case 'migration_guide':
68
+ return getMigrationGuideMessages(safeArgs.from_version || '0.1.0', safeArgs.to_version || 'latest');
69
+ default:
70
+ return {
71
+ messages: [
72
+ {
73
+ role: 'user',
74
+ content: { type: 'text', text: `Unknown prompt: ${name}` },
75
+ },
76
+ ],
77
+ };
78
+ }
79
+ }
80
+ function getImplementationGuideMessages(featureType, featureName) {
81
+ const guides = {
82
+ module: `# Implementing a ${featureName} Module
83
+
84
+ ## Steps
85
+
86
+ 1. **Generate the module structure**:
87
+ \`\`\`bash
88
+ mbc generate module ${featureName.toLowerCase()}
89
+ \`\`\`
90
+
91
+ 2. **Define the entity** in \`src/${featureName.toLowerCase()}/entities/${featureName.toLowerCase()}.entity.ts\`:
92
+ \`\`\`typescript
93
+ import { CommandEntity, DataEntity } from '@mbc-cqrs-serverless/core'
94
+
95
+ export class ${featureName}CommandEntity extends CommandEntity {
96
+ // Add your command-specific fields
97
+ name: string
98
+ // ... other fields
99
+ }
100
+
101
+ export class ${featureName}DataEntity extends DataEntity {
102
+ // Add your read model fields
103
+ name: string
104
+ // ... other fields
105
+ }
106
+ \`\`\`
107
+
108
+ 3. **Create DTOs** for request validation
109
+
110
+ 4. **Implement the service** with CommandService injection
111
+
112
+ 5. **Register the module** in your AppModule
113
+
114
+ ## Key Patterns
115
+
116
+ - Use CommandService for write operations
117
+ - Use DataService for read operations
118
+ - Implement optimistic locking with version field
119
+ - Handle events for side effects`,
120
+ entity: `# Implementing a ${featureName} Entity
121
+
122
+ ## Command Entity (Write Model)
123
+
124
+ \`\`\`typescript
125
+ import { CommandEntity, CommandModel } from '@mbc-cqrs-serverless/core'
126
+
127
+ export class ${featureName}CommandEntity extends CommandEntity implements CommandModel {
128
+ pk: string // Partition key
129
+ sk: string // Sort key
130
+ id: string // Unique identifier
131
+ code: string // Business code
132
+ name: string // Display name
133
+ version: number // For optimistic locking
134
+ tenantCode: string
135
+
136
+ // Add your business fields
137
+ // ...
138
+ }
139
+ \`\`\`
140
+
141
+ ## Data Entity (Read Model)
142
+
143
+ \`\`\`typescript
144
+ import { DataEntity, DataModel } from '@mbc-cqrs-serverless/core'
145
+
146
+ export class ${featureName}DataEntity extends DataEntity implements DataModel {
147
+ pk: string
148
+ sk: string
149
+ id: string
150
+ code: string
151
+ name: string
152
+
153
+ // Denormalized fields for efficient queries
154
+ // ...
155
+ }
156
+ \`\`\`
157
+
158
+ ## Key Points
159
+
160
+ - Command entity stores the write model (event sourced)
161
+ - Data entity stores the read model (denormalized)
162
+ - Use proper key patterns: \`pk: 'ENTITY#tenantCode'\`, \`sk: 'ENTITY#id'\``,
163
+ command: `# Implementing Commands for ${featureName}
164
+
165
+ ## Using CommandService
166
+
167
+ \`\`\`typescript
168
+ import { CommandService } from '@mbc-cqrs-serverless/core'
169
+
170
+ @Injectable()
171
+ export class ${featureName}Service {
172
+ constructor(private readonly commandService: CommandService) {}
173
+
174
+ // Create (Async - returns immediately, processes in background)
175
+ async createAsync(dto: Create${featureName}Dto, options: IInvoke) {
176
+ const entity = new ${featureName}CommandEntity()
177
+ entity.pk = \`${featureName.toUpperCase()}#\${options.tenantCode}\`
178
+ entity.sk = \`${featureName.toUpperCase()}#\${ulid()}\`
179
+ // ... set other fields
180
+
181
+ return this.commandService.publishAsync(entity, options)
182
+ }
183
+
184
+ // Create (Sync - waits for completion)
185
+ async createSync(dto: Create${featureName}Dto, options: IInvoke) {
186
+ const entity = new ${featureName}CommandEntity()
187
+ // ... same setup
188
+
189
+ return this.commandService.publishSync(entity, options)
190
+ }
191
+
192
+ // Update with optimistic locking
193
+ async update(dto: Update${featureName}Dto, options: IInvoke) {
194
+ return this.commandService.publishPartialUpdateAsync({
195
+ pk: dto.pk,
196
+ sk: dto.sk,
197
+ version: dto.version, // Must match current version
198
+ name: dto.name,
199
+ // ... partial updates
200
+ }, options)
201
+ }
202
+ }
203
+ \`\`\`
204
+
205
+ ## Sync vs Async
206
+
207
+ - **Async**: Better performance, eventual consistency
208
+ - **Sync**: Immediate consistency, slower`,
209
+ query: `# Implementing Queries for ${featureName}
210
+
211
+ ## Using DataService
212
+
213
+ \`\`\`typescript
214
+ import { DataService, SearchDto } from '@mbc-cqrs-serverless/core'
215
+
216
+ @Injectable()
217
+ export class ${featureName}QueryService {
218
+ constructor(private readonly dataService: DataService) {}
219
+
220
+ // Get single item
221
+ async getById(pk: string, sk: string) {
222
+ return this.dataService.getItem({ pk, sk })
223
+ }
224
+
225
+ // List with pagination
226
+ async list(searchDto: SearchDto, tenantCode: string) {
227
+ return this.dataService.listItemsByPk(
228
+ \`${featureName.toUpperCase()}#\${tenantCode}\`,
229
+ searchDto
230
+ )
231
+ }
232
+
233
+ // Search with filters
234
+ async search(searchDto: SearchDto, tenantCode: string) {
235
+ return this.dataService.searchItems({
236
+ pk: \`${featureName.toUpperCase()}#\${tenantCode}\`,
237
+ ...searchDto,
238
+ })
239
+ }
240
+ }
241
+ \`\`\`
242
+
243
+ ## Key Points
244
+
245
+ - DataService reads from the denormalized read model
246
+ - Use pagination for large result sets
247
+ - Implement search filters as needed`,
248
+ event: `# Implementing Events for ${featureName}
249
+
250
+ ## Event Handler
251
+
252
+ \`\`\`typescript
253
+ import { IEventHandler } from '@mbc-cqrs-serverless/core'
254
+
255
+ @Injectable()
256
+ export class ${featureName}CreatedHandler implements IEventHandler {
257
+ constructor(
258
+ private readonly notificationService: NotificationService,
259
+ ) {}
260
+
261
+ async execute(event: CommandEntity): Promise<void> {
262
+ // Handle ${featureName} created event
263
+ // - Send notifications
264
+ // - Update related data
265
+ // - Trigger workflows
266
+
267
+ await this.notificationService.send({
268
+ type: '${featureName.toLowerCase()}_created',
269
+ data: event,
270
+ })
271
+ }
272
+ }
273
+ \`\`\`
274
+
275
+ ## Data Sync Handler
276
+
277
+ \`\`\`typescript
278
+ import { IDataSyncHandler, DataEntity } from '@mbc-cqrs-serverless/core'
279
+
280
+ @Injectable()
281
+ export class ${featureName}DataSyncHandler implements IDataSyncHandler {
282
+ async sync(command: CommandEntity): Promise<DataEntity> {
283
+ // Transform command to data entity
284
+ const data = new ${featureName}DataEntity()
285
+ data.pk = command.pk
286
+ data.sk = command.sk
287
+ // ... map fields
288
+
289
+ return data
290
+ }
291
+ }
292
+ \`\`\``,
293
+ };
294
+ const guide = guides[featureType] || `Unknown feature type: ${featureType}. Valid types are: module, entity, command, query, event`;
295
+ return {
296
+ messages: [
297
+ {
298
+ role: 'user',
299
+ content: {
300
+ type: 'text',
301
+ text: `I want to implement a ${featureType} called "${featureName}" using MBC CQRS Serverless framework. Please provide guidance.`,
302
+ },
303
+ },
304
+ {
305
+ role: 'assistant',
306
+ content: {
307
+ type: 'text',
308
+ text: guide,
309
+ },
310
+ },
311
+ ],
312
+ };
313
+ }
314
+ function getDebugCommandMessages(errorMessage, operation) {
315
+ const operationContext = operation ? ` during ${operation} operation` : '';
316
+ return {
317
+ messages: [
318
+ {
319
+ role: 'user',
320
+ content: {
321
+ type: 'text',
322
+ text: `I'm getting this error${operationContext} with MBC CQRS Serverless:
323
+
324
+ \`\`\`
325
+ ${errorMessage}
326
+ \`\`\`
327
+
328
+ How can I debug and fix this?`,
329
+ },
330
+ },
331
+ {
332
+ role: 'assistant',
333
+ content: {
334
+ type: 'text',
335
+ text: `# Debugging Command Error
336
+
337
+ ## Error Analysis
338
+
339
+ The error "${errorMessage}" typically occurs in these scenarios:
340
+
341
+ ### Common Causes
342
+
343
+ 1. **Version Mismatch (Optimistic Locking)**
344
+ - You're trying to update an item with an outdated version
345
+ - Solution: Fetch the latest version before updating
346
+
347
+ 2. **Item Not Found**
348
+ - The pk/sk combination doesn't exist
349
+ - Solution: Verify the keys are correct
350
+
351
+ 3. **Validation Error**
352
+ - Request data doesn't match DTO validation
353
+ - Solution: Check your DTO decorators
354
+
355
+ ### Debugging Steps
356
+
357
+ 1. **Check the request data**:
358
+ \`\`\`typescript
359
+ console.log('Request:', JSON.stringify(request, null, 2))
360
+ \`\`\`
361
+
362
+ 2. **Verify item exists**:
363
+ \`\`\`typescript
364
+ const existing = await dataService.getItem({ pk, sk })
365
+ console.log('Existing item:', existing)
366
+ \`\`\`
367
+
368
+ 3. **Check version**:
369
+ \`\`\`typescript
370
+ // Current item version
371
+ console.log('Version:', existing?.version)
372
+ // Your request version
373
+ console.log('Request version:', dto.version)
374
+ \`\`\`
375
+
376
+ ### Quick Fixes
377
+
378
+ \`\`\`typescript
379
+ // Auto-fetch latest version (async mode)
380
+ await commandService.publishPartialUpdateAsync({
381
+ pk, sk,
382
+ version: -1, // Auto-fetches latest
383
+ name: 'Updated',
384
+ }, options)
385
+
386
+ // Or fetch and use latest (sync mode)
387
+ const latest = await dataService.getItem({ pk, sk })
388
+ await commandService.publishPartialUpdateSync({
389
+ pk, sk,
390
+ version: latest.version,
391
+ name: 'Updated',
392
+ }, options)
393
+ \`\`\`
394
+
395
+ Use the \`mbc_lookup_error\` tool for specific error solutions.`,
396
+ },
397
+ },
398
+ ],
399
+ };
400
+ }
401
+ function getMigrationGuideMessages(fromVersion, toVersion) {
402
+ return {
403
+ messages: [
404
+ {
405
+ role: 'user',
406
+ content: {
407
+ type: 'text',
408
+ text: `I need to migrate my MBC CQRS Serverless project from version ${fromVersion} to ${toVersion}. What do I need to know?`,
409
+ },
410
+ },
411
+ {
412
+ role: 'assistant',
413
+ content: {
414
+ type: 'text',
415
+ text: `# Migration Guide: ${fromVersion} to ${toVersion}
416
+
417
+ ## General Migration Steps
418
+
419
+ 1. **Update dependencies**:
420
+ \`\`\`bash
421
+ npm update @mbc-cqrs-serverless/core @mbc-cqrs-serverless/cli
422
+ \`\`\`
423
+
424
+ 2. **Check for breaking changes** in the CHANGELOG.md
425
+
426
+ 3. **Update imports** if API has changed
427
+
428
+ 4. **Run tests** to verify everything works
429
+
430
+ ## Common Migration Issues
431
+
432
+ ### Interface Changes
433
+ - Check if CommandEntity/DataEntity interfaces have new required fields
434
+ - Update your entities accordingly
435
+
436
+ ### Configuration Changes
437
+ - Review CommandModuleOptions for new options
438
+ - Check environment variables
439
+
440
+ ### Deprecated Features
441
+ - Look for deprecation warnings in build output
442
+ - Replace deprecated APIs with recommended alternatives
443
+
444
+ ## Verification
445
+
446
+ 1. Build the project:
447
+ \`\`\`bash
448
+ npm run build
449
+ \`\`\`
450
+
451
+ 2. Run tests:
452
+ \`\`\`bash
453
+ npm test
454
+ \`\`\`
455
+
456
+ 3. Test locally:
457
+ \`\`\`bash
458
+ npm run offline
459
+ \`\`\`
460
+
461
+ For specific version migration details, check the CHANGELOG.md in the framework repository.`,
462
+ },
463
+ },
464
+ ],
465
+ };
466
+ }
467
+ //# sourceMappingURL=cqrs-guide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cqrs-guide.js","sourceRoot":"","sources":["../../src/prompts/cqrs-guide.ts"],"names":[],"mappings":";;AAMA,wCAmDC;AAED,sDAgCC;AAzFD;;GAEG;AAEH,SAAgB,cAAc;IAC5B,OAAO;QACL;YACE,IAAI,EAAE,2BAA2B;YACjC,WAAW,EAAE,+EAA+E;YAC5F,SAAS,EAAE;gBACT;oBACE,IAAI,EAAE,cAAc;oBACpB,WAAW,EAAE,sEAAsE;oBACnF,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,cAAc;oBACpB,WAAW,EAAE,gDAAgD;oBAC7D,QAAQ,EAAE,IAAI;iBACf;aACF;SACF;QACD;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,2CAA2C;YACxD,SAAS,EAAE;gBACT;oBACE,IAAI,EAAE,eAAe;oBACrB,WAAW,EAAE,mCAAmC;oBAChD,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,WAAW,EAAE,wDAAwD;oBACrE,QAAQ,EAAE,KAAK;iBAChB;aACF;SACF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,sDAAsD;YACnE,SAAS,EAAE;gBACT;oBACE,IAAI,EAAE,cAAc;oBACpB,WAAW,EAAE,iBAAiB;oBAC9B,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,YAAY;oBAClB,WAAW,EAAE,gBAAgB;oBAC7B,QAAQ,EAAE,IAAI;iBACf;aACF;SACF;KAC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,IAAI,EAAE;;;;aAIH,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAwDuC;iBACvD;aACF;SACF;KACF,CAAA;AACH,CAAC;AAED,SAAS,yBAAyB,CAChC,WAAmB,EACnB,SAAiB;IAEjB,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,iEAAiE,WAAW,OAAO,SAAS,2BAA2B;iBAC9H;aACF;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,sBAAsB,WAAW,OAAO,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4FA8C2B;iBACnF;aACF;SACF;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Prompt, PromptMessage } from '@modelcontextprotocol/sdk/types.js';
2
+ /**
3
+ * Register all available prompts.
4
+ */
5
+ export declare function registerPrompts(): Prompt[];
6
+ /**
7
+ * Handle prompt get requests.
8
+ */
9
+ export declare function handlePromptGet(name: string, args?: Record<string, string>): {
10
+ messages: PromptMessage[];
11
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerPrompts = registerPrompts;
4
+ exports.handlePromptGet = handlePromptGet;
5
+ const cqrs_guide_js_1 = require("./cqrs-guide.js");
6
+ /**
7
+ * Register all available prompts.
8
+ */
9
+ function registerPrompts() {
10
+ return [
11
+ ...(0, cqrs_guide_js_1.getCqrsPrompts)(),
12
+ ];
13
+ }
14
+ /**
15
+ * Handle prompt get requests.
16
+ */
17
+ function handlePromptGet(name, args) {
18
+ const safeArgs = args || {};
19
+ // CQRS prompts
20
+ const cqrsPromptNames = ['cqrs_implementation_guide', 'debug_command_error', 'migration_guide'];
21
+ if (cqrsPromptNames.includes(name)) {
22
+ return (0, cqrs_guide_js_1.getCqrsPromptMessages)(name, safeArgs);
23
+ }
24
+ return {
25
+ messages: [
26
+ {
27
+ role: 'user',
28
+ content: { type: 'text', text: `Unknown prompt: ${name}` },
29
+ },
30
+ ],
31
+ };
32
+ }
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":";;AAMA,0CAIC;AAKD,0CAoBC;AAlCD,mDAAuE;AAEvE;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO;QACL,GAAG,IAAA,8BAAc,GAAE;KACpB,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAC7B,IAAY,EACZ,IAA6B;IAE7B,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAA;IAE3B,eAAe;IACf,MAAM,eAAe,GAAG,CAAC,2BAA2B,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,CAAA;IAC/F,IAAI,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,OAAO,IAAA,qCAAqB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC9C,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,IAAI,EAAE,EAAE;aAC3D;SACF;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Resource } from '@modelcontextprotocol/sdk/types.js';
2
+ /**
3
+ * Documentation resources for MBC CQRS Serverless framework.
4
+ */
5
+ export declare function getDocumentationResources(): Resource[];
6
+ export declare function readDocumentation(uri: string): Promise<{
7
+ contents: {
8
+ uri: string;
9
+ mimeType: string;
10
+ text: string;
11
+ }[];
12
+ }>;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getDocumentationResources = getDocumentationResources;
37
+ exports.readDocumentation = readDocumentation;
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ /**
41
+ * Documentation resources for MBC CQRS Serverless framework.
42
+ */
43
+ function getDocumentationResources() {
44
+ return [
45
+ {
46
+ uri: 'mbc://docs/overview',
47
+ name: 'Framework Overview',
48
+ description: 'Complete documentation of MBC CQRS Serverless framework including architecture, APIs, and usage examples',
49
+ mimeType: 'text/plain',
50
+ },
51
+ {
52
+ uri: 'mbc://docs/llms-short',
53
+ name: 'Framework Summary',
54
+ description: 'Concise summary of MBC CQRS Serverless framework for quick reference',
55
+ mimeType: 'text/plain',
56
+ },
57
+ {
58
+ uri: 'mbc://docs/architecture',
59
+ name: 'Architecture Guide',
60
+ description: 'CQRS and Event Sourcing architecture patterns used in the framework',
61
+ mimeType: 'text/markdown',
62
+ },
63
+ {
64
+ uri: 'mbc://docs/faq',
65
+ name: 'FAQ',
66
+ description: 'Frequently asked questions about the framework',
67
+ mimeType: 'text/markdown',
68
+ },
69
+ {
70
+ uri: 'mbc://docs/troubleshooting',
71
+ name: 'Troubleshooting Guide',
72
+ description: 'Common issues and their solutions',
73
+ mimeType: 'text/markdown',
74
+ },
75
+ {
76
+ uri: 'mbc://docs/security',
77
+ name: 'Security Best Practices',
78
+ description: 'Security guidelines and best practices for the framework',
79
+ mimeType: 'text/markdown',
80
+ },
81
+ ];
82
+ }
83
+ async function readDocumentation(uri) {
84
+ const frameworkRoot = path.resolve(__dirname, '../../../../..');
85
+ let content;
86
+ let mimeType = 'text/plain';
87
+ switch (uri) {
88
+ case 'mbc://docs/overview':
89
+ content = await readFileContent(path.join(frameworkRoot, 'llms-full.txt'));
90
+ break;
91
+ case 'mbc://docs/llms-short':
92
+ content = await readFileContent(path.join(frameworkRoot, 'llms.txt'));
93
+ break;
94
+ case 'mbc://docs/architecture':
95
+ content = await readFileContent(path.join(frameworkRoot, 'docs', 'ARCHITECTURE.md'));
96
+ mimeType = 'text/markdown';
97
+ break;
98
+ case 'mbc://docs/faq':
99
+ content = await readFileContent(path.join(frameworkRoot, 'docs', 'FAQ.md'));
100
+ mimeType = 'text/markdown';
101
+ break;
102
+ case 'mbc://docs/troubleshooting':
103
+ content = await readFileContent(path.join(frameworkRoot, 'docs', 'TROUBLESHOOTING.md'));
104
+ mimeType = 'text/markdown';
105
+ break;
106
+ case 'mbc://docs/security':
107
+ content = await readFileContent(path.join(frameworkRoot, 'SECURITY.md'));
108
+ mimeType = 'text/markdown';
109
+ break;
110
+ default:
111
+ throw new Error(`Unknown documentation resource: ${uri}`);
112
+ }
113
+ return {
114
+ contents: [
115
+ {
116
+ uri,
117
+ mimeType,
118
+ text: content,
119
+ },
120
+ ],
121
+ };
122
+ }
123
+ async function readFileContent(filePath) {
124
+ try {
125
+ return fs.readFileSync(filePath, 'utf-8');
126
+ }
127
+ catch (error) {
128
+ return `Error reading file: ${filePath}. File may not exist.`;
129
+ }
130
+ }
131
+ //# sourceMappingURL=documentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentation.js","sourceRoot":"","sources":["../../src/resources/documentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,8DAuCC;AAED,8CA0CC;AA3FD,uCAAwB;AACxB,2CAA4B;AAG5B;;GAEG;AAEH,SAAgB,yBAAyB;IACvC,OAAO;QACL;YACE,GAAG,EAAE,qBAAqB;YAC1B,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,0GAA0G;YACvH,QAAQ,EAAE,YAAY;SACvB;QACD;YACE,GAAG,EAAE,uBAAuB;YAC5B,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,sEAAsE;YACnF,QAAQ,EAAE,YAAY;SACvB;QACD;YACE,GAAG,EAAE,yBAAyB;YAC9B,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,qEAAqE;YAClF,QAAQ,EAAE,eAAe;SAC1B;QACD;YACE,GAAG,EAAE,gBAAgB;YACrB,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,eAAe;SAC1B;QACD;YACE,GAAG,EAAE,4BAA4B;YACjC,IAAI,EAAE,uBAAuB;YAC7B,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,eAAe;SAC1B;QACD;YACE,GAAG,EAAE,qBAAqB;YAC1B,IAAI,EAAE,yBAAyB;YAC/B,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,eAAe;SAC1B;KACF,CAAA;AACH,CAAC;AAEM,KAAK,UAA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;QACL,QAAQ,EAAE;YACR;gBACE,GAAG;gBACH,QAAQ;gBACR,IAAI,EAAE,OAAO;aACd;SACF;KACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,QAAgB;IAC7C,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,uBAAuB,QAAQ,uBAAuB,CAAA;IAC/D,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Resource } from '@modelcontextprotocol/sdk/types.js';
2
+ /**
3
+ * Error catalog resources for MBC CQRS Serverless framework.
4
+ */
5
+ export declare function getErrorResources(): Resource[];
6
+ export declare function readErrorCatalog(uri: string): Promise<{
7
+ contents: {
8
+ uri: string;
9
+ mimeType: string;
10
+ text: string;
11
+ }[];
12
+ }>;