brightspace-mcp-server 3.13.15 → 3.13.17
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/build/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { configureDevActivity, trackToolActivity } from "./utils/dev-activity.js
|
|
|
18
18
|
import { readFileSync } from "node:fs";
|
|
19
19
|
import { fileURLToPath } from "node:url";
|
|
20
20
|
import { dirname, resolve } from "node:path";
|
|
21
|
-
import { registerGetMyCourses, registerGetUpcomingDueDates, registerGetCalendarEvents, registerGetMyGrades, registerGetAnnouncements, registerGetAssignments, registerGetAssignmentRubric, registerGetAssignmentFiles, registerGetAnnouncementFiles, registerGetCourseContent, registerDownloadFile, registerGetClasslistEmails, registerGetRoster, registerGetMyGroups, registerGetSyllabus, registerGetDiscussions, registerGetVideoTranscript, registerGetServerInfo, registerSearchCourse, registerSignOut, registerGetDropboxFolders, registerGetDropboxSubmissions, registerGetDropboxUserSubmissions, registerGetDropboxFeedback, registerGetRubricsForObject, registerDownloadDropboxSubmissionFile, relayMfaChallenges, currentMfaAnnouncer, } from "./tools/index.js";
|
|
21
|
+
import { registerGetMyCourses, registerGetUpcomingDueDates, registerGetCalendarEvents, registerGetMyGrades, registerGetAnnouncements, registerGetAssignments, registerGetAssignmentRubric, registerGetAssignmentFiles, registerGetAnnouncementFiles, registerGetCourseContent, registerDownloadFile, registerGetClasslistEmails, registerGetRoster, registerGetMyGroups, registerGetSyllabus, registerGetDiscussions, registerGetVideoTranscript, registerGetServerInfo, registerSearchCourse, registerSignOut, registerGetDropboxFolders, registerGetDropboxSubmissions, registerGetDropboxUserSubmissions, registerGetDropboxFeedback, registerGetRubricsForObject, registerDownloadDropboxSubmissionFile, acceptOmittedArguments, relayMfaChallenges, currentMfaAnnouncer, } from "./tools/index.js";
|
|
22
22
|
import { registerWeeklyBriefingPrompt, registerGradeAuditPrompt, registerStudyPlannerPrompt, registerCourseSummaryPrompt, } from "./prompts/index.js";
|
|
23
23
|
const __filename = fileURLToPath(import.meta.url);
|
|
24
24
|
const __dirname = dirname(__filename);
|
|
@@ -121,6 +121,9 @@ else {
|
|
|
121
121
|
activeOnly: config.courseFilter.activeOnly,
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
+
// A client may leave `arguments` off a call to a tool that takes none;
|
|
125
|
+
// SDK 1.26-1.31 reject that. Must run before the first registration.
|
|
126
|
+
acceptOmittedArguments(server);
|
|
124
127
|
// Register MCP tools. Each one, when its client sends a progress token,
|
|
125
128
|
// shows an MFA challenge mid-call and waits for the approval instead of
|
|
126
129
|
// asking to be called again (see relayMfaChallenges).
|
|
@@ -61,7 +61,7 @@ export function registerGetDropboxFolders(server, apiClient) {
|
|
|
61
61
|
name: f.Name,
|
|
62
62
|
categoryId: f.CategoryId,
|
|
63
63
|
isHidden: f.IsHidden,
|
|
64
|
-
isGroup: f.GroupTypeId !== null,
|
|
64
|
+
isGroup: f.GroupTypeId !== null && f.GroupTypeId !== undefined,
|
|
65
65
|
submissionType: submissionTypeLabel(f.SubmissionType),
|
|
66
66
|
dueDate: f.DueDate ?? null,
|
|
67
67
|
startDate: f.StartDate ?? null,
|
package/build/tools/index.js
CHANGED
|
@@ -34,4 +34,5 @@ export { registerDownloadDropboxSubmissionFile } from "./download-dropbox-submis
|
|
|
34
34
|
// Re-export shared helpers and schemas for convenience
|
|
35
35
|
export { toolResponse, errorResponse, sanitizeError } from "./tool-helpers.js";
|
|
36
36
|
export { relayMfaChallenges, currentMfaAnnouncer } from "./mfa-relay.js";
|
|
37
|
+
export { acceptOmittedArguments } from "./omitted-arguments.js";
|
|
37
38
|
export * from "./schemas.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Purdue Brightspace MCP Server
|
|
3
|
+
* Copyright (c) 2026 Rohan Muppa. All rights reserved.
|
|
4
|
+
* Licensed under MIT — see LICENSE file for details.
|
|
5
|
+
*/
|
|
6
|
+
import { CallToolRequestSchema, GetPromptRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
function withArguments(request) {
|
|
8
|
+
if (request.params?.arguments !== undefined)
|
|
9
|
+
return request;
|
|
10
|
+
return { ...request, params: { ...request.params, arguments: {} } };
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Let a client leave `arguments` off a tools/call or prompts/get.
|
|
14
|
+
*
|
|
15
|
+
* The protocol makes the field optional, and some clients omit it for a tool
|
|
16
|
+
* that takes nothing. MCP SDK 1.26 through 1.31 check the missing value
|
|
17
|
+
* against the tool's schema as-is, so every tool whose inputs are all
|
|
18
|
+
* optional (get_server_info, sign_out, get_my_courses, ...) failed with
|
|
19
|
+
* "Input validation error: expected object, received undefined". SDK 1.32
|
|
20
|
+
* reads a missing value as `{}`, and this does the same on every version the
|
|
21
|
+
* dependency range admits. A tool with a required field still rejects the
|
|
22
|
+
* call, because `{}` fails its schema.
|
|
23
|
+
*
|
|
24
|
+
* Call this before registering any tool or prompt: McpServer installs its
|
|
25
|
+
* request handlers on the first registration, and only handlers installed
|
|
26
|
+
* after this call are wrapped.
|
|
27
|
+
*/
|
|
28
|
+
export function acceptOmittedArguments(server) {
|
|
29
|
+
const lowLevel = server.server;
|
|
30
|
+
const install = lowLevel.setRequestHandler.bind(lowLevel);
|
|
31
|
+
lowLevel.setRequestHandler = (schema, handler) => install(schema, schema === CallToolRequestSchema || schema === GetPromptRequestSchema
|
|
32
|
+
? (request, extra) => handler(withArguments(request), extra)
|
|
33
|
+
: handler);
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brightspace-mcp-server",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.17",
|
|
4
4
|
"mcpName": "io.github.RohanMuppa/brightspace",
|
|
5
5
|
"description": "MCP server for Brightspace (D2L). Check grades, due dates, assignments, announcements, syllabus, rosters and more via Claude, ChatGPT, Cursor, Windsurf, or any MCP client.",
|
|
6
6
|
"type": "module",
|