@vue-skuilder/mcp 0.1.11-9 → 0.1.11

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.
package/CLAUDE.md CHANGED
@@ -16,15 +16,20 @@ Uses **tsup** for dual CommonJS/ESM output:
16
16
  - **ESM**: `dist/index.mjs` (primary)
17
17
  - **CommonJS**: `dist/index.js` (compatibility)
18
18
  - **Types**: `dist/index.d.ts`
19
+ - **Target**: ES2022 with TypeScript ~5.7.2
20
+ - **Source Maps**: Enabled for debugging
21
+ - **Code Splitting**: Disabled for single-file output
19
22
 
20
23
  ## Dependencies
21
24
  - `@modelcontextprotocol/sdk` - MCP protocol implementation
22
25
  - `@vue-skuilder/db` - Database layer access
23
26
  - `@vue-skuilder/common` - Shared types and utilities
27
+ - `@vue-skuilder/courseware` - DataShape definitions via `/backend` export
24
28
  - `zod` - Schema validation
25
29
 
26
30
  ## Dev Dependencies
27
31
  - `@modelcontextprotocol/inspector` - MCP server testing and debugging
32
+ - `tsup` - TypeScript universal packager
28
33
 
29
34
  ## Architecture
30
35
  Course-scoped MCP servers that accept CourseDBInterface injection:
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
3
3
  import { CourseDBInterface } from '@vue-skuilder/db';
4
- import { CourseConfig } from '@vue-skuilder/common';
4
+ import { SkLogger, CourseConfig } from '@vue-skuilder/common';
5
5
  import { z } from 'zod';
6
6
 
7
7
  interface MCPServerOptions {
@@ -9,12 +9,14 @@ interface MCPServerOptions {
9
9
  maxCardsPerQuery?: number;
10
10
  allowedDataShapes?: string[];
11
11
  eloCalibrationMode?: 'strict' | 'adaptive' | 'manual';
12
+ logger?: SkLogger;
12
13
  }
13
14
  declare class MCPServer {
14
15
  private courseDB;
15
16
  private readonly options;
16
17
  private mcpServer;
17
18
  private transport?;
19
+ private logger;
18
20
  constructor(courseDB: CourseDBInterface, options?: MCPServerOptions);
19
21
  private setupCapabilities;
20
22
  start(transport: Transport): Promise<void>;
@@ -39,50 +41,40 @@ interface CardResource {
39
41
  elo: number;
40
42
  }
41
43
 
44
+ declare const CreateCardInputMCPSchema: {
45
+ datashape: z.ZodString;
46
+ data: z.ZodAny;
47
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
+ elo: z.ZodOptional<z.ZodNumber>;
49
+ sourceRef: z.ZodOptional<z.ZodString>;
50
+ };
42
51
  declare const CreateCardInputSchema: z.ZodObject<{
43
52
  datashape: z.ZodString;
44
53
  data: z.ZodAny;
45
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
55
  elo: z.ZodOptional<z.ZodNumber>;
47
56
  sourceRef: z.ZodOptional<z.ZodString>;
48
- }, "strip", z.ZodTypeAny, {
49
- datashape: string;
50
- elo?: number | undefined;
51
- tags?: string[] | undefined;
52
- data?: any;
53
- sourceRef?: string | undefined;
54
- }, {
55
- datashape: string;
56
- elo?: number | undefined;
57
- tags?: string[] | undefined;
58
- data?: any;
59
- sourceRef?: string | undefined;
60
- }>;
57
+ }, z.core.$strip>;
61
58
  type CreateCardInput = z.infer<typeof CreateCardInputSchema>;
62
59
  interface CreateCardOutput {
63
60
  cardId: string;
64
61
  initialElo: number;
65
62
  created: boolean;
66
63
  }
64
+ declare const UpdateCardInputMCPSchema: {
65
+ cardId: z.ZodString;
66
+ data: z.ZodOptional<z.ZodAny>;
67
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ elo: z.ZodOptional<z.ZodNumber>;
69
+ sourceRef: z.ZodOptional<z.ZodString>;
70
+ };
67
71
  declare const UpdateCardInputSchema: z.ZodObject<{
68
72
  cardId: z.ZodString;
69
73
  data: z.ZodOptional<z.ZodAny>;
70
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
75
  elo: z.ZodOptional<z.ZodNumber>;
72
76
  sourceRef: z.ZodOptional<z.ZodString>;
73
- }, "strip", z.ZodTypeAny, {
74
- cardId: string;
75
- elo?: number | undefined;
76
- tags?: string[] | undefined;
77
- data?: any;
78
- sourceRef?: string | undefined;
79
- }, {
80
- cardId: string;
81
- elo?: number | undefined;
82
- tags?: string[] | undefined;
83
- data?: any;
84
- sourceRef?: string | undefined;
85
- }>;
77
+ }, z.core.$strip>;
86
78
  type UpdateCardInput = z.infer<typeof UpdateCardInputSchema>;
