@vue-skuilder/mcp 0.1.8-3

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 ADDED
@@ -0,0 +1,113 @@
1
+ # @vue-skuilder/mcp Package
2
+
3
+ MCP (Model Context Protocol) server for Vue-Skuilder course content agent access.
4
+
5
+ ## Commands
6
+ - Build: `yarn workspace @vue-skuilder/mcp build`
7
+ - Dev: `yarn workspace @vue-skuilder/mcp dev` (build + MCP Inspector UI)
8
+ - Inspector: `yarn workspace @vue-skuilder/mcp inspector` (MCP Inspector UI)
9
+ - Test CLI: `yarn workspace @vue-skuilder/mcp test:cli` (CLI mode)
10
+ - Test Resources: `yarn workspace @vue-skuilder/mcp test:resources`
11
+ - Test Tools: `yarn workspace @vue-skuilder/mcp test:tools`
12
+ - Server: `yarn workspace @vue-skuilder/mcp server` (standalone server mode)
13
+
14
+ ## Build System
15
+ Uses **tsup** for dual CommonJS/ESM output:
16
+ - **ESM**: `dist/index.mjs` (primary)
17
+ - **CommonJS**: `dist/index.js` (compatibility)
18
+ - **Types**: `dist/index.d.ts`
19
+
20
+ ## Dependencies
21
+ - `@modelcontextprotocol/sdk` - MCP protocol implementation
22
+ - `@vue-skuilder/db` - Database layer access
23
+ - `@vue-skuilder/common` - Shared types and utilities
24
+ - `zod` - Schema validation
25
+
26
+ ## Dev Dependencies
27
+ - `@modelcontextprotocol/inspector` - MCP server testing and debugging
28
+
29
+ ## Architecture
30
+ Course-scoped MCP servers that accept CourseDBInterface injection:
31
+ - **Resources**: Read-only data access (course, cards, tags, elo, shapes)
32
+ - **Tools**: Content generation and management operations
33
+ - **Prompts**: Templates for guided content creation
34
+
35
+ ### Available Resources (14 total)
36
+ - `course://config` - Course configuration with metadata and ELO statistics
37
+ - `cards://all` - All cards with pagination support
38
+ - `cards://tag/{tagName}` - Filter cards by tag name
39
+ - `cards://shape/{shapeName}` - Filter cards by DataShape
40
+ - `cards://elo/{eloRange}` - Filter cards by ELO range (format: min-max)
41
+ - `shapes://all` - List all available DataShapes
42
+ - `shapes://{shapeName}` - Specific DataShape information
43
+ - `tags://all` - List all available tags
44
+ - `tags://stats` - Tag usage statistics
45
+ - `tags://{tagName}` - Specific tag information
46
+ - `tags://union/{tags}` - Cards with ANY of specified tags (format: tag1+tag2)
47
+ - `tags://intersect/{tags}` - Cards with ALL of specified tags (format: tag1+tag2)
48
+ - `tags://exclusive/{tags}` - Cards with first tag but NOT second (format: tag1-tag2)
49
+ - `tags://distribution` - Frequency distribution of all tags
50
+
51
+ ### Available Tools (4 total)
52
+ - `create_card` - Create new course cards with specified datashape and content
53
+ - `update_card` - Update existing course cards (data, tags, ELO, sourceRef)
54
+ - `tag_card` - Add or remove tags from course cards with optional ELO update
55
+ - `delete_card` - Safely delete course cards with confirmation requirement
56
+
57
+ ### Available Prompts (2 total)
58
+ - `fill-in-card-authoring` - Generate fill-in-the-blank or multiple-choice cards using Vue-Skuilder syntax
59
+ - `elo-scoring-guidance` - Guidance for assigning ELO difficulty ratings to flashcard content
60
+
61
+ ## Usage
62
+ ```typescript
63
+ import { MCPServer } from '@vue-skuilder/mcp';
64
+ import { getDataLayer } from '@vue-skuilder/db';
65
+
66
+ const courseDB = getDataLayer().getCourseDB('course-id');
67
+ const server = new MCPServer(courseDB);
68
+ ```
69
+
70
+ ## Testing
71
+ Use MCP Inspector for interactive testing:
72
+ ```bash
73
+ yarn dev # Opens Inspector UI automatically
74
+ ```
75
+
76
+ ## Key Features
77
+ - **ELO-aware**: Native support for Vue-Skuilder's dynamic rating system
78
+ - **DataShape aware**: Supports all Vue-Skuilder question types
79
+ - **Source linking**: Git-based content provenance tracking
80
+ - **Content generation**: Orchestrated courseware creation from source materials
81
+ - **Strongly typed**: All resources, tools, and prompts use TypeScript constants
82
+ - **Barrel exports**: Clean module organization with centralized imports
83
+ - **Pagination support**: Efficient handling of large datasets
84
+ - **Flexible filtering**: Multiple ways to query and filter content
85
+
86
+ ## Implementation Details
87
+
88
+ ### Strongly Typed Constants
89
+ All registrations use TypeScript constants for type safety:
90
+ - `RESOURCE_PATTERNS` - URI patterns for all 14 resources
91
+ - `TOOL_PATTERNS` - Names for all 4 tools
92
+ - `PROMPT_PATTERNS` - Names for all 2 prompts
93
+
94
+ ### Barrel Export Pattern
95
+ Organized module structure with index files:
96
+ - `src/resources/index.ts` - All resource handlers and patterns
97
+ - `src/tools/index.ts` - All tool handlers and patterns
98
+ - `src/prompts/index.ts` - All prompt functions and patterns
99
+
100
+ ### Server Configuration
101
+ ```typescript
102
+ export interface MCPServerOptions {
103
+ enableSourceLinking?: boolean;
104
+ maxCardsPerQuery?: number;
105
+ allowedDataShapes?: string[];
106
+ eloCalibrationMode?: 'strict' | 'adaptive' | 'manual';
107
+ }
108
+ ```
109
+
110
+ ### Error Handling
111
+ - Graceful handling of missing courses and cards
112
+ - Validation using Zod schemas
113
+ - Comprehensive error messages for debugging
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node