canvas-lms-mcp 1.6.0 → 1.7.0
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/canvas/index.cjs +4 -2
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.js +3 -1
- package/dist/{chunk-HPYKACEZ.cjs → chunk-J4ENRNED.cjs} +23 -23
- package/dist/{chunk-HPYKACEZ.cjs.map → chunk-J4ENRNED.cjs.map} +1 -1
- package/dist/{chunk-2ZN5FAAL.js → chunk-JLXP5GLN.js} +2 -2
- package/dist/{chunk-KEDPR66W.cjs → chunk-LEUI5FLW.cjs} +190 -36
- package/dist/chunk-LEUI5FLW.cjs.map +1 -0
- package/dist/{chunk-L3OHOWW5.js → chunk-UODLH4L6.js} +156 -2
- package/dist/chunk-UODLH4L6.js.map +1 -0
- package/dist/http.cjs +3 -3
- package/dist/http.js +2 -2
- package/dist/server.cjs +3 -3
- package/dist/server.js +2 -2
- package/dist/stdio.cjs +3 -3
- package/dist/stdio.js +2 -2
- package/package.json +7 -3
- package/dist/chunk-KEDPR66W.cjs.map +0 -1
- package/dist/chunk-L3OHOWW5.js.map +0 -1
- /package/dist/{chunk-2ZN5FAAL.js.map → chunk-JLXP5GLN.js.map} +0 -0
package/dist/canvas/index.cjs
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var _chunkKEDPR66Wcjs = require('../chunk-KEDPR66W.cjs');
|
|
8
7
|
|
|
8
|
+
var _chunkLEUI5FLWcjs = require('../chunk-LEUI5FLW.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.CanvasApiError = _chunkLEUI5FLWcjs.CanvasApiError; exports.CanvasClient = _chunkLEUI5FLWcjs.CanvasClient; exports.CanvasHttpClient = _chunkLEUI5FLWcjs.CanvasHttpClient; exports.GeneratedUsersModule = _chunkLEUI5FLWcjs.GeneratedUsersModule; exports.appendCanvasQuery = _chunkLEUI5FLWcjs.appendCanvasQuery; exports.toCanvasQuery = _chunkLEUI5FLWcjs.toCanvasQuery;
|
|
15
17
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/canvas-lms-mcp/canvas-lms-mcp/dist/canvas/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/canvas-lms-mcp/canvas-lms-mcp/dist/canvas/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,iXAAC","file":"/home/runner/work/canvas-lms-mcp/canvas-lms-mcp/dist/canvas/index.cjs"}
|
package/dist/canvas/index.js
CHANGED
|
@@ -2,13 +2,15 @@ import {
|
|
|
2
2
|
CanvasApiError,
|
|
3
3
|
CanvasClient,
|
|
4
4
|
CanvasHttpClient,
|
|
5
|
+
GeneratedUsersModule,
|
|
5
6
|
appendCanvasQuery,
|
|
6
7
|
toCanvasQuery
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-UODLH4L6.js";
|
|
8
9
|
export {
|
|
9
10
|
CanvasApiError,
|
|
10
11
|
CanvasClient,
|
|
11
12
|
CanvasHttpClient,
|
|
13
|
+
GeneratedUsersModule,
|
|
12
14
|
appendCanvasQuery,
|
|
13
15
|
toCanvasQuery
|
|
14
16
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkLEUI5FLWcjs = require('./chunk-LEUI5FLW.cjs');
|
|
12
12
|
|
|
13
13
|
// src/server.ts
|
|
14
14
|
var _mcpjs = require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
@@ -113,7 +113,7 @@ function accountTools(canvas) {
|
|
|
113
113
|
|
|
114
114
|
// src/tools/errors.ts
|
|
115
115
|
function formatError(error) {
|
|
116
|
-
if (error instanceof
|
|
116
|
+
if (error instanceof _chunkLEUI5FLWcjs.CanvasApiError) {
|
|
117
117
|
const status = error.status;
|
|
118
118
|
const message = error.message;
|
|
119
119
|
switch (status) {
|
|
@@ -157,7 +157,7 @@ function analyticsTools(canvas) {
|
|
|
157
157
|
inputSchema: {
|
|
158
158
|
course_id: _zod.z.number().describe("The Canvas course ID"),
|
|
159
159
|
search_term: _zod.z.string().describe("The keyword or phrase to search for"),
|
|
160
|
-
content_types: _zod.z.array(_zod.z.enum(
|
|
160
|
+
content_types: _zod.z.array(_zod.z.enum(_chunkLEUI5FLWcjs.SEARCH_CONTENT_TYPES)).optional().describe(
|
|
161
161
|
"Content types to search. Defaults to all types: pages, discussions, assignments, announcements."
|
|
162
162
|
)
|
|
163
163
|
},
|
|
@@ -169,7 +169,7 @@ function analyticsTools(canvas) {
|
|
|
169
169
|
const courseId = params.course_id;
|
|
170
170
|
const searchTerm = params.search_term;
|
|
171
171
|
const types = _nullishCoalesce(params.content_types, () => ( [
|
|
172
|
-
...
|
|
172
|
+
..._chunkLEUI5FLWcjs.SEARCH_CONTENT_TYPES
|
|
173
173
|
]));
|
|
174
174
|
if (types.length === 0) return { results: [] };
|
|
175
175
|
const settled = await Promise.allSettled(
|
|
@@ -1459,7 +1459,7 @@ function outcomeTools(canvas) {
|
|
|
1459
1459
|
name: "get_root_outcome_group",
|
|
1460
1460
|
description: "Get the root outcome group for an account or course context.",
|
|
1461
1461
|
inputSchema: {
|
|
1462
|
-
context_type: _zod.z.enum(
|
|
1462
|
+
context_type: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_CONTEXT_TYPES).describe("Whether to read outcomes from an account or course context."),
|
|
1463
1463
|
context_id: _zod.z.number().describe("The Canvas account ID or course ID for the context.")
|
|
1464
1464
|
},
|
|
1465
1465
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
@@ -1472,7 +1472,7 @@ function outcomeTools(canvas) {
|
|
|
1472
1472
|
name: "list_outcome_groups",
|
|
1473
1473
|
description: "List all outcome groups for an account or course context.",
|
|
1474
1474
|
inputSchema: {
|
|
1475
|
-
context_type: _zod.z.enum(
|
|
1475
|
+
context_type: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_CONTEXT_TYPES).describe("Whether to read outcome groups from an account or course context."),
|
|
1476
1476
|
context_id: _zod.z.number().describe("The Canvas account ID or course ID for the context.")
|
|
1477
1477
|
},
|
|
1478
1478
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
@@ -1485,10 +1485,10 @@ function outcomeTools(canvas) {
|
|
|
1485
1485
|
name: "list_outcome_group_links",
|
|
1486
1486
|
description: "List all outcome links in an account or course context.",
|
|
1487
1487
|
inputSchema: {
|
|
1488
|
-
context_type: _zod.z.enum(
|
|
1488
|
+
context_type: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_CONTEXT_TYPES).describe("Whether to read outcome links from an account or course context."),
|
|
1489
1489
|
context_id: _zod.z.number().describe("The Canvas account ID or course ID for the context."),
|
|
1490
|
-
outcome_style: _zod.z.enum(
|
|
1491
|
-
outcome_group_style: _zod.z.enum(
|
|
1490
|
+
outcome_style: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_DETAIL_LEVELS).optional().describe('Outcome detail level. Use "full" to include expanded outcome fields.'),
|
|
1491
|
+
outcome_group_style: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_DETAIL_LEVELS).optional().describe(
|
|
1492
1492
|
'Outcome group detail level. Use "full" to include expanded outcome group fields.'
|
|
1493
1493
|
)
|
|
1494
1494
|
},
|
|
@@ -1506,7 +1506,7 @@ function outcomeTools(canvas) {
|
|
|
1506
1506
|
name: "get_outcome_group",
|
|
1507
1507
|
description: "Get details for a specific outcome group in an account or course context.",
|
|
1508
1508
|
inputSchema: {
|
|
1509
|
-
context_type: _zod.z.enum(
|
|
1509
|
+
context_type: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_CONTEXT_TYPES).describe("The outcome group context type."),
|
|
1510
1510
|
context_id: _zod.z.number().describe("The Canvas account ID or course ID for the context."),
|
|
1511
1511
|
outcome_group_id: _zod.z.number().describe("The Canvas outcome group ID.")
|
|
1512
1512
|
},
|
|
@@ -1521,10 +1521,10 @@ function outcomeTools(canvas) {
|
|
|
1521
1521
|
name: "list_outcome_group_outcomes",
|
|
1522
1522
|
description: "List the linked outcomes directly under a specific outcome group.",
|
|
1523
1523
|
inputSchema: {
|
|
1524
|
-
context_type: _zod.z.enum(
|
|
1524
|
+
context_type: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_CONTEXT_TYPES).describe("The outcome group context type."),
|
|
1525
1525
|
context_id: _zod.z.number().describe("The Canvas account ID or course ID for the context."),
|
|
1526
1526
|
outcome_group_id: _zod.z.number().describe("The Canvas outcome group ID."),
|
|
1527
|
-
outcome_style: _zod.z.enum(
|
|
1527
|
+
outcome_style: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_DETAIL_LEVELS).optional().describe('Outcome detail level. Use "full" to include expanded outcome fields.')
|
|
1528
1528
|
},
|
|
1529
1529
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
1530
1530
|
handler: async (params) => canvas.outcomes.listGroupOutcomes(
|
|
@@ -1540,7 +1540,7 @@ function outcomeTools(canvas) {
|
|
|
1540
1540
|
name: "list_outcome_group_subgroups",
|
|
1541
1541
|
description: "List the immediate child outcome groups under a specific outcome group.",
|
|
1542
1542
|
inputSchema: {
|
|
1543
|
-
context_type: _zod.z.enum(
|
|
1543
|
+
context_type: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_CONTEXT_TYPES).describe("The outcome group context type."),
|
|
1544
1544
|
context_id: _zod.z.number().describe("The Canvas account ID or course ID for the context."),
|
|
1545
1545
|
outcome_group_id: _zod.z.number().describe("The Canvas outcome group ID.")
|
|
1546
1546
|
},
|
|
@@ -1601,14 +1601,14 @@ function outcomeTools(canvas) {
|
|
|
1601
1601
|
inputSchema: {
|
|
1602
1602
|
course_id: _zod.z.number().describe("The Canvas course ID."),
|
|
1603
1603
|
aggregate: _zod.z.enum(["course"]).optional().describe("Aggregate all student rollups into a single course-level rollup."),
|
|
1604
|
-
aggregate_stat: _zod.z.enum(
|
|
1604
|
+
aggregate_stat: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_ROLLUP_AGGREGATE_STATS).optional().describe('Statistic to use when aggregate="course".'),
|
|
1605
1605
|
user_ids: _zod.z.array(_zod.z.union([_zod.z.number(), _zod.z.string()])).optional().describe('Optional Canvas user IDs or SIS user IDs prefixed with "sis_user_id:".'),
|
|
1606
1606
|
outcome_ids: _zod.z.array(_zod.z.number()).optional().describe("Optional outcome IDs to restrict the rollups."),
|
|
1607
1607
|
include_courses: _zod.z.boolean().optional().describe("Include linked course details in the response payload."),
|
|
1608
|
-
exclude: _zod.z.array(_zod.z.enum(
|
|
1609
|
-
sort_by: _zod.z.enum(
|
|
1608
|
+
exclude: _zod.z.array(_zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_EXCLUDE_OPTIONS)).optional().describe("Optional rollup exclusions for missing users or missing outcome results."),
|
|
1609
|
+
sort_by: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_ROLLUP_SORT_BY).optional().describe("Sort rollups by student name or by a specific outcome score."),
|
|
1610
1610
|
sort_outcome_id: _zod.z.number().optional().describe('Outcome ID to sort by when sort_by="outcome".'),
|
|
1611
|
-
sort_order: _zod.z.enum(
|
|
1611
|
+
sort_order: _zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_SORT_ORDER).optional().describe("Sort order to apply when sorting rollups."),
|
|
1612
1612
|
add_defaults: _zod.z.boolean().optional().describe("Include default mastery colors and levels when Canvas supports it.")
|
|
1613
1613
|
},
|
|
1614
1614
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
@@ -1651,7 +1651,7 @@ function outcomeTools(canvas) {
|
|
|
1651
1651
|
description: "Get mastery distribution analytics for outcomes in a course, optionally filtered by students or outcomes.",
|
|
1652
1652
|
inputSchema: {
|
|
1653
1653
|
course_id: _zod.z.number().describe("The Canvas course ID."),
|
|
1654
|
-
exclude: _zod.z.array(_zod.z.enum(
|
|
1654
|
+
exclude: _zod.z.array(_zod.z.enum(_chunkLEUI5FLWcjs.OUTCOME_EXCLUDE_OPTIONS)).optional().describe("Optional exclusions for missing users or missing outcome results."),
|
|
1655
1655
|
outcome_ids: _zod.z.array(_zod.z.number()).optional().describe("Optional outcome IDs to restrict the distribution results."),
|
|
1656
1656
|
student_ids: _zod.z.array(_zod.z.union([_zod.z.number(), _zod.z.string()])).optional().describe('Optional Canvas student IDs or SIS user IDs prefixed with "sis_user_id:".'),
|
|
1657
1657
|
include_alignment_distributions: _zod.z.boolean().optional().describe("Include contributing score distributions for alignments."),
|
|
@@ -2537,7 +2537,7 @@ function registerAllTools(server, canvas) {
|
|
|
2537
2537
|
content: [{ type: "text", text }]
|
|
2538
2538
|
};
|
|
2539
2539
|
} catch (error) {
|
|
2540
|
-
if (error instanceof
|
|
2540
|
+
if (error instanceof _chunkLEUI5FLWcjs.CanvasApiError) {
|
|
2541
2541
|
} else {
|
|
2542
2542
|
console.error(`Unexpected error in tool "${tool.name}":`, error);
|
|
2543
2543
|
}
|
|
@@ -2585,7 +2585,7 @@ function registerSyllabusResource(server, canvas) {
|
|
|
2585
2585
|
]
|
|
2586
2586
|
};
|
|
2587
2587
|
} catch (error) {
|
|
2588
|
-
if (!(error instanceof
|
|
2588
|
+
if (!(error instanceof _chunkLEUI5FLWcjs.CanvasApiError)) {
|
|
2589
2589
|
console.error("Unexpected error in syllabus resource:", error);
|
|
2590
2590
|
}
|
|
2591
2591
|
return {
|
|
@@ -2634,7 +2634,7 @@ function registerAssignmentDescriptionResource(server, canvas) {
|
|
|
2634
2634
|
]
|
|
2635
2635
|
};
|
|
2636
2636
|
} catch (error) {
|
|
2637
|
-
if (!(error instanceof
|
|
2637
|
+
if (!(error instanceof _chunkLEUI5FLWcjs.CanvasApiError)) {
|
|
2638
2638
|
console.error("Unexpected error in assignment-description resource:", error);
|
|
2639
2639
|
}
|
|
2640
2640
|
return {
|
|
@@ -2653,7 +2653,7 @@ function registerAllResources(server, canvas) {
|
|
|
2653
2653
|
|
|
2654
2654
|
// src/server.ts
|
|
2655
2655
|
function createCanvasMCPServer(config) {
|
|
2656
|
-
const canvas = new (0,
|
|
2656
|
+
const canvas = new (0, _chunkLEUI5FLWcjs.CanvasClient)({
|
|
2657
2657
|
token: config.token,
|
|
2658
2658
|
baseUrl: config.baseUrl
|
|
2659
2659
|
});
|
|
@@ -2669,4 +2669,4 @@ function createCanvasMCPServer(config) {
|
|
|
2669
2669
|
|
|
2670
2670
|
|
|
2671
2671
|
exports.createCanvasMCPServer = createCanvasMCPServer;
|
|
2672
|
-
//# sourceMappingURL=chunk-
|
|
2672
|
+
//# sourceMappingURL=chunk-J4ENRNED.cjs.map
|