ls-mcp 1.4.0 → 1.5.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/dist/bin/cli.cjs +74 -3
- package/dist/bin/cli.mjs +74 -3
- package/dist/main.cjs +74 -3
- package/dist/main.mjs +74 -3
- package/package.json +1 -1
- package/src/main.ts +66 -1
- package/src/services/mcp-config-linter-service.ts +18 -2
package/dist/bin/cli.cjs
CHANGED
|
@@ -30,6 +30,7 @@ var import_node_util8 = require("util");
|
|
|
30
30
|
// src/main.ts
|
|
31
31
|
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
32
32
|
var import_node_os2 = require("os");
|
|
33
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
33
34
|
|
|
34
35
|
// src/services/mcp-config-linter-service.ts
|
|
35
36
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -58,8 +59,16 @@ var MCPConfigLinterService = class {
|
|
|
58
59
|
async getMCPServers() {
|
|
59
60
|
const fileContentRaw = await this.getFileContent();
|
|
60
61
|
const fileContentsData = JSON.parse(fileContentRaw);
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
if (fileContentsData?.servers) {
|
|
63
|
+
return fileContentsData.servers;
|
|
64
|
+
}
|
|
65
|
+
if (fileContentsData?.mcp?.servers) {
|
|
66
|
+
return fileContentsData.mcp.servers;
|
|
67
|
+
}
|
|
68
|
+
if (fileContentsData?.mcpServers) {
|
|
69
|
+
return fileContentsData.mcpServers;
|
|
70
|
+
}
|
|
71
|
+
return {};
|
|
63
72
|
}
|
|
64
73
|
async getFileContent() {
|
|
65
74
|
if (this.fileContents) {
|
|
@@ -435,7 +444,11 @@ var MCPServerManagerService = class {
|
|
|
435
444
|
// src/main.ts
|
|
436
445
|
var osSpecificPaths = {
|
|
437
446
|
claude: [],
|
|
438
|
-
cursor: []
|
|
447
|
+
cursor: [],
|
|
448
|
+
vscode: [],
|
|
449
|
+
cline: [],
|
|
450
|
+
windsurf: [],
|
|
451
|
+
roo: []
|
|
439
452
|
};
|
|
440
453
|
if ((0, import_node_os2.platform)() === "win32") {
|
|
441
454
|
osSpecificPaths["claude"] = [
|
|
@@ -445,6 +458,22 @@ if ((0, import_node_os2.platform)() === "win32") {
|
|
|
445
458
|
{ filePath: `${process.env.HOME}\\.cursor\\mcp.json`, type: "global" },
|
|
446
459
|
{ filePath: ".cursor\\mcp.json", type: "local" }
|
|
447
460
|
];
|
|
461
|
+
osSpecificPaths["vscode"] = [
|
|
462
|
+
{ filePath: ".vscode\\mcp.json", type: "local" },
|
|
463
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\settings.json`, type: "global" },
|
|
464
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\settings.json`, type: "global" }
|
|
465
|
+
];
|
|
466
|
+
osSpecificPaths["cline"] = [
|
|
467
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
468
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
469
|
+
];
|
|
470
|
+
osSpecificPaths["windsurf"] = [
|
|
471
|
+
{ filePath: ".codeium\\windsurf\\mcp_config.json", type: "local" }
|
|
472
|
+
];
|
|
473
|
+
osSpecificPaths["roo"] = [
|
|
474
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
475
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
476
|
+
];
|
|
448
477
|
} else {
|
|
449
478
|
osSpecificPaths["claude"] = [
|
|
450
479
|
{ filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
|
|
@@ -453,6 +482,22 @@ if ((0, import_node_os2.platform)() === "win32") {
|
|
|
453
482
|
{ filePath: "~/.cursor/mcp.json", type: "global" },
|
|
454
483
|
{ filePath: ".cursor/mcp.json", type: "local" }
|
|
455
484
|
];
|
|
485
|
+
osSpecificPaths["vscode"] = [
|
|
486
|
+
{ filePath: ".vscode/mcp.json", type: "local" },
|
|
487
|
+
{ filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
|
|
488
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
|
|
489
|
+
];
|
|
490
|
+
osSpecificPaths["cline"] = [
|
|
491
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
|
|
492
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
|
|
493
|
+
];
|
|
494
|
+
osSpecificPaths["windsurf"] = [
|
|
495
|
+
{ filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
|
|
496
|
+
];
|
|
497
|
+
osSpecificPaths["roo"] = [
|
|
498
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
|
|
499
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
|
|
500
|
+
];
|
|
456
501
|
}
|
|
457
502
|
var MCPFiles = class {
|
|
458
503
|
static {
|
|
@@ -468,6 +513,26 @@ var MCPFiles = class {
|
|
|
468
513
|
name: "cursor",
|
|
469
514
|
friendlyName: "Cursor",
|
|
470
515
|
paths: osSpecificPaths["cursor"]
|
|
516
|
+
},
|
|
517
|
+
vscode: {
|
|
518
|
+
name: "vscode",
|
|
519
|
+
friendlyName: "VS Code",
|
|
520
|
+
paths: osSpecificPaths["vscode"]
|
|
521
|
+
},
|
|
522
|
+
cline: {
|
|
523
|
+
name: "cline",
|
|
524
|
+
friendlyName: "Cline",
|
|
525
|
+
paths: osSpecificPaths["cline"]
|
|
526
|
+
},
|
|
527
|
+
windsurf: {
|
|
528
|
+
name: "windsurf",
|
|
529
|
+
friendlyName: "Windsurf",
|
|
530
|
+
paths: osSpecificPaths["windsurf"]
|
|
531
|
+
},
|
|
532
|
+
roo: {
|
|
533
|
+
name: "roo",
|
|
534
|
+
friendlyName: "Roo",
|
|
535
|
+
paths: osSpecificPaths["roo"]
|
|
471
536
|
}
|
|
472
537
|
};
|
|
473
538
|
constructor(mcpFilePathGroups) {
|
|
@@ -483,8 +548,14 @@ var MCPFiles = class {
|
|
|
483
548
|
paths: [],
|
|
484
549
|
stats: {}
|
|
485
550
|
};
|
|
551
|
+
const uniqueFilePaths = /* @__PURE__ */ new Set();
|
|
486
552
|
for (const filePathData of clientsGroup.paths) {
|
|
487
553
|
const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
|
|
554
|
+
const absolutePath = import_node_path2.default.resolve(resolvedPath);
|
|
555
|
+
if (uniqueFilePaths.has(absolutePath)) {
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
uniqueFilePaths.add(absolutePath);
|
|
488
559
|
try {
|
|
489
560
|
await import_promises2.default.access(resolvedPath);
|
|
490
561
|
const MCPConfigLinter = new MCPConfigLinterService(resolvedPath);
|
package/dist/bin/cli.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { styleText as styleText8 } from "util";
|
|
|
8
8
|
// src/main.ts
|
|
9
9
|
import fs2 from "fs/promises";
|
|
10
10
|
import { platform as platform2 } from "os";
|
|
11
|
+
import path2 from "path";
|
|
11
12
|
|
|
12
13
|
// src/services/mcp-config-linter-service.ts
|
|
13
14
|
import fs from "fs/promises";
|
|
@@ -36,8 +37,16 @@ var MCPConfigLinterService = class {
|
|
|
36
37
|
async getMCPServers() {
|
|
37
38
|
const fileContentRaw = await this.getFileContent();
|
|
38
39
|
const fileContentsData = JSON.parse(fileContentRaw);
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (fileContentsData?.servers) {
|
|
41
|
+
return fileContentsData.servers;
|
|
42
|
+
}
|
|
43
|
+
if (fileContentsData?.mcp?.servers) {
|
|
44
|
+
return fileContentsData.mcp.servers;
|
|
45
|
+
}
|
|
46
|
+
if (fileContentsData?.mcpServers) {
|
|
47
|
+
return fileContentsData.mcpServers;
|
|
48
|
+
}
|
|
49
|
+
return {};
|
|
41
50
|
}
|
|
42
51
|
async getFileContent() {
|
|
43
52
|
if (this.fileContents) {
|
|
@@ -413,7 +422,11 @@ var MCPServerManagerService = class {
|
|
|
413
422
|
// src/main.ts
|
|
414
423
|
var osSpecificPaths = {
|
|
415
424
|
claude: [],
|
|
416
|
-
cursor: []
|
|
425
|
+
cursor: [],
|
|
426
|
+
vscode: [],
|
|
427
|
+
cline: [],
|
|
428
|
+
windsurf: [],
|
|
429
|
+
roo: []
|
|
417
430
|
};
|
|
418
431
|
if (platform2() === "win32") {
|
|
419
432
|
osSpecificPaths["claude"] = [
|
|
@@ -423,6 +436,22 @@ if (platform2() === "win32") {
|
|
|
423
436
|
{ filePath: `${process.env.HOME}\\.cursor\\mcp.json`, type: "global" },
|
|
424
437
|
{ filePath: ".cursor\\mcp.json", type: "local" }
|
|
425
438
|
];
|
|
439
|
+
osSpecificPaths["vscode"] = [
|
|
440
|
+
{ filePath: ".vscode\\mcp.json", type: "local" },
|
|
441
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\settings.json`, type: "global" },
|
|
442
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\settings.json`, type: "global" }
|
|
443
|
+
];
|
|
444
|
+
osSpecificPaths["cline"] = [
|
|
445
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
446
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
447
|
+
];
|
|
448
|
+
osSpecificPaths["windsurf"] = [
|
|
449
|
+
{ filePath: ".codeium\\windsurf\\mcp_config.json", type: "local" }
|
|
450
|
+
];
|
|
451
|
+
osSpecificPaths["roo"] = [
|
|
452
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
453
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
454
|
+
];
|
|
426
455
|
} else {
|
|
427
456
|
osSpecificPaths["claude"] = [
|
|
428
457
|
{ filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
|
|
@@ -431,6 +460,22 @@ if (platform2() === "win32") {
|
|
|
431
460
|
{ filePath: "~/.cursor/mcp.json", type: "global" },
|
|
432
461
|
{ filePath: ".cursor/mcp.json", type: "local" }
|
|
433
462
|
];
|
|
463
|
+
osSpecificPaths["vscode"] = [
|
|
464
|
+
{ filePath: ".vscode/mcp.json", type: "local" },
|
|
465
|
+
{ filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
|
|
466
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
|
|
467
|
+
];
|
|
468
|
+
osSpecificPaths["cline"] = [
|
|
469
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
|
|
470
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
|
|
471
|
+
];
|
|
472
|
+
osSpecificPaths["windsurf"] = [
|
|
473
|
+
{ filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
|
|
474
|
+
];
|
|
475
|
+
osSpecificPaths["roo"] = [
|
|
476
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
|
|
477
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
|
|
478
|
+
];
|
|
434
479
|
}
|
|
435
480
|
var MCPFiles = class {
|
|
436
481
|
static {
|
|
@@ -446,6 +491,26 @@ var MCPFiles = class {
|
|
|
446
491
|
name: "cursor",
|
|
447
492
|
friendlyName: "Cursor",
|
|
448
493
|
paths: osSpecificPaths["cursor"]
|
|
494
|
+
},
|
|
495
|
+
vscode: {
|
|
496
|
+
name: "vscode",
|
|
497
|
+
friendlyName: "VS Code",
|
|
498
|
+
paths: osSpecificPaths["vscode"]
|
|
499
|
+
},
|
|
500
|
+
cline: {
|
|
501
|
+
name: "cline",
|
|
502
|
+
friendlyName: "Cline",
|
|
503
|
+
paths: osSpecificPaths["cline"]
|
|
504
|
+
},
|
|
505
|
+
windsurf: {
|
|
506
|
+
name: "windsurf",
|
|
507
|
+
friendlyName: "Windsurf",
|
|
508
|
+
paths: osSpecificPaths["windsurf"]
|
|
509
|
+
},
|
|
510
|
+
roo: {
|
|
511
|
+
name: "roo",
|
|
512
|
+
friendlyName: "Roo",
|
|
513
|
+
paths: osSpecificPaths["roo"]
|
|
449
514
|
}
|
|
450
515
|
};
|
|
451
516
|
constructor(mcpFilePathGroups) {
|
|
@@ -461,8 +526,14 @@ var MCPFiles = class {
|
|
|
461
526
|
paths: [],
|
|
462
527
|
stats: {}
|
|
463
528
|
};
|
|
529
|
+
const uniqueFilePaths = /* @__PURE__ */ new Set();
|
|
464
530
|
for (const filePathData of clientsGroup.paths) {
|
|
465
531
|
const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
|
|
532
|
+
const absolutePath = path2.resolve(resolvedPath);
|
|
533
|
+
if (uniqueFilePaths.has(absolutePath)) {
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
uniqueFilePaths.add(absolutePath);
|
|
466
537
|
try {
|
|
467
538
|
await fs2.access(resolvedPath);
|
|
468
539
|
const MCPConfigLinter = new MCPConfigLinterService(resolvedPath);
|
package/dist/main.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(main_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(main_exports);
|
|
37
37
|
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
38
38
|
var import_node_os2 = require("os");
|
|
39
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
39
40
|
|
|
40
41
|
// src/services/mcp-config-linter-service.ts
|
|
41
42
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -64,8 +65,16 @@ var MCPConfigLinterService = class {
|
|
|
64
65
|
async getMCPServers() {
|
|
65
66
|
const fileContentRaw = await this.getFileContent();
|
|
66
67
|
const fileContentsData = JSON.parse(fileContentRaw);
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
if (fileContentsData?.servers) {
|
|
69
|
+
return fileContentsData.servers;
|
|
70
|
+
}
|
|
71
|
+
if (fileContentsData?.mcp?.servers) {
|
|
72
|
+
return fileContentsData.mcp.servers;
|
|
73
|
+
}
|
|
74
|
+
if (fileContentsData?.mcpServers) {
|
|
75
|
+
return fileContentsData.mcpServers;
|
|
76
|
+
}
|
|
77
|
+
return {};
|
|
69
78
|
}
|
|
70
79
|
async getFileContent() {
|
|
71
80
|
if (this.fileContents) {
|
|
@@ -441,7 +450,11 @@ var MCPServerManagerService = class {
|
|
|
441
450
|
// src/main.ts
|
|
442
451
|
var osSpecificPaths = {
|
|
443
452
|
claude: [],
|
|
444
|
-
cursor: []
|
|
453
|
+
cursor: [],
|
|
454
|
+
vscode: [],
|
|
455
|
+
cline: [],
|
|
456
|
+
windsurf: [],
|
|
457
|
+
roo: []
|
|
445
458
|
};
|
|
446
459
|
if ((0, import_node_os2.platform)() === "win32") {
|
|
447
460
|
osSpecificPaths["claude"] = [
|
|
@@ -451,6 +464,22 @@ if ((0, import_node_os2.platform)() === "win32") {
|
|
|
451
464
|
{ filePath: `${process.env.HOME}\\.cursor\\mcp.json`, type: "global" },
|
|
452
465
|
{ filePath: ".cursor\\mcp.json", type: "local" }
|
|
453
466
|
];
|
|
467
|
+
osSpecificPaths["vscode"] = [
|
|
468
|
+
{ filePath: ".vscode\\mcp.json", type: "local" },
|
|
469
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\settings.json`, type: "global" },
|
|
470
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\settings.json`, type: "global" }
|
|
471
|
+
];
|
|
472
|
+
osSpecificPaths["cline"] = [
|
|
473
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
474
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
475
|
+
];
|
|
476
|
+
osSpecificPaths["windsurf"] = [
|
|
477
|
+
{ filePath: ".codeium\\windsurf\\mcp_config.json", type: "local" }
|
|
478
|
+
];
|
|
479
|
+
osSpecificPaths["roo"] = [
|
|
480
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
481
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
482
|
+
];
|
|
454
483
|
} else {
|
|
455
484
|
osSpecificPaths["claude"] = [
|
|
456
485
|
{ filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
|
|
@@ -459,6 +488,22 @@ if ((0, import_node_os2.platform)() === "win32") {
|
|
|
459
488
|
{ filePath: "~/.cursor/mcp.json", type: "global" },
|
|
460
489
|
{ filePath: ".cursor/mcp.json", type: "local" }
|
|
461
490
|
];
|
|
491
|
+
osSpecificPaths["vscode"] = [
|
|
492
|
+
{ filePath: ".vscode/mcp.json", type: "local" },
|
|
493
|
+
{ filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
|
|
494
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
|
|
495
|
+
];
|
|
496
|
+
osSpecificPaths["cline"] = [
|
|
497
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
|
|
498
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
|
|
499
|
+
];
|
|
500
|
+
osSpecificPaths["windsurf"] = [
|
|
501
|
+
{ filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
|
|
502
|
+
];
|
|
503
|
+
osSpecificPaths["roo"] = [
|
|
504
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
|
|
505
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
|
|
506
|
+
];
|
|
462
507
|
}
|
|
463
508
|
var MCPFiles = class {
|
|
464
509
|
static {
|
|
@@ -474,6 +519,26 @@ var MCPFiles = class {
|
|
|
474
519
|
name: "cursor",
|
|
475
520
|
friendlyName: "Cursor",
|
|
476
521
|
paths: osSpecificPaths["cursor"]
|
|
522
|
+
},
|
|
523
|
+
vscode: {
|
|
524
|
+
name: "vscode",
|
|
525
|
+
friendlyName: "VS Code",
|
|
526
|
+
paths: osSpecificPaths["vscode"]
|
|
527
|
+
},
|
|
528
|
+
cline: {
|
|
529
|
+
name: "cline",
|
|
530
|
+
friendlyName: "Cline",
|
|
531
|
+
paths: osSpecificPaths["cline"]
|
|
532
|
+
},
|
|
533
|
+
windsurf: {
|
|
534
|
+
name: "windsurf",
|
|
535
|
+
friendlyName: "Windsurf",
|
|
536
|
+
paths: osSpecificPaths["windsurf"]
|
|
537
|
+
},
|
|
538
|
+
roo: {
|
|
539
|
+
name: "roo",
|
|
540
|
+
friendlyName: "Roo",
|
|
541
|
+
paths: osSpecificPaths["roo"]
|
|
477
542
|
}
|
|
478
543
|
};
|
|
479
544
|
constructor(mcpFilePathGroups) {
|
|
@@ -489,8 +554,14 @@ var MCPFiles = class {
|
|
|
489
554
|
paths: [],
|
|
490
555
|
stats: {}
|
|
491
556
|
};
|
|
557
|
+
const uniqueFilePaths = /* @__PURE__ */ new Set();
|
|
492
558
|
for (const filePathData of clientsGroup.paths) {
|
|
493
559
|
const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
|
|
560
|
+
const absolutePath = import_node_path2.default.resolve(resolvedPath);
|
|
561
|
+
if (uniqueFilePaths.has(absolutePath)) {
|
|
562
|
+
continue;
|
|
563
|
+
}
|
|
564
|
+
uniqueFilePaths.add(absolutePath);
|
|
494
565
|
try {
|
|
495
566
|
await import_promises2.default.access(resolvedPath);
|
|
496
567
|
const MCPConfigLinter = new MCPConfigLinterService(resolvedPath);
|
package/dist/main.mjs
CHANGED
|
@@ -4,6 +4,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
// src/main.ts
|
|
5
5
|
import fs2 from "fs/promises";
|
|
6
6
|
import { platform as platform2 } from "os";
|
|
7
|
+
import path2 from "path";
|
|
7
8
|
|
|
8
9
|
// src/services/mcp-config-linter-service.ts
|
|
9
10
|
import fs from "fs/promises";
|
|
@@ -32,8 +33,16 @@ var MCPConfigLinterService = class {
|
|
|
32
33
|
async getMCPServers() {
|
|
33
34
|
const fileContentRaw = await this.getFileContent();
|
|
34
35
|
const fileContentsData = JSON.parse(fileContentRaw);
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
if (fileContentsData?.servers) {
|
|
37
|
+
return fileContentsData.servers;
|
|
38
|
+
}
|
|
39
|
+
if (fileContentsData?.mcp?.servers) {
|
|
40
|
+
return fileContentsData.mcp.servers;
|
|
41
|
+
}
|
|
42
|
+
if (fileContentsData?.mcpServers) {
|
|
43
|
+
return fileContentsData.mcpServers;
|
|
44
|
+
}
|
|
45
|
+
return {};
|
|
37
46
|
}
|
|
38
47
|
async getFileContent() {
|
|
39
48
|
if (this.fileContents) {
|
|
@@ -409,7 +418,11 @@ var MCPServerManagerService = class {
|
|
|
409
418
|
// src/main.ts
|
|
410
419
|
var osSpecificPaths = {
|
|
411
420
|
claude: [],
|
|
412
|
-
cursor: []
|
|
421
|
+
cursor: [],
|
|
422
|
+
vscode: [],
|
|
423
|
+
cline: [],
|
|
424
|
+
windsurf: [],
|
|
425
|
+
roo: []
|
|
413
426
|
};
|
|
414
427
|
if (platform2() === "win32") {
|
|
415
428
|
osSpecificPaths["claude"] = [
|
|
@@ -419,6 +432,22 @@ if (platform2() === "win32") {
|
|
|
419
432
|
{ filePath: `${process.env.HOME}\\.cursor\\mcp.json`, type: "global" },
|
|
420
433
|
{ filePath: ".cursor\\mcp.json", type: "local" }
|
|
421
434
|
];
|
|
435
|
+
osSpecificPaths["vscode"] = [
|
|
436
|
+
{ filePath: ".vscode\\mcp.json", type: "local" },
|
|
437
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\settings.json`, type: "global" },
|
|
438
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\settings.json`, type: "global" }
|
|
439
|
+
];
|
|
440
|
+
osSpecificPaths["cline"] = [
|
|
441
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
442
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
443
|
+
];
|
|
444
|
+
osSpecificPaths["windsurf"] = [
|
|
445
|
+
{ filePath: ".codeium\\windsurf\\mcp_config.json", type: "local" }
|
|
446
|
+
];
|
|
447
|
+
osSpecificPaths["roo"] = [
|
|
448
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" },
|
|
449
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: "global" }
|
|
450
|
+
];
|
|
422
451
|
} else {
|
|
423
452
|
osSpecificPaths["claude"] = [
|
|
424
453
|
{ filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
|
|
@@ -427,6 +456,22 @@ if (platform2() === "win32") {
|
|
|
427
456
|
{ filePath: "~/.cursor/mcp.json", type: "global" },
|
|
428
457
|
{ filePath: ".cursor/mcp.json", type: "local" }
|
|
429
458
|
];
|
|
459
|
+
osSpecificPaths["vscode"] = [
|
|
460
|
+
{ filePath: ".vscode/mcp.json", type: "local" },
|
|
461
|
+
{ filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
|
|
462
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
|
|
463
|
+
];
|
|
464
|
+
osSpecificPaths["cline"] = [
|
|
465
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
|
|
466
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
|
|
467
|
+
];
|
|
468
|
+
osSpecificPaths["windsurf"] = [
|
|
469
|
+
{ filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
|
|
470
|
+
];
|
|
471
|
+
osSpecificPaths["roo"] = [
|
|
472
|
+
{ filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
|
|
473
|
+
{ filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
|
|
474
|
+
];
|
|
430
475
|
}
|
|
431
476
|
var MCPFiles = class {
|
|
432
477
|
static {
|
|
@@ -442,6 +487,26 @@ var MCPFiles = class {
|
|
|
442
487
|
name: "cursor",
|
|
443
488
|
friendlyName: "Cursor",
|
|
444
489
|
paths: osSpecificPaths["cursor"]
|
|
490
|
+
},
|
|
491
|
+
vscode: {
|
|
492
|
+
name: "vscode",
|
|
493
|
+
friendlyName: "VS Code",
|
|
494
|
+
paths: osSpecificPaths["vscode"]
|
|
495
|
+
},
|
|
496
|
+
cline: {
|
|
497
|
+
name: "cline",
|
|
498
|
+
friendlyName: "Cline",
|
|
499
|
+
paths: osSpecificPaths["cline"]
|
|
500
|
+
},
|
|
501
|
+
windsurf: {
|
|
502
|
+
name: "windsurf",
|
|
503
|
+
friendlyName: "Windsurf",
|
|
504
|
+
paths: osSpecificPaths["windsurf"]
|
|
505
|
+
},
|
|
506
|
+
roo: {
|
|
507
|
+
name: "roo",
|
|
508
|
+
friendlyName: "Roo",
|
|
509
|
+
paths: osSpecificPaths["roo"]
|
|
445
510
|
}
|
|
446
511
|
};
|
|
447
512
|
constructor(mcpFilePathGroups) {
|
|
@@ -457,8 +522,14 @@ var MCPFiles = class {
|
|
|
457
522
|
paths: [],
|
|
458
523
|
stats: {}
|
|
459
524
|
};
|
|
525
|
+
const uniqueFilePaths = /* @__PURE__ */ new Set();
|
|
460
526
|
for (const filePathData of clientsGroup.paths) {
|
|
461
527
|
const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
|
|
528
|
+
const absolutePath = path2.resolve(resolvedPath);
|
|
529
|
+
if (uniqueFilePaths.has(absolutePath)) {
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
uniqueFilePaths.add(absolutePath);
|
|
462
533
|
try {
|
|
463
534
|
await fs2.access(resolvedPath);
|
|
464
535
|
const MCPConfigLinter = new MCPConfigLinterService(resolvedPath);
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises'
|
|
2
2
|
import { platform } from 'node:os'
|
|
3
|
+
import path from 'node:path'
|
|
3
4
|
import { MCPConfigLinterService } from './services/mcp-config-linter-service.ts'
|
|
4
5
|
import { MCPServerManagerService } from './services/mcp-server-manager-service.ts'
|
|
5
6
|
|
|
@@ -42,7 +43,11 @@ type MCPFileGroupsResultRecord = Record<string, MCPFileGroupsResult>
|
|
|
42
43
|
|
|
43
44
|
const osSpecificPaths: { [key: string]: MCPFilePath[] } = {
|
|
44
45
|
claude: [],
|
|
45
|
-
cursor: []
|
|
46
|
+
cursor: [],
|
|
47
|
+
vscode: [],
|
|
48
|
+
cline: [],
|
|
49
|
+
windsurf: [],
|
|
50
|
+
roo: []
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
if (platform() === 'win32') {
|
|
@@ -53,6 +58,21 @@ if (platform() === 'win32') {
|
|
|
53
58
|
{ filePath: `${process.env.HOME}\\.cursor\\mcp.json`, type: 'global' },
|
|
54
59
|
{ filePath: '.cursor\\mcp.json', type: 'local' }
|
|
55
60
|
]
|
|
61
|
+
osSpecificPaths['vscode'] = [
|
|
62
|
+
{ filePath: '.vscode\\mcp.json', type: 'local' },
|
|
63
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\settings.json`, type: 'global' },
|
|
64
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\settings.json`, type: 'global' },
|
|
65
|
+
]
|
|
66
|
+
osSpecificPaths['cline'] = [
|
|
67
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: 'global' },
|
|
68
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: 'global' }
|
|
69
|
+
]
|
|
70
|
+
osSpecificPaths['windsurf'] = [
|
|
71
|
+
{ filePath: '.codeium\\windsurf\\mcp_config.json', type: 'local' },
|
|
72
|
+
]
|
|
73
|
+
osSpecificPaths['roo'] = [
|
|
74
|
+
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: 'global' },
|
|
75
|
+
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: 'global' },]
|
|
56
76
|
} else {
|
|
57
77
|
osSpecificPaths['claude'] = [
|
|
58
78
|
{ filePath: '~/Library/Application Support/Claude/claude_desktop_config.json', type: 'global' }
|
|
@@ -61,6 +81,22 @@ if (platform() === 'win32') {
|
|
|
61
81
|
{ filePath: '~/.cursor/mcp.json', type: 'global' },
|
|
62
82
|
{ filePath: '.cursor/mcp.json', type: 'local' }
|
|
63
83
|
]
|
|
84
|
+
osSpecificPaths['vscode'] = [
|
|
85
|
+
{ filePath: '.vscode/mcp.json', type: 'local' },
|
|
86
|
+
{ filePath: '~/Library/Application Support/Code/User/settings.json', type: 'global' },
|
|
87
|
+
{ filePath: '~/Library/Application Support/Code - Insiders/User/settings.json', type: 'global' },
|
|
88
|
+
]
|
|
89
|
+
osSpecificPaths['cline'] = [
|
|
90
|
+
{ filePath: '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', type: 'global' },
|
|
91
|
+
{ filePath: '~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', type: 'global' }
|
|
92
|
+
]
|
|
93
|
+
osSpecificPaths['windsurf'] = [
|
|
94
|
+
{ filePath: '.codeium/windsurf/mcp_config.json', type: 'local' },
|
|
95
|
+
]
|
|
96
|
+
osSpecificPaths['roo'] = [
|
|
97
|
+
{ filePath: '~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json', type: 'global' },
|
|
98
|
+
{ filePath: '~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json', type: 'global' },
|
|
99
|
+
]
|
|
64
100
|
}
|
|
65
101
|
|
|
66
102
|
export class MCPFiles {
|
|
@@ -74,6 +110,26 @@ export class MCPFiles {
|
|
|
74
110
|
name: 'cursor',
|
|
75
111
|
friendlyName: 'Cursor',
|
|
76
112
|
paths: osSpecificPaths['cursor']
|
|
113
|
+
},
|
|
114
|
+
vscode: {
|
|
115
|
+
name: 'vscode',
|
|
116
|
+
friendlyName: 'VS Code',
|
|
117
|
+
paths: osSpecificPaths['vscode']
|
|
118
|
+
},
|
|
119
|
+
cline: {
|
|
120
|
+
name: 'cline',
|
|
121
|
+
friendlyName: 'Cline',
|
|
122
|
+
paths: osSpecificPaths['cline']
|
|
123
|
+
},
|
|
124
|
+
windsurf: {
|
|
125
|
+
name: 'windsurf',
|
|
126
|
+
friendlyName: 'Windsurf',
|
|
127
|
+
paths: osSpecificPaths['windsurf']
|
|
128
|
+
},
|
|
129
|
+
roo: {
|
|
130
|
+
name: 'roo',
|
|
131
|
+
friendlyName: 'Roo',
|
|
132
|
+
paths: osSpecificPaths['roo']
|
|
77
133
|
}
|
|
78
134
|
}
|
|
79
135
|
|
|
@@ -93,8 +149,16 @@ export class MCPFiles {
|
|
|
93
149
|
stats: {}
|
|
94
150
|
}
|
|
95
151
|
|
|
152
|
+
const uniqueFilePaths = new Set<string>()
|
|
153
|
+
|
|
96
154
|
for (const filePathData of clientsGroup.paths) {
|
|
97
155
|
const resolvedPath: string = filePathData.filePath.replace('~', process.env.HOME || '')
|
|
156
|
+
const absolutePath: string = path.resolve(resolvedPath)
|
|
157
|
+
if (uniqueFilePaths.has(absolutePath)) {
|
|
158
|
+
continue
|
|
159
|
+
}
|
|
160
|
+
uniqueFilePaths.add(absolutePath)
|
|
161
|
+
|
|
98
162
|
try {
|
|
99
163
|
await fs.access(resolvedPath)
|
|
100
164
|
|
|
@@ -102,6 +166,7 @@ export class MCPFiles {
|
|
|
102
166
|
const parsable = await MCPConfigLinter.isValidSyntax()
|
|
103
167
|
filePathData.parsable = parsable
|
|
104
168
|
|
|
169
|
+
// @TODO if file isn't parsable we should skip the following logic here
|
|
105
170
|
const mcpServersData: MCPServerInfo[] = []
|
|
106
171
|
const mcpServersFromConfig = await MCPConfigLinter.getMCPServers()
|
|
107
172
|
// let's iterate over the mcpServer Record and access the server objects
|
|
@@ -26,11 +26,27 @@ export class MCPConfigLinterService {
|
|
|
26
26
|
|
|
27
27
|
async getMCPServers (): Promise<Record<string, object>> {
|
|
28
28
|
const fileContentRaw = await this.getFileContent()
|
|
29
|
+
|
|
30
|
+
// @TODO parse this file that may have comments inside it
|
|
31
|
+
// can use comment-json npm package or similar
|
|
29
32
|
const fileContentsData = JSON.parse(fileContentRaw)
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
// VS Code uses `servers`
|
|
35
|
+
if (fileContentsData?.servers) {
|
|
36
|
+
return fileContentsData.servers
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// VS Code global settings.json file uses `mcp` -> `servers`
|
|
40
|
+
if (fileContentsData?.mcp?.servers) {
|
|
41
|
+
return fileContentsData.mcp.servers
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Claude and Cursor use the `mcpServers` key
|
|
45
|
+
if (fileContentsData?.mcpServers) {
|
|
46
|
+
return fileContentsData.mcpServers
|
|
47
|
+
}
|
|
32
48
|
|
|
33
|
-
return
|
|
49
|
+
return {}
|
|
34
50
|
}
|
|
35
51
|
|
|
36
52
|
async getFileContent (): Promise<string> {
|