sad-mcp 0.1.6 → 0.1.7

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/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { trackServerStart } from "./tracking.js";
7
7
  async function main() {
8
8
  // Connect to Claude Desktop IMMEDIATELY — no blocking auth here
9
9
  // Auth happens lazily on first Drive API call
10
- const server = new Server({ name: "sad-mcp", version: "0.1.6" }, {
10
+ const server = new Server({ name: "sad-mcp", version: "0.1.7" }, {
11
11
  capabilities: {
12
12
  tools: {},
13
13
  prompts: {},
package/dist/tools.js CHANGED
@@ -72,6 +72,24 @@ export function registerToolHandlers(server) {
72
72
  },
73
73
  },
74
74
  },
75
+ {
76
+ name: "quiz",
77
+ description: "Generate a practice quiz on a course topic. Searches course materials for relevant content and returns it with instructions for Claude to create quiz questions. Use when a student wants to test their knowledge.",
78
+ inputSchema: {
79
+ type: "object",
80
+ properties: {
81
+ topic: {
82
+ type: "string",
83
+ description: "The topic to quiz on (e.g., 'use case diagrams', 'BPMN', 'normalization', 'state diagrams')",
84
+ },
85
+ num_questions: {
86
+ type: "number",
87
+ description: "Number of questions to generate. Defaults to 5.",
88
+ },
89
+ },
90
+ required: ["topic"],
91
+ },
92
+ },
75
93
  ],
76
94
  }));
77
95
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
@@ -156,6 +174,55 @@ export function registerToolHandlers(server) {
156
174
  ],
157
175
  };
158
176
  }
177
+ if (name === "quiz") {
178
+ const topic = args.topic;
179
+ const numQuestions = args.num_questions || 5;
180
+ if (!topic) {
181
+ return {
182
+ content: [{ type: "text", text: "Error: topic parameter is required" }],
183
+ };
184
+ }
185
+ await ensureTextCache();
186
+ // Gather relevant material for the topic
187
+ const relevantContent = [];
188
+ for (const [, { file, text }] of textCache) {
189
+ const matches = searchInText(text, topic);
190
+ if (matches.length > 0) {
191
+ // Include surrounding context (5 lines around each match)
192
+ const lines = text.split("\n");
193
+ const snippets = [];
194
+ for (const match of matches.slice(0, 10)) {
195
+ const start = Math.max(0, match.lineNumber - 6);
196
+ const end = Math.min(lines.length, match.lineNumber + 4);
197
+ snippets.push(lines.slice(start, end).join("\n"));
198
+ }
199
+ relevantContent.push(`--- ${file.name} ---\n${snippets.join("\n...\n")}`);
200
+ }
201
+ }
202
+ if (relevantContent.length === 0) {
203
+ return {
204
+ content: [
205
+ {
206
+ type: "text",
207
+ text: `No course material found on "${topic}". Try a different topic or check available materials with list_materials.`,
208
+ },
209
+ ],
210
+ };
211
+ }
212
+ const materialText = relevantContent.join("\n\n");
213
+ // Truncate if too large
214
+ const truncated = materialText.length > 15000
215
+ ? materialText.substring(0, 15000) + "\n...[truncated]"
216
+ : materialText;
217
+ return {
218
+ content: [
219
+ {
220
+ type: "text",
221
+ text: `QUIZ REQUEST: Generate ${numQuestions} practice questions on "${topic}" based ONLY on the following course material. Mix question types: multiple choice, true/false, and short answer. For each question, provide the answer and a brief explanation referencing the source material. Write questions and answers in Hebrew.\n\n=== COURSE MATERIAL ===\n${truncated}`,
222
+ },
223
+ ],
224
+ };
225
+ }
159
226
  throw new Error(`Unknown tool: ${name}`);
160
227
  });
161
228
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sad-mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "MCP server for Software Analysis and Design course materials at BGU",
5
5
  "type": "module",
6
6
  "bin": {