learnhouse-mcp-server 1.0.1 → 1.0.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/dist/index.js +48 -13
- package/package.json +1 -1
- package/src/index.ts +34 -0
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
/**
|
|
2
3
|
* LearnHouse MCP Server
|
|
3
4
|
*
|
|
@@ -38,19 +39,19 @@ async function getClient() {
|
|
|
38
39
|
const server = new FastMCP({
|
|
39
40
|
name: "LearnHouse MCP Server",
|
|
40
41
|
version: "1.0.0",
|
|
41
|
-
instructions: `
|
|
42
|
-
LearnHouse MCP Server provides tools to manage an LMS (Learning Management System).
|
|
43
|
-
|
|
44
|
-
Available capabilities:
|
|
45
|
-
- **Course Management**: List, create, update, delete courses
|
|
46
|
-
- **Chapter Management**: Organize chapters within courses
|
|
47
|
-
- **Activity Management**: Create and manage learning activities (documents, videos, PDFs)
|
|
48
|
-
- **Content Creation**: Set TipTap document content for activities
|
|
49
|
-
- **Progress Tracking**: Track user progress through courses
|
|
50
|
-
- **Search**: Search across courses and content
|
|
51
|
-
|
|
52
|
-
Organization ID: ${config.orgId}
|
|
53
|
-
API URL: ${config.baseUrl}
|
|
42
|
+
instructions: `
|
|
43
|
+
LearnHouse MCP Server provides tools to manage an LMS (Learning Management System).
|
|
44
|
+
|
|
45
|
+
Available capabilities:
|
|
46
|
+
- **Course Management**: List, create, update, delete courses
|
|
47
|
+
- **Chapter Management**: Organize chapters within courses
|
|
48
|
+
- **Activity Management**: Create and manage learning activities (documents, videos, PDFs)
|
|
49
|
+
- **Content Creation**: Set TipTap document content for activities
|
|
50
|
+
- **Progress Tracking**: Track user progress through courses
|
|
51
|
+
- **Search**: Search across courses and content
|
|
52
|
+
|
|
53
|
+
Organization ID: ${config.orgId}
|
|
54
|
+
API URL: ${config.baseUrl}
|
|
54
55
|
`.trim(),
|
|
55
56
|
});
|
|
56
57
|
server.addTool({
|
|
@@ -479,6 +480,40 @@ server.addTool({
|
|
|
479
480
|
return JSON.stringify(results, null, 2);
|
|
480
481
|
},
|
|
481
482
|
});
|
|
483
|
+
server.addTool({
|
|
484
|
+
name: "get_course_full",
|
|
485
|
+
description: "Get full course hierarchy including chapters and activities",
|
|
486
|
+
parameters: z.object({
|
|
487
|
+
course_uuid: z.string().describe("The UUID of the course"),
|
|
488
|
+
}),
|
|
489
|
+
execute: async (args) => {
|
|
490
|
+
const api = await getClient();
|
|
491
|
+
const course = await api.getCourseMeta(args.course_uuid);
|
|
492
|
+
return JSON.stringify(course, null, 2);
|
|
493
|
+
},
|
|
494
|
+
});
|
|
495
|
+
server.addTool({
|
|
496
|
+
name: "update_collection",
|
|
497
|
+
description: "Update a collection",
|
|
498
|
+
parameters: z.object({
|
|
499
|
+
collection_uuid: z.string().describe("The UUID of the collection"),
|
|
500
|
+
name: z.string().optional().describe("Collection name"),
|
|
501
|
+
description: z.string().optional().describe("Collection description"),
|
|
502
|
+
public: z.boolean().optional().describe("Whether the collection is public"),
|
|
503
|
+
}),
|
|
504
|
+
execute: async (args) => {
|
|
505
|
+
const api = await getClient();
|
|
506
|
+
const update = {};
|
|
507
|
+
if (args.name)
|
|
508
|
+
update.name = args.name;
|
|
509
|
+
if (args.description)
|
|
510
|
+
update.description = args.description;
|
|
511
|
+
if (args.public !== undefined)
|
|
512
|
+
update.public = args.public;
|
|
513
|
+
const collection = await api.updateCollection(args.collection_uuid, update);
|
|
514
|
+
return JSON.stringify(collection, null, 2);
|
|
515
|
+
},
|
|
516
|
+
});
|
|
482
517
|
// ============================================================
|
|
483
518
|
// Start Server
|
|
484
519
|
// ============================================================
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -520,6 +520,40 @@ server.addTool({
|
|
|
520
520
|
},
|
|
521
521
|
});
|
|
522
522
|
|
|
523
|
+
server.addTool({
|
|
524
|
+
name: "get_course_full",
|
|
525
|
+
description: "Get full course hierarchy including chapters and activities",
|
|
526
|
+
parameters: z.object({
|
|
527
|
+
course_uuid: z.string().describe("The UUID of the course"),
|
|
528
|
+
}),
|
|
529
|
+
execute: async (args) => {
|
|
530
|
+
const api = await getClient();
|
|
531
|
+
const course = await api.getCourseMeta(args.course_uuid);
|
|
532
|
+
return JSON.stringify(course, null, 2);
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
server.addTool({
|
|
537
|
+
name: "update_collection",
|
|
538
|
+
description: "Update a collection",
|
|
539
|
+
parameters: z.object({
|
|
540
|
+
collection_uuid: z.string().describe("The UUID of the collection"),
|
|
541
|
+
name: z.string().optional().describe("Collection name"),
|
|
542
|
+
description: z.string().optional().describe("Collection description"),
|
|
543
|
+
public: z.boolean().optional().describe("Whether the collection is public"),
|
|
544
|
+
}),
|
|
545
|
+
execute: async (args) => {
|
|
546
|
+
const api = await getClient();
|
|
547
|
+
const update: any = {};
|
|
548
|
+
if (args.name) update.name = args.name;
|
|
549
|
+
if (args.description) update.description = args.description;
|
|
550
|
+
if (args.public !== undefined) update.public = args.public;
|
|
551
|
+
|
|
552
|
+
const collection = await api.updateCollection(args.collection_uuid, update);
|
|
553
|
+
return JSON.stringify(collection, null, 2);
|
|
554
|
+
},
|
|
555
|
+
});
|
|
556
|
+
|
|
523
557
|
// ============================================================
|
|
524
558
|
// Start Server
|
|
525
559
|
// ============================================================
|