thachvd-kit 1.0.21 → 1.0.22
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/bin/cli.js +9 -7
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1472,11 +1472,12 @@ function mergeMcpJson(filePath, withType = false) {
|
|
|
1472
1472
|
return { ok: false, message: `${filePath} is not valid JSON; skipped` };
|
|
1473
1473
|
}
|
|
1474
1474
|
data.mcpServers = data.mcpServers || {};
|
|
1475
|
+
const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
1475
1476
|
const baseServers = {
|
|
1476
1477
|
codegraph: { command: 'codegraph', args: ['serve', '--mcp'] },
|
|
1477
|
-
playwright: { command:
|
|
1478
|
-
context7: { command:
|
|
1479
|
-
filesystem: { command:
|
|
1478
|
+
playwright: { command: npxCmd, args: ['-y', '@playwright/mcp'] },
|
|
1479
|
+
context7: { command: npxCmd, args: ['-y', '@upstash/context7-mcp'] },
|
|
1480
|
+
filesystem: { command: npxCmd, args: ['-y', '@modelcontextprotocol/server-filesystem', targetDir.replace(/\\/g, '/')] }
|
|
1480
1481
|
};
|
|
1481
1482
|
if (data.permissions && Array.isArray(data.permissions.allow)) {
|
|
1482
1483
|
const requiredPermissions = [
|
|
@@ -1505,7 +1506,7 @@ function mergeMcpJson(filePath, withType = false) {
|
|
|
1505
1506
|
// If it points to non-existent AppData roaming file, fix it to use npx
|
|
1506
1507
|
const isLegacyNode = fsServer.command === 'node' && fsServer.args[0] && fsServer.args[0].includes('server-filesystem');
|
|
1507
1508
|
if (isLegacyNode) {
|
|
1508
|
-
fsServer.command =
|
|
1509
|
+
fsServer.command = npxCmd;
|
|
1509
1510
|
fsServer.args[0] = '-y';
|
|
1510
1511
|
fsServer.args.splice(1, 0, '@modelcontextprotocol/server-filesystem');
|
|
1511
1512
|
}
|
|
@@ -1529,9 +1530,10 @@ function appendMcpTomlIfMissing(filePath) {
|
|
|
1529
1530
|
const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : '';
|
|
1530
1531
|
const blocks = [];
|
|
1531
1532
|
const normalizedTarget = targetDir.replace(/\\/g, '/');
|
|
1533
|
+
const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
1532
1534
|
if (!/\[mcp_servers\.context7\]/.test(existing)) {
|
|
1533
1535
|
blocks.push(`[mcp_servers.context7]
|
|
1534
|
-
command = "
|
|
1536
|
+
command = "${npxCmd}"
|
|
1535
1537
|
args = ["-y", "@upstash/context7-mcp"]
|
|
1536
1538
|
startup_timeout_sec = 20
|
|
1537
1539
|
tool_timeout_sec = 120
|
|
@@ -1539,7 +1541,7 @@ tool_timeout_sec = 120
|
|
|
1539
1541
|
}
|
|
1540
1542
|
if (!/\[mcp_servers\.filesystem\]/.test(existing)) {
|
|
1541
1543
|
blocks.push(`[mcp_servers.filesystem]
|
|
1542
|
-
command = "
|
|
1544
|
+
command = "${npxCmd}"
|
|
1543
1545
|
args = ["-y", "@modelcontextprotocol/server-filesystem", "${normalizedTarget}"]
|
|
1544
1546
|
startup_timeout_sec = 20
|
|
1545
1547
|
tool_timeout_sec = 120
|
|
@@ -1555,7 +1557,7 @@ tool_timeout_sec = 120
|
|
|
1555
1557
|
}
|
|
1556
1558
|
if (!/\[mcp_servers\.playwright\]/.test(existing)) {
|
|
1557
1559
|
blocks.push(`[mcp_servers.playwright]
|
|
1558
|
-
command = "
|
|
1560
|
+
command = "${npxCmd}"
|
|
1559
1561
|
args = ["-y", "@playwright/mcp"]
|
|
1560
1562
|
startup_timeout_sec = 20
|
|
1561
1563
|
tool_timeout_sec = 120
|