docbrain-mcp 1.6.0 → 1.6.2
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/package.json +1 -1
- package/run.js +26 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docbrain-mcp",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "DocBrain MCP server — query your documentation from Claude Code, Cursor, and any MCP-compatible editor",
|
|
5
5
|
"homepage": "https://github.com/docbrain-ai/docbrain",
|
|
6
6
|
"repository": {
|
package/run.js
CHANGED
|
@@ -7,10 +7,34 @@ const path = require("path");
|
|
|
7
7
|
|
|
8
8
|
const binary = path.join(__dirname, "bin", "docbrain-mcp");
|
|
9
9
|
|
|
10
|
+
// Node acts on these options itself, even after this script's path and even where they read as
|
|
11
|
+
// another flag's value: it reads the named file (and runs NODE_OPTIONS from it) or a config file
|
|
12
|
+
// before any line here runs. Versions differ: run here, Node 20.20 and 22.23 act on the env-file
|
|
13
|
+
// options before a "--", 22.23 and 26 also on the config-file options even after "--" (and 22.23
|
|
14
|
+
// on --experimental-default-config-file by prefix), and Node 16 on none; Node's source shows
|
|
15
|
+
// 20.6-22.6 matching --env-file by prefix without stopping at "--". So any argument that starts
|
|
16
|
+
// with one of them is refused, wherever it is (--env-file-if-exists starts with --env-file). This wrapper cannot undo what Node did, but it
|
|
17
|
+
// never starts DocBrain with one of them (#603): the file DocBrain reads is named with
|
|
18
|
+
// --docbrain-env, which Node ignores. Nothing typed is echoed: a value may be a key.
|
|
19
|
+
const NODE_READS = ["--env-file", "--experimental-config-file", "--experimental-default-config-file"];
|
|
20
|
+
|
|
21
|
+
function nodeReads(args) {
|
|
22
|
+
return args.some((arg) => NODE_READS.some((flag) => arg.startsWith(flag)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (nodeReads(process.argv.slice(2))) {
|
|
26
|
+
console.error(
|
|
27
|
+
"docbrain-mcp: refusing to start: Node reads --env-file and its config-file options itself. " +
|
|
28
|
+
"Name DocBrain's file with --docbrain-env instead."
|
|
29
|
+
);
|
|
30
|
+
process.exit(2);
|
|
31
|
+
}
|
|
32
|
+
|
|
10
33
|
// npm 12 turned lifecycle scripts off by default, so the postinstall hook that
|
|
11
34
|
// fetches this binary may never have run — and `npx -y docbrain-mcp@latest`,
|
|
12
|
-
// which
|
|
13
|
-
//
|
|
35
|
+
// which older setup instructions used to launch this, goes through exactly
|
|
36
|
+
// that path. (The docs now say to start the installed command: npx reads the
|
|
37
|
+
// open project's .npmrc, #603.) Fetching on first use covers it.
|
|
14
38
|
//
|
|
15
39
|
// Deliberately synchronous, before the spawn below. This runs once, at startup,
|
|
16
40
|
// before any MCP traffic exists to delay; doing it asynchronously would mean
|