learnhouse-mcp-server 1.0.0 → 1.0.1

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.
@@ -0,0 +1,220 @@
1
+ /**
2
+ * LearnHouse API Client Configuration
3
+ */
4
+ export interface LearnHouseConfig {
5
+ baseUrl: string;
6
+ orgId: number;
7
+ accessToken?: string;
8
+ }
9
+ /**
10
+ * Activity types supported by LearnHouse
11
+ */
12
+ export declare enum ActivityType {
13
+ TYPE_DYNAMIC = "TYPE_DYNAMIC",
14
+ TYPE_VIDEO = "TYPE_VIDEO",
15
+ TYPE_DOCUMENT = "TYPE_DOCUMENT",
16
+ TYPE_ASSIGNMENT = "TYPE_ASSIGNMENT",
17
+ TYPE_CUSTOM = "TYPE_CUSTOM"
18
+ }
19
+ export declare enum ActivitySubType {
20
+ SUBTYPE_DYNAMIC_PAGE = "SUBTYPE_DYNAMIC_PAGE",
21
+ SUBTYPE_VIDEO_YOUTUBE = "SUBTYPE_VIDEO_YOUTUBE",
22
+ SUBTYPE_VIDEO_HOSTED = "SUBTYPE_VIDEO_HOSTED",
23
+ SUBTYPE_DOCUMENT_PDF = "SUBTYPE_DOCUMENT_PDF",
24
+ SUBTYPE_DOCUMENT_DOC = "SUBTYPE_DOCUMENT_DOC",
25
+ SUBTYPE_ASSIGNMENT_ANY = "SUBTYPE_ASSIGNMENT_ANY",
26
+ SUBTYPE_CUSTOM = "SUBTYPE_CUSTOM"
27
+ }
28
+ /**
29
+ * TipTap content node types
30
+ */
31
+ export interface TipTapNode {
32
+ type: string;
33
+ attrs?: Record<string, unknown>;
34
+ content?: TipTapNode[];
35
+ text?: string;
36
+ }
37
+ export interface TipTapDocument {
38
+ type: "doc";
39
+ content: TipTapNode[];
40
+ }
41
+ /**
42
+ * User types
43
+ */
44
+ export interface User {
45
+ id: number;
46
+ user_uuid: string;
47
+ email: string;
48
+ username: string;
49
+ first_name?: string;
50
+ last_name?: string;
51
+ avatar_image?: string;
52
+ creation_date: string;
53
+ update_date: string;
54
+ }
55
+ export interface LoginResponse {
56
+ user: User;
57
+ tokens: {
58
+ access_token: string;
59
+ refresh_token: string;
60
+ };
61
+ }
62
+ /**
63
+ * Organization types
64
+ */
65
+ export interface Organization {
66
+ id: number;
67
+ org_uuid: string;
68
+ name: string;
69
+ slug: string;
70
+ description?: string;
71
+ logo_url?: string;
72
+ creation_date: string;
73
+ update_date: string;
74
+ }
75
+ /**
76
+ * Course types
77
+ */
78
+ export interface Course {
79
+ id: number;
80
+ course_uuid: string;
81
+ name: string;
82
+ description: string;
83
+ about?: string;
84
+ public: boolean;
85
+ org_id: number;
86
+ thumbnail_image?: string;
87
+ thumbnail_video?: string;
88
+ thumbnail_type: "IMAGE" | "VIDEO";
89
+ learnings?: string;
90
+ tags?: string;
91
+ creation_date: string;
92
+ update_date: string;
93
+ }
94
+ export interface CourseCreate {
95
+ name: string;
96
+ description: string;
97
+ public?: boolean;
98
+ about?: string;
99
+ learnings?: string[];
100
+ tags?: string[];
101
+ }
102
+ export interface CourseUpdate {
103
+ name?: string;
104
+ description?: string;
105
+ public?: boolean;
106
+ about?: string;
107
+ learnings?: string;
108
+ tags?: string;
109
+ thumbnail_image?: string;
110
+ thumbnail_type?: "IMAGE" | "VIDEO";
111
+ }
112
+ export interface FullCourse extends Course {
113
+ chapters: Chapter[];
114
+ }
115
+ /**
116
+ * Chapter types
117
+ */
118
+ export interface Chapter {
119
+ id: number;
120
+ chapter_uuid: string;
121
+ name: string;
122
+ description?: string;
123
+ org_id: number;
124
+ course_id: number;
125
+ activities: Activity[];
126
+ creation_date: string;
127
+ update_date: string;
128
+ }
129
+ export interface ChapterCreate {
130
+ name: string;
131
+ description?: string;
132
+ org_id: number;
133
+ course_id: number;
134
+ }
135
+ export interface ChapterUpdate {
136
+ name?: string;
137
+ description?: string;
138
+ }
139
+ /**
140
+ * Activity types
141
+ */
142
+ export interface Activity {
143
+ id: number;
144
+ activity_uuid: string;
145
+ name: string;
146
+ activity_type: ActivityType;
147
+ activity_sub_type: ActivitySubType;
148
+ content: TipTapDocument | Record<string, unknown>;
149
+ details?: Record<string, unknown>;
150
+ published: boolean;
151
+ org_id: number;
152
+ course_id: number;
153
+ creation_date: string;
154
+ update_date: string;
155
+ }
156
+ export interface ActivityCreate {
157
+ name: string;
158
+ chapter_id: number;
159
+ activity_type?: ActivityType;
160
+ activity_sub_type?: ActivitySubType;
161
+ content?: TipTapDocument | Record<string, unknown>;
162
+ published?: boolean;
163
+ details?: Record<string, unknown>;
164
+ }
165
+ export interface ActivityUpdate {
166
+ name?: string;
167
+ content?: TipTapDocument | Record<string, unknown>;
168
+ activity_type?: ActivityType;
169
+ activity_sub_type?: ActivitySubType;
170
+ published?: boolean;
171
+ details?: Record<string, unknown>;
172
+ }
173
+ /**
174
+ * Collection types
175
+ */
176
+ export interface Collection {
177
+ id: number;
178
+ collection_uuid: string;
179
+ name: string;
180
+ description?: string;
181
+ org_id: number;
182
+ courses: Course[];
183
+ creation_date: string;
184
+ update_date: string;
185
+ }
186
+ export interface CollectionCreate {
187
+ name: string;
188
+ description?: string;
189
+ org_id: number;
190
+ courses?: number[];
191
+ public?: boolean;
192
+ }
193
+ /**
194
+ * Trail/Progress types
195
+ */
196
+ export interface TrailProgress {
197
+ course_uuid: string;
198
+ completion_percentage: number;
199
+ completed_activities: number;
200
+ total_activities: number;
201
+ }
202
+ export interface ActivityStatus {
203
+ activity_uuid: string;
204
+ completed: boolean;
205
+ }
206
+ /**
207
+ * Search types
208
+ */
209
+ export interface SearchResult {
210
+ courses?: Course[];
211
+ users?: User[];
212
+ collections?: Collection[];
213
+ }
214
+ /**
215
+ * API Error
216
+ */
217
+ export interface ApiError {
218
+ detail: string;
219
+ status?: number;
220
+ }
package/dist/types.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Activity types supported by LearnHouse
3
+ */
4
+ export var ActivityType;
5
+ (function (ActivityType) {
6
+ ActivityType["TYPE_DYNAMIC"] = "TYPE_DYNAMIC";
7
+ ActivityType["TYPE_VIDEO"] = "TYPE_VIDEO";
8
+ ActivityType["TYPE_DOCUMENT"] = "TYPE_DOCUMENT";
9
+ ActivityType["TYPE_ASSIGNMENT"] = "TYPE_ASSIGNMENT";
10
+ ActivityType["TYPE_CUSTOM"] = "TYPE_CUSTOM";
11
+ })(ActivityType || (ActivityType = {}));
12
+ export var ActivitySubType;
13
+ (function (ActivitySubType) {
14
+ ActivitySubType["SUBTYPE_DYNAMIC_PAGE"] = "SUBTYPE_DYNAMIC_PAGE";
15
+ ActivitySubType["SUBTYPE_VIDEO_YOUTUBE"] = "SUBTYPE_VIDEO_YOUTUBE";
16
+ ActivitySubType["SUBTYPE_VIDEO_HOSTED"] = "SUBTYPE_VIDEO_HOSTED";
17
+ ActivitySubType["SUBTYPE_DOCUMENT_PDF"] = "SUBTYPE_DOCUMENT_PDF";
18
+ ActivitySubType["SUBTYPE_DOCUMENT_DOC"] = "SUBTYPE_DOCUMENT_DOC";
19
+ ActivitySubType["SUBTYPE_ASSIGNMENT_ANY"] = "SUBTYPE_ASSIGNMENT_ANY";
20
+ ActivitySubType["SUBTYPE_CUSTOM"] = "SUBTYPE_CUSTOM";
21
+ })(ActivitySubType || (ActivitySubType = {}));
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "learnhouse-mcp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "MCP Server for LearnHouse LMS - Manage courses, chapters, activities, and users",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
+ "bin": {
8
+ "learnhouse-mcp-server": "dist/index.js"
9
+ },
7
10
  "scripts": {
8
11
  "build": "tsc",
9
12
  "dev": "tsx watch src/index.ts",
package/src/client.ts CHANGED
@@ -395,7 +395,7 @@ export class LearnHouseClient {
395
395
  /**
396
396
  * Create a new collection
397
397
  */
398
- async createCollection(collection: CollectionCreate): Promise<Collection> {
398
+ async createCollection(collection: Omit<CollectionCreate, "org_id">): Promise<Collection> {
399
399
  return this.post<Collection>("/collections/", {
400
400
  ...collection,
401
401
  org_id: this.config.orgId,
package/src/index.ts CHANGED
@@ -454,7 +454,6 @@ server.addTool({
454
454
  description: args.description,
455
455
  public: args.public,
456
456
  courses: args.courses,
457
- org_id: config.orgId,
458
457
  });
459
458
  return JSON.stringify(collection, null, 2);
460
459
  },