pjdev2d-cli 1.2.1 → 1.3.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/README.md
CHANGED
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
const isWindows = process.platform === "win32";
|
|
8
|
+
const binDir = path.join(__dirname, "node_modules", ".bin");
|
|
9
|
+
|
|
10
|
+
const browserPaths = {
|
|
11
|
+
chrome: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
|
|
12
|
+
edge: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function getBinPath(name) {
|
|
16
|
+
return path.join(binDir, isWindows ? `${name}.cmd` : name);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function spawnServer(command, args = [], env = {}) {
|
|
20
|
+
const child = spawn(command, args, {
|
|
21
|
+
cwd: __dirname,
|
|
22
|
+
env: { ...process.env, ...env },
|
|
23
|
+
stdio: "inherit",
|
|
24
|
+
shell: isWindows,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
child.on("error", (error) => {
|
|
28
|
+
console.error(`Failed to start ${command}: ${error.message}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
child.on("exit", (code, signal) => {
|
|
33
|
+
if (signal) {
|
|
34
|
+
process.kill(process.pid, signal);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
process.exit(code ?? 0);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function runServer(serverName) {
|
|
43
|
+
switch (serverName) {
|
|
44
|
+
case "filesystem":
|
|
45
|
+
spawnServer(getBinPath("mcp-server-filesystem"), [
|
|
46
|
+
"C:\\Users\\MERN-Stack2025\\Desktop\\Pejay",
|
|
47
|
+
]);
|
|
48
|
+
return;
|
|
49
|
+
case "browser_chrome":
|
|
50
|
+
spawnServer(getBinPath("mcpbrowser"), [], {
|
|
51
|
+
CHROME_PATH: browserPaths.chrome,
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
case "browser_edge":
|
|
55
|
+
spawnServer(getBinPath("mcpbrowser"), [], {
|
|
56
|
+
CHROME_PATH: browserPaths.edge,
|
|
57
|
+
});
|
|
58
|
+
return;
|
|
59
|
+
case "tailwind":
|
|
60
|
+
spawnServer(getBinPath("flowbite-mcp"));
|
|
61
|
+
return;
|
|
62
|
+
case "github":
|
|
63
|
+
spawnServer(getBinPath("mcp-server-github"));
|
|
64
|
+
return;
|
|
65
|
+
default:
|
|
66
|
+
console.error(
|
|
67
|
+
`Unknown server "${serverName}". Use one of: filesystem, browser_chrome, browser_edge, tailwind, github.`,
|
|
68
|
+
);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const serverName = process.argv[2];
|
|
74
|
+
|
|
75
|
+
if (!serverName) {
|
|
76
|
+
console.error(
|
|
77
|
+
"Usage: node index.js <filesystem|browser_chrome|browser_edge|tailwind|github>",
|
|
78
|
+
);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
runServer(serverName);
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
File path
|
|
86
|
+
C:\Users\MERN-Stack2025\.gemini\config*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"github": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": [
|
|
6
|
+
"C:\\Users\\MERN-Stack2025\\.gemini\\config\\index.js",
|
|
7
|
+
"github"
|
|
8
|
+
],
|
|
9
|
+
"env": {
|
|
10
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "REPLACE_WITH_A_NEW_TOKEN"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"filesystem": {
|
|
14
|
+
"command": "node",
|
|
15
|
+
"args": [
|
|
16
|
+
"C:\\Users\\MERN-Stack2025\\.gemini\\config\\index.js",
|
|
17
|
+
"filesystem"
|
|
18
|
+
],
|
|
19
|
+
"env": {}
|
|
20
|
+
},
|
|
21
|
+
"browser_chrome": {
|
|
22
|
+
"command": "node",
|
|
23
|
+
"args": [
|
|
24
|
+
"C:\\Users\\MERN-Stack2025\\.gemini\\config\\index.js",
|
|
25
|
+
"browser_chrome"
|
|
26
|
+
],
|
|
27
|
+
"env": {}
|
|
28
|
+
},
|
|
29
|
+
"browser_edge": {
|
|
30
|
+
"command": "node",
|
|
31
|
+
"args": [
|
|
32
|
+
"C:\\Users\\MERN-Stack2025\\.gemini\\config\\index.js",
|
|
33
|
+
"browser_edge"
|
|
34
|
+
],
|
|
35
|
+
"env": {}
|
|
36
|
+
},
|
|
37
|
+
"tailwind": {
|
|
38
|
+
"command": "node",
|
|
39
|
+
"args": [
|
|
40
|
+
"C:\\Users\\MERN-Stack2025\\.gemini\\config\\index.js",
|
|
41
|
+
"tailwind"
|
|
42
|
+
],
|
|
43
|
+
"env": {}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|