ls-mcp 1.4.0 → 1.5.1

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 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
- const mcpServers = fileContentsData?.mcpServers;
62
- return mcpServers;
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,25 @@ 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
+ ];
477
+ osSpecificPaths["intellij-github-copilot"] = [
478
+ { filePath: `${process.env.LOCALAPPDATA}\\github-copilot\\intellij\\mcp.json`, type: "global" }
479
+ ];
448
480
  } else {
449
481
  osSpecificPaths["claude"] = [
450
482
  { filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
@@ -453,6 +485,25 @@ if ((0, import_node_os2.platform)() === "win32") {
453
485
  { filePath: "~/.cursor/mcp.json", type: "global" },
454
486
  { filePath: ".cursor/mcp.json", type: "local" }
455
487
  ];
488
+ osSpecificPaths["vscode"] = [
489
+ { filePath: ".vscode/mcp.json", type: "local" },
490
+ { filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
491
+ { filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
492
+ ];
493
+ osSpecificPaths["cline"] = [
494
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
495
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
496
+ ];
497
+ osSpecificPaths["windsurf"] = [
498
+ { filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
499
+ ];
500
+ osSpecificPaths["roo"] = [
501
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
502
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
503
+ ];
504
+ osSpecificPaths["intellij-github-copilot"] = [
505
+ { filePath: "~/.config/github-copilot/intellij/mcp.json", type: "global" }
506
+ ];
456
507
  }
457
508
  var MCPFiles = class {
458
509
  static {
@@ -468,6 +519,31 @@ var MCPFiles = class {
468
519
  name: "cursor",
469
520
  friendlyName: "Cursor",
470
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"]
542
+ },
543
+ "intellij-github-copilot": {
544
+ name: "intellij-github-copilot",
545
+ friendlyName: "IntelliJ GitHub Copilot",
546
+ paths: osSpecificPaths["intellij-github-copilot"]
471
547
  }
472
548
  };
473
549
  constructor(mcpFilePathGroups) {
@@ -483,8 +559,14 @@ var MCPFiles = class {
483
559
  paths: [],
484
560
  stats: {}
485
561
  };
562
+ const uniqueFilePaths = /* @__PURE__ */ new Set();
486
563
  for (const filePathData of clientsGroup.paths) {
487
564
  const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
565
+ const absolutePath = import_node_path2.default.resolve(resolvedPath);
566
+ if (uniqueFilePaths.has(absolutePath)) {
567
+ continue;
568
+ }
569
+ uniqueFilePaths.add(absolutePath);
488
570
  try {
489
571
  await import_promises2.default.access(resolvedPath);
490
572
  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
- const mcpServers = fileContentsData?.mcpServers;
40
- return mcpServers;
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,25 @@ 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
+ ];
455
+ osSpecificPaths["intellij-github-copilot"] = [
456
+ { filePath: `${process.env.LOCALAPPDATA}\\github-copilot\\intellij\\mcp.json`, type: "global" }
457
+ ];
426
458
  } else {
427
459
  osSpecificPaths["claude"] = [
428
460
  { filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
@@ -431,6 +463,25 @@ if (platform2() === "win32") {
431
463
  { filePath: "~/.cursor/mcp.json", type: "global" },
432
464
  { filePath: ".cursor/mcp.json", type: "local" }
433
465
  ];
466
+ osSpecificPaths["vscode"] = [
467
+ { filePath: ".vscode/mcp.json", type: "local" },
468
+ { filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
469
+ { filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
470
+ ];
471
+ osSpecificPaths["cline"] = [
472
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
473
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
474
+ ];
475
+ osSpecificPaths["windsurf"] = [
476
+ { filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
477
+ ];
478
+ osSpecificPaths["roo"] = [
479
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
480
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
481
+ ];
482
+ osSpecificPaths["intellij-github-copilot"] = [
483
+ { filePath: "~/.config/github-copilot/intellij/mcp.json", type: "global" }
484
+ ];
434
485
  }
435
486
  var MCPFiles = class {
436
487
  static {
@@ -446,6 +497,31 @@ var MCPFiles = class {
446
497
  name: "cursor",
447
498
  friendlyName: "Cursor",
448
499
  paths: osSpecificPaths["cursor"]
500
+ },
501
+ vscode: {
502
+ name: "vscode",
503
+ friendlyName: "VS Code",
504
+ paths: osSpecificPaths["vscode"]
505
+ },
506
+ cline: {
507
+ name: "cline",
508
+ friendlyName: "Cline",
509
+ paths: osSpecificPaths["cline"]
510
+ },
511
+ windsurf: {
512
+ name: "windsurf",
513
+ friendlyName: "Windsurf",
514
+ paths: osSpecificPaths["windsurf"]
515
+ },
516
+ roo: {
517
+ name: "roo",
518
+ friendlyName: "Roo",
519
+ paths: osSpecificPaths["roo"]
520
+ },
521
+ "intellij-github-copilot": {
522
+ name: "intellij-github-copilot",
523
+ friendlyName: "IntelliJ GitHub Copilot",
524
+ paths: osSpecificPaths["intellij-github-copilot"]
449
525
  }
450
526
  };
451
527
  constructor(mcpFilePathGroups) {
@@ -461,8 +537,14 @@ var MCPFiles = class {
461
537
  paths: [],
462
538
  stats: {}
463
539
  };
540
+ const uniqueFilePaths = /* @__PURE__ */ new Set();
464
541
  for (const filePathData of clientsGroup.paths) {
465
542
  const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
543
+ const absolutePath = path2.resolve(resolvedPath);
544
+ if (uniqueFilePaths.has(absolutePath)) {
545
+ continue;
546
+ }
547
+ uniqueFilePaths.add(absolutePath);
466
548
  try {
467
549
  await fs2.access(resolvedPath);
468
550
  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
- const mcpServers = fileContentsData?.mcpServers;
68
- return mcpServers;
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,25 @@ 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
+ ];
483
+ osSpecificPaths["intellij-github-copilot"] = [
484
+ { filePath: `${process.env.LOCALAPPDATA}\\github-copilot\\intellij\\mcp.json`, type: "global" }
485
+ ];
454
486
  } else {
455
487
  osSpecificPaths["claude"] = [
456
488
  { filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
@@ -459,6 +491,25 @@ if ((0, import_node_os2.platform)() === "win32") {
459
491
  { filePath: "~/.cursor/mcp.json", type: "global" },
460
492
  { filePath: ".cursor/mcp.json", type: "local" }
461
493
  ];
494
+ osSpecificPaths["vscode"] = [
495
+ { filePath: ".vscode/mcp.json", type: "local" },
496
+ { filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
497
+ { filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
498
+ ];
499
+ osSpecificPaths["cline"] = [
500
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
501
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
502
+ ];
503
+ osSpecificPaths["windsurf"] = [
504
+ { filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
505
+ ];
506
+ osSpecificPaths["roo"] = [
507
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
508
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
509
+ ];
510
+ osSpecificPaths["intellij-github-copilot"] = [
511
+ { filePath: "~/.config/github-copilot/intellij/mcp.json", type: "global" }
512
+ ];
462
513
  }
463
514
  var MCPFiles = class {
464
515
  static {
@@ -474,6 +525,31 @@ var MCPFiles = class {
474
525
  name: "cursor",
475
526
  friendlyName: "Cursor",
476
527
  paths: osSpecificPaths["cursor"]
528
+ },
529
+ vscode: {
530
+ name: "vscode",
531
+ friendlyName: "VS Code",
532
+ paths: osSpecificPaths["vscode"]
533
+ },
534
+ cline: {
535
+ name: "cline",
536
+ friendlyName: "Cline",
537
+ paths: osSpecificPaths["cline"]
538
+ },
539
+ windsurf: {
540
+ name: "windsurf",
541
+ friendlyName: "Windsurf",
542
+ paths: osSpecificPaths["windsurf"]
543
+ },
544
+ roo: {
545
+ name: "roo",
546
+ friendlyName: "Roo",
547
+ paths: osSpecificPaths["roo"]
548
+ },
549
+ "intellij-github-copilot": {
550
+ name: "intellij-github-copilot",
551
+ friendlyName: "IntelliJ GitHub Copilot",
552
+ paths: osSpecificPaths["intellij-github-copilot"]
477
553
  }
478
554
  };
479
555
  constructor(mcpFilePathGroups) {
@@ -489,8 +565,14 @@ var MCPFiles = class {
489
565
  paths: [],
490
566
  stats: {}
491
567
  };
568
+ const uniqueFilePaths = /* @__PURE__ */ new Set();
492
569
  for (const filePathData of clientsGroup.paths) {
493
570
  const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
571
+ const absolutePath = import_node_path2.default.resolve(resolvedPath);
572
+ if (uniqueFilePaths.has(absolutePath)) {
573
+ continue;
574
+ }
575
+ uniqueFilePaths.add(absolutePath);
494
576
  try {
495
577
  await import_promises2.default.access(resolvedPath);
496
578
  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
- const mcpServers = fileContentsData?.mcpServers;
36
- return mcpServers;
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,25 @@ 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
+ ];
451
+ osSpecificPaths["intellij-github-copilot"] = [
452
+ { filePath: `${process.env.LOCALAPPDATA}\\github-copilot\\intellij\\mcp.json`, type: "global" }
453
+ ];
422
454
  } else {
423
455
  osSpecificPaths["claude"] = [
424
456
  { filePath: "~/Library/Application Support/Claude/claude_desktop_config.json", type: "global" }
@@ -427,6 +459,25 @@ if (platform2() === "win32") {
427
459
  { filePath: "~/.cursor/mcp.json", type: "global" },
428
460
  { filePath: ".cursor/mcp.json", type: "local" }
429
461
  ];
462
+ osSpecificPaths["vscode"] = [
463
+ { filePath: ".vscode/mcp.json", type: "local" },
464
+ { filePath: "~/Library/Application Support/Code/User/settings.json", type: "global" },
465
+ { filePath: "~/Library/Application Support/Code - Insiders/User/settings.json", type: "global" }
466
+ ];
467
+ osSpecificPaths["cline"] = [
468
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" },
469
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json", type: "global" }
470
+ ];
471
+ osSpecificPaths["windsurf"] = [
472
+ { filePath: ".codeium/windsurf/mcp_config.json", type: "local" }
473
+ ];
474
+ osSpecificPaths["roo"] = [
475
+ { filePath: "~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" },
476
+ { filePath: "~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json", type: "global" }
477
+ ];
478
+ osSpecificPaths["intellij-github-copilot"] = [
479
+ { filePath: "~/.config/github-copilot/intellij/mcp.json", type: "global" }
480
+ ];
430
481
  }
431
482
  var MCPFiles = class {
432
483
  static {
@@ -442,6 +493,31 @@ var MCPFiles = class {
442
493
  name: "cursor",
443
494
  friendlyName: "Cursor",
444
495
  paths: osSpecificPaths["cursor"]
496
+ },
497
+ vscode: {
498
+ name: "vscode",
499
+ friendlyName: "VS Code",
500
+ paths: osSpecificPaths["vscode"]
501
+ },
502
+ cline: {
503
+ name: "cline",
504
+ friendlyName: "Cline",
505
+ paths: osSpecificPaths["cline"]
506
+ },
507
+ windsurf: {
508
+ name: "windsurf",
509
+ friendlyName: "Windsurf",
510
+ paths: osSpecificPaths["windsurf"]
511
+ },
512
+ roo: {
513
+ name: "roo",
514
+ friendlyName: "Roo",
515
+ paths: osSpecificPaths["roo"]
516
+ },
517
+ "intellij-github-copilot": {
518
+ name: "intellij-github-copilot",
519
+ friendlyName: "IntelliJ GitHub Copilot",
520
+ paths: osSpecificPaths["intellij-github-copilot"]
445
521
  }
446
522
  };
447
523
  constructor(mcpFilePathGroups) {
@@ -457,8 +533,14 @@ var MCPFiles = class {
457
533
  paths: [],
458
534
  stats: {}
459
535
  };
536
+ const uniqueFilePaths = /* @__PURE__ */ new Set();
460
537
  for (const filePathData of clientsGroup.paths) {
461
538
  const resolvedPath = filePathData.filePath.replace("~", process.env.HOME || "");
539
+ const absolutePath = path2.resolve(resolvedPath);
540
+ if (uniqueFilePaths.has(absolutePath)) {
541
+ continue;
542
+ }
543
+ uniqueFilePaths.add(absolutePath);
462
544
  try {
463
545
  await fs2.access(resolvedPath);
464
546
  const MCPConfigLinter = new MCPConfigLinterService(resolvedPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-mcp",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "list and detect MCP servers and configurations",
5
5
  "types": "dist/main.d.ts",
6
6
  "type": "module",
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,25 @@ 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' },
76
+ ]
77
+ osSpecificPaths['intellij-github-copilot'] = [
78
+ { filePath: `${process.env.LOCALAPPDATA}\\github-copilot\\intellij\\mcp.json`, type: 'global' },
79
+ ]
56
80
  } else {
57
81
  osSpecificPaths['claude'] = [
58
82
  { filePath: '~/Library/Application Support/Claude/claude_desktop_config.json', type: 'global' }
@@ -61,6 +85,25 @@ if (platform() === 'win32') {
61
85
  { filePath: '~/.cursor/mcp.json', type: 'global' },
62
86
  { filePath: '.cursor/mcp.json', type: 'local' }
63
87
  ]
88
+ osSpecificPaths['vscode'] = [
89
+ { filePath: '.vscode/mcp.json', type: 'local' },
90
+ { filePath: '~/Library/Application Support/Code/User/settings.json', type: 'global' },
91
+ { filePath: '~/Library/Application Support/Code - Insiders/User/settings.json', type: 'global' },
92
+ ]
93
+ osSpecificPaths['cline'] = [
94
+ { filePath: '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', type: 'global' },
95
+ { filePath: '~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', type: 'global' }
96
+ ]
97
+ osSpecificPaths['windsurf'] = [
98
+ { filePath: '.codeium/windsurf/mcp_config.json', type: 'local' },
99
+ ]
100
+ osSpecificPaths['roo'] = [
101
+ { filePath: '~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json', type: 'global' },
102
+ { filePath: '~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json', type: 'global' },
103
+ ]
104
+ osSpecificPaths['intellij-github-copilot'] = [
105
+ { filePath: '~/.config/github-copilot/intellij/mcp.json', type: 'global' },
106
+ ]
64
107
  }
65
108
 
66
109
  export class MCPFiles {
@@ -74,6 +117,31 @@ export class MCPFiles {
74
117
  name: 'cursor',
75
118
  friendlyName: 'Cursor',
76
119
  paths: osSpecificPaths['cursor']
120
+ },
121
+ vscode: {
122
+ name: 'vscode',
123
+ friendlyName: 'VS Code',
124
+ paths: osSpecificPaths['vscode']
125
+ },
126
+ cline: {
127
+ name: 'cline',
128
+ friendlyName: 'Cline',
129
+ paths: osSpecificPaths['cline']
130
+ },
131
+ windsurf: {
132
+ name: 'windsurf',
133
+ friendlyName: 'Windsurf',
134
+ paths: osSpecificPaths['windsurf']
135
+ },
136
+ roo: {
137
+ name: 'roo',
138
+ friendlyName: 'Roo',
139
+ paths: osSpecificPaths['roo']
140
+ },
141
+ 'intellij-github-copilot': {
142
+ name: 'intellij-github-copilot',
143
+ friendlyName: 'IntelliJ GitHub Copilot',
144
+ paths: osSpecificPaths['intellij-github-copilot']
77
145
  }
78
146
  }
79
147
 
@@ -93,8 +161,16 @@ export class MCPFiles {
93
161
  stats: {}
94
162
  }
95
163
 
164
+ const uniqueFilePaths = new Set<string>()
165
+
96
166
  for (const filePathData of clientsGroup.paths) {
97
167
  const resolvedPath: string = filePathData.filePath.replace('~', process.env.HOME || '')
168
+ const absolutePath: string = path.resolve(resolvedPath)
169
+ if (uniqueFilePaths.has(absolutePath)) {
170
+ continue
171
+ }
172
+ uniqueFilePaths.add(absolutePath)
173
+
98
174
  try {
99
175
  await fs.access(resolvedPath)
100
176
 
@@ -102,6 +178,7 @@ export class MCPFiles {
102
178
  const parsable = await MCPConfigLinter.isValidSyntax()
103
179
  filePathData.parsable = parsable
104
180
 
181
+ // @TODO if file isn't parsable we should skip the following logic here
105
182
  const mcpServersData: MCPServerInfo[] = []
106
183
  const mcpServersFromConfig = await MCPConfigLinter.getMCPServers()
107
184
  // 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
- const mcpServers = fileContentsData?.mcpServers
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 mcpServers
49
+ return {}
34
50
  }
35
51
 
36
52
  async getFileContent (): Promise<string> {