brightspace-mcp-server 3.8.4 → 3.8.5
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/README.md +2 -0
- package/build/utils/update-checker.js +22 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,8 @@ Claude Desktop uses a separate configuration, which the setup wizard can update
|
|
|
103
103
|
|
|
104
104
|
</details>
|
|
105
105
|
|
|
106
|
+
**Running from a source checkout or fork?** When a newer release is published, the server tells a source checkout to `git pull` and `npm run build` rather than to install the npm package. For a fork you maintain, set `D2L_NO_UPDATE_CHECK=1` in the server's environment to turn off upstream update notices.
|
|
107
|
+
|
|
106
108
|
## Session Expired?
|
|
107
109
|
|
|
108
110
|
There's no login step — asking a question signs you in.
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* caller happens to read it first. A one-shot notice is invisible in practice:
|
|
19
19
|
* it gets swallowed by a single background tool call and never seen again.
|
|
20
20
|
*
|
|
21
|
+
* A source checkout gets different advice: installing the npm package would
|
|
22
|
+
* update some other copy, and for a fork it would mean leaving its changes
|
|
23
|
+
* behind. Such a checkout is told to pull and rebuild, or to opt out.
|
|
24
|
+
*
|
|
21
25
|
* Set D2L_NO_UPDATE_CHECK to any value to switch the check off entirely.
|
|
22
26
|
*/
|
|
23
27
|
import { readFileSync } from "node:fs";
|
|
@@ -54,8 +58,17 @@ export function ownNpxCacheDir(root = projectRoot) {
|
|
|
54
58
|
const match = new RegExp(`^(.*/_npx/[^/]+)/node_modules/${PACKAGE_NAME}`).exec(normalized);
|
|
55
59
|
return match ? resolve(match[1]) : null;
|
|
56
60
|
}
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Classify the package directory this process runs from. npm only ever puts
|
|
63
|
+
* the package under a `node_modules` directory, so anything else is a checkout
|
|
64
|
+
* someone built by hand, possibly a fork.
|
|
65
|
+
*/
|
|
66
|
+
export function installKindOf(root = projectRoot) {
|
|
67
|
+
if (ownNpxCacheDir(root) !== null)
|
|
68
|
+
return "npx-cache";
|
|
69
|
+
return root.split(sep).join("/").split("/").includes("node_modules")
|
|
70
|
+
? "npm-install"
|
|
71
|
+
: "source-checkout";
|
|
59
72
|
}
|
|
60
73
|
/**
|
|
61
74
|
* Remove npx cache entries holding a copy of this package, so the next
|
|
@@ -155,7 +168,7 @@ export async function fetchLatestVersion(fetchImpl = fetch) {
|
|
|
155
168
|
* swallowed, because a version check must not affect the server.
|
|
156
169
|
*/
|
|
157
170
|
export async function initUpdateChecker(deps = {}) {
|
|
158
|
-
const { fetchImpl = fetch, env = process.env, installedVersion = getInstalledVersion(),
|
|
171
|
+
const { fetchImpl = fetch, env = process.env, installedVersion = getInstalledVersion(), installKind = installKindOf(), clearCaches = () => clearAllNpxCaches(), } = deps;
|
|
159
172
|
if (env.D2L_NO_UPDATE_CHECK)
|
|
160
173
|
return;
|
|
161
174
|
try {
|
|
@@ -168,7 +181,7 @@ export async function initUpdateChecker(deps = {}) {
|
|
|
168
181
|
const to = safeVersionLabel(latest);
|
|
169
182
|
const headline = `Update available: v${from} to v${to}.`;
|
|
170
183
|
let text;
|
|
171
|
-
if (
|
|
184
|
+
if (installKind === "npx-cache") {
|
|
172
185
|
const count = await clearCaches();
|
|
173
186
|
const cleanup = count > 0
|
|
174
187
|
? `Cleared ${count} stale npx cache director${count === 1 ? "y" : "ies"} for ${PACKAGE_NAME} ` +
|
|
@@ -176,6 +189,11 @@ export async function initUpdateChecker(deps = {}) {
|
|
|
176
189
|
: "";
|
|
177
190
|
text = `${headline} ${cleanup}Restart your MCP client to pick up v${to}.`;
|
|
178
191
|
}
|
|
192
|
+
else if (installKind === "source-checkout") {
|
|
193
|
+
text = `${headline} This server runs from a source checkout, so update that checkout ` +
|
|
194
|
+
`(git pull, then npm run build) and restart your MCP client. ` +
|
|
195
|
+
`If it is a fork you maintain, set D2L_NO_UPDATE_CHECK=1 to turn off upstream update notices.`;
|
|
196
|
+
}
|
|
179
197
|
else {
|
|
180
198
|
text = `${headline} Run: ${GLOBAL_INSTALL_COMMAND}` +
|
|
181
199
|
`, then ${CLEAR_NPX_CACHE_COMMAND} and restart your MCP client.`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brightspace-mcp-server",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.5",
|
|
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",
|