87
79
  interface UpdateCardOutput {
88
80
  cardId: string;
@@ -94,22 +86,24 @@ interface UpdateCardOutput {
94
86
  sourceRef?: boolean;
95
87
  };
96
88
  }
89
+ declare const TagCardInputMCPSchema: {
90
+ cardId: z.ZodString;
91
+ action: z.ZodEnum<{
92
+ add: "add";
93
+ remove: "remove";
94
+ }>;
95
+ tags: z.ZodArray<z.ZodString>;
96
+ updateELO: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
97
+ };
97
98
  declare const TagCardInputSchema: z.ZodObject<{
98
99
  cardId: z.ZodString;
99
- action: z.ZodEnum<["add", "remove"]>;
100
- tags: z.ZodArray<z.ZodString, "many">;
100
+ action: z.ZodEnum<{
101
+ add: "add";
102
+ remove: "remove";
103
+ }>;
104
+ tags: z.ZodArray<z.ZodString>;
101
105
  updateELO: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
102
- }, "strip", z.ZodTypeAny, {
103
- cardId: string;
104
- tags: string[];
105
- action: "add" | "remove";
106
- updateELO: boolean;
107
- }, {
108
- cardId: string;
109
- tags: string[];
110
- action: "add" | "remove";
111
- updateELO?: boolean | undefined;
112
- }>;
106
+ }, z.core.$strip>;
113
107
  type TagCardInput = z.infer<typeof TagCardInputSchema>;
114
108
  interface TagCardOutput {
115
109
  cardId: string;
@@ -118,19 +112,16 @@ interface TagCardOutput {
118
112
  success: boolean;
119
113
  currentTags: string[];
120
114
  }
115
+ declare const DeleteCardInputMCPSchema: {
116
+ cardId: z.ZodString;
117
+ confirm: z.ZodDefault<z.ZodBoolean>;
118
+ reason: z.ZodOptional<z.ZodString>;
119
+ };
121
120
  declare const DeleteCardInputSchema: z.ZodObject<{
122
121
  cardId: z.ZodString;
123
122
  confirm: z.ZodDefault<z.ZodBoolean>;
124
123
  reason: z.ZodOptional<z.ZodString>;
125
- }, "strip", z.ZodTypeAny, {
126
- cardId: string;
127
- confirm: boolean;
128
- reason?: string | undefined;
129
- }, {
130
- cardId: string;
131
- confirm?: boolean | undefined;
132
- reason?: string | undefined;
133
- }>;
124
+ }, z.core.$strip>;
134
125
  type DeleteCardInput = z.infer<typeof DeleteCardInputSchema>;
135
126
  interface DeleteCardOutput {
136
127
  cardId: string;
@@ -220,7 +211,7 @@ interface ShapesCollection {
220
211
  /**
221
212
  * Handle shapes://all resource - List all available DataShapes
222
213
  */
223
- declare function handleShapesAllResource(courseDB: CourseDBInterface): Promise<ShapesCollection>;
214
+ declare function handleShapesAllResource(_courseDB: CourseDBInterface): Promise<ShapesCollection>;
224
215
  /**
225
216
  * Handle shapes://[shapeName] resource - Get specific DataShape definition
226
217
  */
@@ -299,6 +290,22 @@ declare function handleTagsDistributionResource(courseDB: CourseDBInterface): Pr
299
290
  totalCards: number;
300
291
  }>;
301
292
 
293
+ /**
294
+ * Schema resource response structure
295
+ */
296
+ interface SchemaResource {
297
+ dataShapeName: string;
298
+ jsonSchema: object;
299
+ schemaString: string;
300
+ available: boolean;
301
+ lastUpdated?: string;
302
+ }
303
+ /**
304
+ * Handle schema resource request for a specific DataShape
305
+ * Returns the JSON Schema for the DataShape if available
306
+ */
307
+ declare function handleSchemaResource(_courseDB: CourseDBInterface, dataShapeName: string): Promise<SchemaResource>;
308
+
302
309
  declare const RESOURCE_PATTERNS: {
303
310
  readonly COURSE_CONFIG: "course://config";
304
311
  readonly CARDS_ALL: "cards://all";
@@ -314,6 +321,7 @@ declare const RESOURCE_PATTERNS: {
314
321
  readonly TAGS_INTERSECT: "tags://intersect/{tags}";
315
322
  readonly TAGS_EXCLUSIVE: "tags://exclusive/{tags}";
316
323
  readonly TAGS_DISTRIBUTION: "tags://distribution";
324
+ readonly SCHEMA_SPECIFIC: "schema://{dataShapeName}";
317
325
  };
318
326
 
319
327
  declare function handleCreateCard(courseDB: CourseDBInterface, input: CreateCardInput): Promise<CreateCardOutput>;
@@ -331,4 +339,4 @@ declare const TOOL_PATTERNS: {
331
339
  readonly DELETE_CARD: "delete_card";
332
340
  };
333
341
 
334
- export { type CardResource, type CardResourceData, type CardsCollection, type ContentWithELO, type CourseConfigUri, CourseConfigUriSchema, type CourseResource, type CreateCardInput, CreateCardInputSchema, type CreateCardOutput, type DeleteCardInput, DeleteCardInputSchema, type DeleteCardOutput, type ELOContext, MCPServer, type MCPServerOptions, RESOURCE_PATTERNS, type ShapeResource, type ShapesCollection, type SourceReference, TOOL_PATTERNS, type TagCardInput, TagCardInputSchema, type TagCardOutput, type TagDistribution, type TagResource, type TagsCollection, type UpdateCardInput, UpdateCardInputSchema, type UpdateCardOutput, handleCardsAllResource, handleCardsEloResource, handleCardsShapeResource, handleCardsTagResource, handleCourseConfigResource, handleCreateCard, handleDeleteCard, handleShapeSpecificResource, handleShapesAllResource, handleTagCard, handleTagSpecificResource, handleTagsAllResource, handleTagsDistributionResource, handleTagsExclusiveResource, handleTagsIntersectResource, handleTagsStatsResource, handleTagsUnionResource, handleUpdateCard };
342
+ export { type CardResource, type CardResourceData, type CardsCollection, type ContentWithELO, type CourseConfigUri, CourseConfigUriSchema, type CourseResource, type CreateCardInput, CreateCardInputMCPSchema, CreateCardInputSchema, type CreateCardOutput, type DeleteCardInput, DeleteCardInputMCPSchema, DeleteCardInputSchema, type DeleteCardOutput, type ELOContext, MCPServer, type MCPServerOptions, RESOURCE_PATTERNS, type SchemaResource, type ShapeResource, type ShapesCollection, type SourceReference, TOOL_PATTERNS, type TagCardInput, TagCardInputMCPSchema, TagCardInputSchema, type TagCardOutput, type TagDistribution, type TagResource, type TagsCollection, type UpdateCardInput, UpdateCardInputMCPSchema, UpdateCardInputSchema, type UpdateCardOutput, handleCardsAllResource, handleCardsEloResource, handleCardsShapeResource, handleCardsTagResource, handleCourseConfigResource, handleCreateCard, handleDeleteCard, handleSchemaResource, handleShapeSpecificResource, handleShapesAllResource, handleTagCard, handleTagSpecificResource, handleTagsAllResource, handleTagsDistributionResource, handleTagsExclusiveResource, handleTagsIntersectResource, handleTagsStatsResource, handleTagsUnionResource, handleUpdateCard };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
3
3
  import { CourseDBInterface } from '@vue-skuilder/db';
4
- import { CourseConfig } from '@vue-skuilder/common';
4
+ import { SkLogger, CourseConfig } from '@vue-skuilder/common';
5
5
  import { z } from 'zod';
6
6
 
7
7
  interface MCPServerOptions {
@@ -9,12 +9,14 @@ interface MCPServerOptions {
9
9
  maxCardsPerQuery?: number;
10
10
  allowedDataShapes?: string[];
11
11
  eloCalibrationMode?: 'strict' | 'adaptive' | 'manual';
12
+ logger?: SkLogger;
12
13
  }
13
14
  declare class MCPServer {
14
15
  private courseDB;
15
16
  private readonly options;
16
17
  private mcpServer;
17
18
  private transport?;
19
+ private logger;
18
20
  constructor(courseDB: CourseDBInterface, options?: MCPServerOptions);
19
21
  private setupCapabilities;
20
22
  start(transport: Transport): Promise<void>;
@@ -39,50 +41,40 @@ interface CardResource {
39
41
  elo: number;
40
42
  }
41
43
 
44
+ declare const CreateCardInputMCPSchema: {
45
+ datashape: z.ZodString;
46
+ data: z.ZodAny;
47
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
+ elo: z.ZodOptional<z.ZodNumber>;
49
+ sourceRef: z.ZodOptional<z.ZodString>;
50
+ };
42
51
  declare const CreateCardInputSchema: z.ZodObject<{
43
52
  datashape: z.ZodString;
44
53
  data: z.ZodAny;
45
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
55
  elo: z.ZodOptional<z.ZodNumber>;
47
56
  sourceRef: z.ZodOptional<z.ZodString>;
48
- }, "strip", z.ZodTypeAny, {
49
- datashape: string;
50
- elo?: number | undefined;
51
- tags?: string[] | undefined;
52
- data?: any;
53
- sourceRef?: string | undefined;
54
- }, {
55
- datashape: string;
56
- elo?: number | undefined;
57
- tags?: string[] | undefined;
58
- data?: any;
59
- sourceRef?: string | undefined;
60
- }>;
57
+ }, z.core.$strip>;
61
58
  type CreateCardInput = z.infer<typeof CreateCardInputSchema>;
62
59
  interface CreateCardOutput {
63
60
  cardId: string;
64
61
  initialElo: number;
65
62
  created: boolean;
66
63
  }
64
+ declare const UpdateCardInputMCPSchema: {
65
+ cardId: z.ZodString;
66
+ data: z.ZodOptional<z.ZodAny>;
67
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ elo: z.ZodOptional<z.ZodNumber>;
69
+ sourceRef: z.ZodOptional<z.ZodString>;
70
+ };
67
71
  declare const UpdateCardInputSchema: z.ZodObject<{
68
72
  cardId: z.ZodString;
69
73
  data: z.ZodOptional<z.ZodAny>;
70
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
75
  elo: z.ZodOptional<z.ZodNumber>;
72
76
  sourceRef: z.ZodOptional<z.ZodString>;
73
- }, "strip", z.ZodTypeAny, {
74
- cardId: string;
75
- elo?: number | undefined;
76
- tags?: string[] | undefined;
77
- data?: any;
78
- sourceRef?: string | undefined;
79
- }, {
80
- cardId: string;
81
- elo?: number | undefined;
82
- tags?: string[] | undefined;
83
- data?: any;
84
- sourceRef?: string | undefined;
85
- }>;
77
+ }, z.core.$strip>;
86
78
  type UpdateCardInput = z.infer<typeof UpdateCardInputSchema>;
87
79
  interface UpdateCardOutput {
88
80
  cardId: string;
@@ -94,22 +86,24 @@ interface UpdateCardOutput {
94
86
  sourceRef?: boolean;
95
87
  };
96
88
  }
89
+ declare const TagCardInputMCPSchema: {
90
+ cardId: z.ZodString;
91
+ action: z.ZodEnum<{
92
+ add: "add";
93
+ remove: "remove";
94
+ }>;
95
+ tags: z.ZodArray<z.ZodString>;
96
+ updateELO: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
97
+ };
97
98
  declare const TagCardInputSchema: z.ZodObject<{
98
99
  cardId: z.ZodString;
99
- action: z.ZodEnum<["add", "remove"]>;
100
- tags: z.ZodArray<z.ZodString, "many">;
100
+ action: z.ZodEnum<{
101
+ add: "add";
102
+ remove: "remove";
103
+ }>;
104
+ tags: z.ZodArray<z.ZodString>;
101
105
  updateELO: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
102
- }, "strip", z.ZodTypeAny, {
103
- cardId: string;
104
- tags: string[];
105
- action: "add" | "remove";
106
- updateELO: boolean;
107
- }, {
108
- cardId: string;
109
- tags: string[];
110
- action: "add" | "remove";
111
- updateELO?: boolean | undefined;
112
- }>;
106
+ }, z.core.$strip>;
113
107
  type TagCardInput = z.infer<typeof TagCardInputSchema>;
114
108
  interface TagCardOutput {
115
109
  cardId: string;
@@ -118,19 +112,16 @@ interface TagCardOutput {
118
112
  success: boolean;
119
113
  currentTags: string[];
120
114
  }
115
+ declare const DeleteCardInputMCPSchema: {
116
+ cardId: z.ZodString;
117
+ confirm: z.ZodDefault<z.ZodBoolean>;
118
+ reason: z.ZodOptional<z.ZodString>;
119
+ };
121
120
  declare const DeleteCardInputSchema: z.ZodObject<{
122
121
  cardId: z.ZodString;
123
122
  confirm: z.ZodDefault<z.ZodBoolean>;
124
123
  reason: z.ZodOptional<z.ZodString>;
125
- }, "strip", z.ZodTypeAny, {
126
- cardId: string;
127
- confirm: boolean;
128
- reason?: string | undefined;
129
- }, {
130
- cardId: string;
131
- confirm?: boolean | undefined;
132
- reason?: string | undefined;
133
- }>;
124
+ }, z.core.$strip>;
134
125
  type DeleteCardInput = z.infer<typeof DeleteCardInputSchema>;
135
126
  interface DeleteCardOutput {
136
127
  cardId: string;
@@ -220,7 +211,7 @@ interface ShapesCollection {
220
211
  /**
221
212
  * Handle shapes://all resource - List all available DataShapes
222
213
  */
223
- declare function handleShapesAllResource(courseDB: CourseDBInterface): Promise<ShapesCollection>;
214
+ declare function handleShapesAllResource(_courseDB: CourseDBInterface): Promise<ShapesCollection>;
224
215
  /**
225
216
  * Handle shapes://[shapeName] resource - Get specific DataShape definition
226
217
  */
@@ -299,6 +290,22 @@ declare function handleTagsDistributionResource(courseDB: CourseDBInterface): Pr
299
290
  totalCards: number;
300
291
  }>;
301
292
 
293
+ /**
294
+ * Schema resource response structure
295
+ */
296
+ interface SchemaResource {
297
+ dataShapeName: string;
298
+ jsonSchema: object;
299
+ schemaString: string;
300
+ available: boolean;
301
+ lastUpdated?: string;
302
+ }
303
+ /**
304
+ * Handle schema resource request for a specific DataShape
305
+ * Returns the JSON Schema for the DataShape if available
306
+ */
307
+ declare function handleSchemaResource(_courseDB: CourseDBInterface, dataShapeName: string): Promise<SchemaResource>;
308
+
302
309
  declare const RESOURCE_PATTERNS: {
303
310
  readonly COURSE_CONFIG: "course://config";
304
311
  readonly CARDS_ALL: "cards://all";
@@ -314,6 +321,7 @@ declare const RESOURCE_PATTERNS: {
314
321
  readonly TAGS_INTERSECT: "tags://intersect/{tags}";
315
322
  readonly TAGS_EXCLUSIVE: "tags://exclusive/{tags}";
316
323
  readonly TAGS_DISTRIBUTION: "tags://distribution";
324
+ readonly SCHEMA_SPECIFIC: "schema://{dataShapeName}";
317
325
  };
318
326
 
319
327
  declare function handleCreateCard(courseDB: CourseDBInterface, input: CreateCardInput): Promise<CreateCardOutput>;
@@ -331,4 +339,4 @@ declare const TOOL_PATTERNS: {
331
339
  readonly DELETE_CARD: "delete_card";
332
340
  };
333
341
 
334
- export { type CardResource, type CardResourceData, type CardsCollection, type ContentWithELO, type CourseConfigUri, CourseConfigUriSchema, type CourseResource, type CreateCardInput, CreateCardInputSchema, type CreateCardOutput, type DeleteCardInput, DeleteCardInputSchema, type DeleteCardOutput, type ELOContext, MCPServer, type MCPServerOptions, RESOURCE_PATTERNS, type ShapeResource, type ShapesCollection, type SourceReference, TOOL_PATTERNS, type TagCardInput, TagCardInputSchema, type TagCardOutput, type TagDistribution, type TagResource, type TagsCollection, type UpdateCardInput, UpdateCardInputSchema, type UpdateCardOutput, handleCardsAllResource, handleCardsEloResource, handleCardsShapeResource, handleCardsTagResource, handleCourseConfigResource, handleCreateCard, handleDeleteCard, handleShapeSpecificResource, handleShapesAllResource, handleTagCard, handleTagSpecificResource, handleTagsAllResource, handleTagsDistributionResource, handleTagsExclusiveResource, handleTagsIntersectResource, handleTagsStatsResource, handleTagsUnionResource, handleUpdateCard };
342
+ export { type CardResource, type CardResourceData, type CardsCollection, type ContentWithELO, type CourseConfigUri, CourseConfigUriSchema, type CourseResource, type CreateCardInput, CreateCardInputMCPSchema, CreateCardInputSchema, type CreateCardOutput, type DeleteCardInput, DeleteCardInputMCPSchema, DeleteCardInputSchema, type DeleteCardOutput, type ELOContext, MCPServer, type MCPServerOptions, RESOURCE_PATTERNS, type SchemaResource, type ShapeResource, type ShapesCollection, type SourceReference, TOOL_PATTERNS, type TagCardInput, TagCardInputMCPSchema, TagCardInputSchema, type TagCardOutput, type TagDistribution, type TagResource, type TagsCollection, type UpdateCardInput, UpdateCardInputMCPSchema, UpdateCardInputSchema, type UpdateCardOutput, handleCardsAllResource, handleCardsEloResource, handleCardsShapeResource, handleCardsTagResource, handleCourseConfigResource, handleCreateCard, handleDeleteCard, handleSchemaResource, handleShapeSpecificResource, handleShapesAllResource, handleTagCard, handleTagSpecificResource, handleTagsAllResource, handleTagsDistributionResource, handleTagsExclusiveResource, handleTagsIntersectResource, handleTagsStatsResource, handleTagsUnionResource, handleUpdateCard };