ls-mcp 1.12.0 → 1.13.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.mjs CHANGED
@@ -3,7 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
4
 
5
5
  // src/bin/cli.ts
6
- import { styleText as styleText11 } from "util";
6
+ import { styleText as styleText12 } from "util";
7
7
 
8
8
  // src/services/mcp-config-service.ts
9
9
  import { platform } from "os";
@@ -751,6 +751,157 @@ var DirectoryBubbleService = class {
751
751
  }
752
752
  };
753
753
 
754
+ // src/services/mcp-version-detection-service.ts
755
+ var MCPVersionDetectionService = class {
756
+ static {
757
+ __name(this, "MCPVersionDetectionService");
758
+ }
759
+ /**
760
+ * Analyze a server configuration to extract version information
761
+ * @param command - The command used to run the server
762
+ * @param args - Array of arguments passed to the command
763
+ * @returns PackageVersionInfo if analysis is possible, null otherwise
764
+ */
765
+ analyzeServerVersion(command, args) {
766
+ if (!["npx", "uvx", "uv"].includes(command)) {
767
+ return null;
768
+ }
769
+ if (!args || args.length === 0) {
770
+ return null;
771
+ }
772
+ const packageName = this.extractPackageName(command, args);
773
+ if (!packageName) {
774
+ return null;
775
+ }
776
+ const { name, version } = this.parsePackageVersion(packageName);
777
+ const isPinned = this.isPinnedVersion(version);
778
+ return {
779
+ packageName: name,
780
+ version,
781
+ isPinned,
782
+ isLatest: !isPinned
783
+ };
784
+ }
785
+ /**
786
+ * Extract the package name based on the command type
787
+ * @param command - The command used to run the server
788
+ * @param args - Array of arguments passed to the command
789
+ * @returns The package name/spec or null if not found
790
+ */
791
+ extractPackageName(command, args) {
792
+ switch (command) {
793
+ case "npx":
794
+ return this.extractNpxPackageName(args);
795
+ case "uvx":
796
+ return this.extractUvxPackageName(args);
797
+ case "uv":
798
+ return this.extractUvPackageName(args);
799
+ default:
800
+ return null;
801
+ }
802
+ }
803
+ /**
804
+ * Extract the package name from npx arguments
805
+ * @param args - Array of arguments passed to npx
806
+ * @returns The package name/spec or null if not found
807
+ */
808
+ extractNpxPackageName(args) {
809
+ if (!args || args.length === 0) {
810
+ return null;
811
+ }
812
+ const yIndex = args.indexOf("-y");
813
+ if (yIndex !== -1 && yIndex + 1 < args.length) {
814
+ return args[yIndex + 1];
815
+ }
816
+ const yesIndex = args.indexOf("--yes");
817
+ if (yesIndex !== -1 && yesIndex + 1 < args.length) {
818
+ return args[yesIndex + 1];
819
+ }
820
+ for (let i = 0; i < args.length; i++) {
821
+ const arg = args[i];
822
+ if (!arg.startsWith("-")) {
823
+ if (i > 0) {
824
+ const prevArg = args[i - 1];
825
+ if (prevArg === "--registry" || prevArg === "-r" || prevArg === "--package" || prevArg === "-p") {
826
+ continue;
827
+ }
828
+ }
829
+ return arg;
830
+ }
831
+ }
832
+ return null;
833
+ }
834
+ /**
835
+ * Extract the package name from uvx arguments
836
+ * @param args - Array of arguments passed to uvx
837
+ * @returns The package name/spec or null if not found
838
+ */
839
+ extractUvxPackageName(args) {
840
+ if (!args || args.length === 0) {
841
+ return null;
842
+ }
843
+ return args[0];
844
+ }
845
+ /**
846
+ * Extract the package name from uv arguments
847
+ * @param args - Array of arguments passed to uv
848
+ * @returns The package name/spec or null if not found
849
+ */
850
+ extractUvPackageName(args) {
851
+ if (!args || args.length === 0) {
852
+ return null;
853
+ }
854
+ const runIndex = args.indexOf("run");
855
+ if (runIndex !== -1 && runIndex + 1 < args.length) {
856
+ return args[runIndex + 1];
857
+ }
858
+ return null;
859
+ }
860
+ /**
861
+ * Parse a package specification to extract name and version
862
+ * @param packageSpec - Package specification (e.g., "package@1.0.0" or "package")
863
+ * @returns Object with name and optional version
864
+ */
865
+ parsePackageVersion(packageSpec) {
866
+ if (!packageSpec) {
867
+ return { name: "", version: void 0 };
868
+ }
869
+ if (packageSpec.startsWith("@")) {
870
+ const parts = packageSpec.split("@");
871
+ if (parts.length === 2) {
872
+ return { name: packageSpec, version: void 0 };
873
+ } else if (parts.length === 3) {
874
+ return {
875
+ name: `@${parts[1]}`,
876
+ version: parts[2]
877
+ };
878
+ }
879
+ }
880
+ const atIndex = packageSpec.lastIndexOf("@");
881
+ if (atIndex > 0) {
882
+ return {
883
+ name: packageSpec.substring(0, atIndex),
884
+ version: packageSpec.substring(atIndex + 1)
885
+ };
886
+ }
887
+ return { name: packageSpec, version: void 0 };
888
+ }
889
+ /**
890
+ * Determine if a version represents a pinned version
891
+ * @param version - The version string to check
892
+ * @returns true if the version is pinned, false if it's latest/implicit
893
+ */
894
+ isPinnedVersion(version) {
895
+ if (!version) {
896
+ return false;
897
+ }
898
+ if (version === "latest") {
899
+ return false;
900
+ }
901
+ return true;
902
+ }
903
+ };
904
+
754
905
  // src/utils/url-utils.ts
755
906
  function extractHostname(urlString) {
756
907
  try {
@@ -775,12 +926,14 @@ var MCPConfigService = class {
775
926
  currentOS;
776
927
  debug;
777
928
  directoryBubbleService;
929
+ versionDetectionService;
778
930
  enableDirectoryBubbling;
779
931
  constructor(options = {}) {
780
932
  this.pathRegistry = new MCPPathRegistry();
781
933
  this.currentOS = platform();
782
934
  this.debug = util.debuglog("ls-mcp");
783
935
  this.directoryBubbleService = new DirectoryBubbleService();
936
+ this.versionDetectionService = new MCPVersionDetectionService();
784
937
  this.enableDirectoryBubbling = options.enableDirectoryBubbling ?? false;
785
938
  }
786
939
  /**
@@ -977,6 +1130,10 @@ var MCPConfigService = class {
977
1130
  } else {
978
1131
  source = serverConfig.command || "";
979
1132
  }
1133
+ const versionInfo = this.versionDetectionService.analyzeServerVersion(
1134
+ serverConfig.command || "",
1135
+ Array.isArray(serverConfig.args) ? serverConfig.args : void 0
1136
+ );
980
1137
  serverInfos.push({
981
1138
  name: serverName,
982
1139
  command: serverConfig.command || "",
@@ -989,6 +1146,7 @@ var MCPConfigService = class {
989
1146
  headers: serverConfig.headers,
990
1147
  status: "stopped",
991
1148
  // Default status, will be updated by server manager
1149
+ versionInfo: versionInfo || void 0,
992
1150
  credentials: CredentialDetectionService.analyzeServerConfig({
993
1151
  env: serverConfig.env,
994
1152
  args: serverConfig.args,
@@ -1470,7 +1628,7 @@ var MCPFiles = class {
1470
1628
  };
1471
1629
 
1472
1630
  // src/services/render-service.ts
1473
- import { styleText as styleText10 } from "util";
1631
+ import { styleText as styleText11 } from "util";
1474
1632
 
1475
1633
  // src/components/transport.ts
1476
1634
  import { styleText } from "util";
@@ -1530,31 +1688,47 @@ function render5(text) {
1530
1688
  }
1531
1689
  __name(render5, "render");
1532
1690
 
1533
- // src/components/file-path.ts
1691
+ // src/components/mcp-server-version.ts
1534
1692
  import { styleText as styleText6 } from "util";
1535
- function render6(text) {
1536
- const formattedText = text;
1537
- const data = styleText6(["underline"], formattedText);
1538
- return data;
1693
+ function render6(versionInfo) {
1694
+ if (!versionInfo) {
1695
+ return "";
1696
+ }
1697
+ const version = versionInfo.version || "LATEST";
1698
+ const displayVersion = version === "latest" ? "LATEST" : version;
1699
+ if (versionInfo.isPinned) {
1700
+ return styleText6(["green"], "\u25CF") + " " + displayVersion;
1701
+ } else {
1702
+ return styleText6(["red"], "\u25CF") + " LATEST";
1703
+ }
1539
1704
  }
1540
1705
  __name(render6, "render");
1541
1706
 
1542
- // src/components/mcp-servers-config-parsable.ts
1707
+ // src/components/file-path.ts
1543
1708
  import { styleText as styleText7 } from "util";
1544
1709
  function render7(text) {
1710
+ const formattedText = text;
1711
+ const data = styleText7(["underline"], formattedText);
1712
+ return data;
1713
+ }
1714
+ __name(render7, "render");
1715
+
1716
+ // src/components/mcp-servers-config-parsable.ts
1717
+ import { styleText as styleText8 } from "util";
1718
+ function render8(text) {
1545
1719
  const formattedText = text.toUpperCase().replace(/_/g, " ");
1546
1720
  let data = formattedText;
1547
1721
  if (formattedText === "VALID") {
1548
- data = styleText7(["green"], "\u25CF");
1722
+ data = styleText8(["green"], "\u25CF");
1549
1723
  } else {
1550
- data = styleText7(["red"], "\u25CF");
1724
+ data = styleText8(["red"], "\u25CF");
1551
1725
  }
1552
1726
  return data;
1553
1727
  }
1554
- __name(render7, "render");
1728
+ __name(render8, "render");
1555
1729
 
1556
1730
  // src/components/credential-warning.ts
1557
- import { styleText as styleText8 } from "util";
1731
+ import { styleText as styleText9 } from "util";
1558
1732
  function CredentialWarningComponent(credentials) {
1559
1733
  if (!credentials || !credentials.hasCredentials) {
1560
1734
  return "";
@@ -1565,17 +1739,17 @@ function CredentialWarningComponent(credentials) {
1565
1739
  switch (riskLevel) {
1566
1740
  case "high":
1567
1741
  riskColor = "red";
1568
- riskIcon = styleText8(["red"], "\u25CF");
1742
+ riskIcon = styleText9(["red"], "\u25CF");
1569
1743
  break;
1570
1744
  case "low":
1571
1745
  riskColor = "blue";
1572
- riskIcon = styleText8(["blue"], "\u25CF");
1746
+ riskIcon = styleText9(["blue"], "\u25CF");
1573
1747
  break;
1574
1748
  default:
1575
1749
  riskColor = "blue";
1576
- riskIcon = styleText8(["blue"], "\u25CF");
1750
+ riskIcon = styleText9(["blue"], "\u25CF");
1577
1751
  }
1578
- const riskText = styleText8([riskColor], `${riskIcon} ${riskLevel.toUpperCase()} RISK`);
1752
+ const riskText = styleText9([riskColor], `${riskIcon} ${riskLevel.toUpperCase()} RISK`);
1579
1753
  const credsBySource = credentialVars.reduce((acc, cv) => {
1580
1754
  const source = cv.source || "env";
1581
1755
  if (!acc[source]) {
@@ -1590,7 +1764,7 @@ function CredentialWarningComponent(credentials) {
1590
1764
  return `${sourceIcon}${source}: ${credList}`;
1591
1765
  });
1592
1766
  const credentialSummary = sourceSummaries.join(" | ");
1593
- return `${riskText} ${styleText8(["dim"], `(${credentialVars.length} creds: ${credentialSummary})`)}`;
1767
+ return `${riskText} ${styleText9(["dim"], `(${credentialVars.length} creds: ${credentialSummary})`)}`;
1594
1768
  }
1595
1769
  __name(CredentialWarningComponent, "CredentialWarningComponent");
1596
1770
  function getSourceIcon(source) {
@@ -1611,22 +1785,24 @@ function getSourceIcon(source) {
1611
1785
  __name(getSourceIcon, "getSourceIcon");
1612
1786
 
1613
1787
  // src/components/summary.ts
1614
- import { styleText as styleText9 } from "util";
1788
+ import { styleText as styleText10 } from "util";
1615
1789
  function SummaryComponent(stats) {
1616
- const { totalServers, runningServers, highRiskCredentials, transportBreakdown } = stats;
1617
- const runningBar = createProgressBar(runningServers, totalServers, 20, "green");
1618
- const securityBar = createProgressBar(highRiskCredentials, totalServers, 20, "red");
1790
+ const { totalServers, runningServers, highRiskCredentials, implicitLatestVersions, transportBreakdown } = stats;
1791
+ const runningBar = createProgressBar(runningServers, totalServers, 20, "green", false);
1792
+ const securityBar = createProgressBar(highRiskCredentials, totalServers, 20, "red", true);
1793
+ const versionBar = createProgressBar(implicitLatestVersions, totalServers, 20, "red", true);
1619
1794
  const transportText = `stdio: ${transportBreakdown.stdio} | SSE: ${transportBreakdown.sse} | HTTP: ${transportBreakdown.http}`;
1620
1795
  const lines = [
1621
1796
  "SUMMARY",
1622
1797
  ` SERVERS ${runningBar} ${runningServers} / ${totalServers} Running`,
1623
1798
  ` SECURITY ${securityBar} ${highRiskCredentials} / ${totalServers} High Risk Credentials`,
1799
+ ` VERSION ${versionBar} ${implicitLatestVersions} / ${totalServers} Implicit Latest`,
1624
1800
  ` TRANSPORT ${transportText}`
1625
1801
  ];
1626
1802
  return lines.join("\n");
1627
1803
  }
1628
1804
  __name(SummaryComponent, "SummaryComponent");
1629
- function createProgressBar(count, total, width, color) {
1805
+ function createProgressBar(count, total, width, color, emptyIsGood = false) {
1630
1806
  if (total === 0) {
1631
1807
  const emptyBar = "\u2591".repeat(width);
1632
1808
  return emptyBar;
@@ -1637,11 +1813,15 @@ function createProgressBar(count, total, width, color) {
1637
1813
  let filled;
1638
1814
  let empty;
1639
1815
  if (color === "green") {
1640
- filled = styleText9(["greenBright"], "\u2588".repeat(filledWidth));
1641
- empty = styleText9(["green"], "\u2591".repeat(emptyWidth));
1816
+ filled = styleText10(["greenBright"], "\u2588".repeat(filledWidth));
1817
+ empty = styleText10(["green"], "\u2591".repeat(emptyWidth));
1642
1818
  } else {
1643
- filled = styleText9(["redBright"], "\u2588".repeat(filledWidth));
1644
- empty = styleText9(["red"], "\u2591".repeat(emptyWidth));
1819
+ filled = styleText10(["redBright"], "\u2588".repeat(filledWidth));
1820
+ if (count === 0 && emptyIsGood) {
1821
+ empty = styleText10(["green"], "\u2591".repeat(emptyWidth));
1822
+ } else {
1823
+ empty = styleText10(["red"], "\u2591".repeat(emptyWidth));
1824
+ }
1645
1825
  }
1646
1826
  return `${filled}${empty}`;
1647
1827
  }
@@ -1663,9 +1843,9 @@ var RenderService = class _RenderService {
1663
1843
  }
1664
1844
  static printMcpServers(data) {
1665
1845
  if (data.length === 0) return;
1666
- const headers = ["STATUS", "NAME", "SOURCE", "TRANSPORT", "CREDENTIALS"];
1667
- const keys = ["status", "name", "source", "transport", "credentials"];
1668
- const centerColumns = [0, 2, 3];
1846
+ const headers = ["STATUS", "NAME", "VERSION", "SOURCE", "TRANSPORT", "CREDENTIALS"];
1847
+ const keys = ["status", "name", "versionInfo", "source", "transport", "credentials"];
1848
+ const centerColumns = [0, 3, 4];
1669
1849
  const leftPadding = " ";
1670
1850
  const columnWidths = headers.map((header, index) => {
1671
1851
  const headerWidth = _RenderService.getVisibleLength(render2(header));
@@ -1683,6 +1863,9 @@ var RenderService = class _RenderService {
1683
1863
  if (keys[index] === "name") {
1684
1864
  text = render4(text);
1685
1865
  }
1866
+ if (keys[index] === "versionInfo") {
1867
+ text = render6(row[keys[index]]);
1868
+ }
1686
1869
  if (keys[index] === "credentials") {
1687
1870
  text = CredentialWarningComponent(row[keys[index]]);
1688
1871
  }
@@ -1729,6 +1912,9 @@ var RenderService = class _RenderService {
1729
1912
  if (key === "name") {
1730
1913
  text = render4(text);
1731
1914
  }
1915
+ if (key === "versionInfo") {
1916
+ text = render6(row[key]);
1917
+ }
1732
1918
  if (key === "credentials") {
1733
1919
  text = CredentialWarningComponent(row[key]);
1734
1920
  }
@@ -1777,10 +1963,10 @@ var RenderService = class _RenderService {
1777
1963
  return render2(row[key]).padEnd(columnWidths[index2] + paddingNormalizer);
1778
1964
  }
1779
1965
  if (row["key"] === "FILE") {
1780
- return render6(row[key]).padEnd(columnWidths[index2] + paddingNormalizer);
1966
+ return render7(row[key]).padEnd(columnWidths[index2] + paddingNormalizer);
1781
1967
  }
1782
1968
  if (row["key"] === "PARSABLE") {
1783
- return render7(row[key]).padEnd(columnWidths[index2] + paddingNormalizer);
1969
+ return render8(row[key]).padEnd(columnWidths[index2] + paddingNormalizer);
1784
1970
  }
1785
1971
  return String(row[key]).padEnd(columnWidths[index2] + paddingNormalizer);
1786
1972
  }).join(" ");
@@ -1801,8 +1987,8 @@ var RenderService = class _RenderService {
1801
1987
  let filled;
1802
1988
  let empty;
1803
1989
  if (count > 0) {
1804
- filled = styleText10(["greenBright"], "\u2588".repeat(filledWidth));
1805
- empty = styleText10(["green"], "\u2591".repeat(emptyWidth));
1990
+ filled = styleText11(["greenBright"], "\u2588".repeat(filledWidth));
1991
+ empty = styleText11(["green"], "\u2591".repeat(emptyWidth));
1806
1992
  } else {
1807
1993
  filled = "\u2588".repeat(filledWidth);
1808
1994
  empty = "\u2591".repeat(emptyWidth);
@@ -1843,6 +2029,7 @@ async function init() {
1843
2029
  let totalServers = 0;
1844
2030
  let totalRunning = 0;
1845
2031
  let totalHighRiskCredentials = 0;
2032
+ let totalImplicitLatestVersions = 0;
1846
2033
  const transportCounts = { stdio: 0, sse: 0, http: 0 };
1847
2034
  for (const groupName of Object.keys(mcpFilesList)) {
1848
2035
  const group = mcpFilesList[groupName];
@@ -1867,6 +2054,9 @@ async function init() {
1867
2054
  if (server.credentials?.hasCredentials && server.credentials?.riskLevel === "high") {
1868
2055
  totalHighRiskCredentials++;
1869
2056
  }
2057
+ if (server.versionInfo?.isLatest) {
2058
+ totalImplicitLatestVersions++;
2059
+ }
1870
2060
  }
1871
2061
  const mcpGroupData = [
1872
2062
  { key: "PROVIDER", value: group.friendlyName },
@@ -1890,6 +2080,7 @@ async function init() {
1890
2080
  totalServers,
1891
2081
  runningServers: totalRunning,
1892
2082
  highRiskCredentials: totalHighRiskCredentials,
2083
+ implicitLatestVersions: totalImplicitLatestVersions,
1893
2084
  transportBreakdown: transportCounts
1894
2085
  };
1895
2086
  RenderService.printSummary(summaryStats);
@@ -1899,7 +2090,7 @@ init().then(() => {
1899
2090
  console.log("\n");
1900
2091
  });
1901
2092
  function exitWithError(message) {
1902
- console.error(`${styleText11(["red"], "\u25CF")} ${message}
2093
+ console.error(`${styleText12(["red"], "\u25CF")} ${message}
1903
2094
  `);
1904
2095
  process.exit(1);
1905
2096
  }
package/dist/main.cjs CHANGED
@@ -781,6 +781,157 @@ var DirectoryBubbleService = class {
781
781
  }
782
782
  };
783
783
 
784
+ // src/services/mcp-version-detection-service.ts
785
+ var MCPVersionDetectionService = class {
786
+ static {
787
+ __name(this, "MCPVersionDetectionService");
788
+ }
789
+ /**
790
+ * Analyze a server configuration to extract version information
791
+ * @param command - The command used to run the server
792
+ * @param args - Array of arguments passed to the command
793
+ * @returns PackageVersionInfo if analysis is possible, null otherwise
794
+ */
795
+ analyzeServerVersion(command, args) {
796
+ if (!["npx", "uvx", "uv"].includes(command)) {
797
+ return null;
798
+ }
799
+ if (!args || args.length === 0) {
800
+ return null;
801
+ }
802
+ const packageName = this.extractPackageName(command, args);
803
+ if (!packageName) {
804
+ return null;
805
+ }
806
+ const { name, version } = this.parsePackageVersion(packageName);
807
+ const isPinned = this.isPinnedVersion(version);
808
+ return {
809
+ packageName: name,
810
+ version,
811
+ isPinned,
812
+ isLatest: !isPinned
813
+ };
814
+ }
815
+ /**
816
+ * Extract the package name based on the command type
817
+ * @param command - The command used to run the server
818
+ * @param args - Array of arguments passed to the command
819
+ * @returns The package name/spec or null if not found
820
+ */
821
+ extractPackageName(command, args) {
822
+ switch (command) {
823
+ case "npx":
824
+ return this.extractNpxPackageName(args);
825
+ case "uvx":
826
+ return this.extractUvxPackageName(args);
827
+ case "uv":
828
+ return this.extractUvPackageName(args);
829
+ default:
830
+ return null;
831
+ }
832
+ }
833
+ /**
834
+ * Extract the package name from npx arguments
835
+ * @param args - Array of arguments passed to npx
836
+ * @returns The package name/spec or null if not found
837
+ */
838
+ extractNpxPackageName(args) {
839
+ if (!args || args.length === 0) {
840
+ return null;
841
+ }
842
+ const yIndex = args.indexOf("-y");
843
+ if (yIndex !== -1 && yIndex + 1 < args.length) {
844
+ return args[yIndex + 1];
845
+ }
846
+ const yesIndex = args.indexOf("--yes");
847
+ if (yesIndex !== -1 && yesIndex + 1 < args.length) {
848
+ return args[yesIndex + 1];
849
+ }
850
+ for (let i = 0; i < args.length; i++) {
851
+ const arg = args[i];
852
+ if (!arg.startsWith("-")) {
853
+ if (i > 0) {
854
+ const prevArg = args[i - 1];
855
+ if (prevArg === "--registry" || prevArg === "-r" || prevArg === "--package" || prevArg === "-p") {
856
+ continue;
857
+ }
858
+ }
859
+ return arg;
860
+ }
861
+ }
862
+ return null;
863
+ }
864
+ /**
865
+ * Extract the package name from uvx arguments
866
+ * @param args - Array of arguments passed to uvx
867
+ * @returns The package name/spec or null if not found
868
+ */
869
+ extractUvxPackageName(args) {
870
+ if (!args || args.length === 0) {
871
+ return null;
872
+ }
873
+ return args[0];
874
+ }
875
+ /**
876
+ * Extract the package name from uv arguments
877
+ * @param args - Array of arguments passed to uv
878
+ * @returns The package name/spec or null if not found
879
+ */
880
+ extractUvPackageName(args) {
881
+ if (!args || args.length === 0) {
882
+ return null;
883
+ }
884
+ const runIndex = args.indexOf("run");
885
+ if (runIndex !== -1 && runIndex + 1 < args.length) {
886
+ return args[runIndex + 1];
887
+ }
888
+ return null;
889
+ }
890
+ /**
891
+ * Parse a package specification to extract name and version
892
+ * @param packageSpec - Package specification (e.g., "package@1.0.0" or "package")
893
+ * @returns Object with name and optional version
894
+ */
895
+ parsePackageVersion(packageSpec) {
896
+ if (!packageSpec) {
897
+ return { name: "", version: void 0 };
898
+ }
899
+ if (packageSpec.startsWith("@")) {
900
+ const parts = packageSpec.split("@");
901
+ if (parts.length === 2) {
902
+ return { name: packageSpec, version: void 0 };
903
+ } else if (parts.length === 3) {
904
+ return {
905
+ name: `@${parts[1]}`,
906
+ version: parts[2]
907
+ };
908
+ }
909
+ }
910
+ const atIndex = packageSpec.lastIndexOf("@");
911
+ if (atIndex > 0) {
912
+ return {
913
+ name: packageSpec.substring(0, atIndex),
914
+ version: packageSpec.substring(atIndex + 1)
915
+ };
916
+ }
917
+ return { name: packageSpec, version: void 0 };
918
+ }
919
+ /**
920
+ * Determine if a version represents a pinned version
921
+ * @param version - The version string to check
922
+ * @returns true if the version is pinned, false if it's latest/implicit
923
+ */
924
+ isPinnedVersion(version) {
925
+ if (!version) {
926
+ return false;
927
+ }
928
+ if (version === "latest") {
929
+ return false;
930
+ }
931
+ return true;
932
+ }
933
+ };
934
+
784
935
  // src/utils/url-utils.ts
785
936
  function extractHostname(urlString) {
786
937
  try {
@@ -805,12 +956,14 @@ var MCPConfigService = class {
805
956
  currentOS;
806
957
  debug;
807
958
  directoryBubbleService;
959
+ versionDetectionService;
808
960
  enableDirectoryBubbling;
809
961
  constructor(options = {}) {
810
962
  this.pathRegistry = new MCPPathRegistry();
811
963
  this.currentOS = (0, import_node_os2.platform)();
812
964
  this.debug = import_node_util.default.debuglog("ls-mcp");
813
965
  this.directoryBubbleService = new DirectoryBubbleService();
966
+ this.versionDetectionService = new MCPVersionDetectionService();
814
967
  this.enableDirectoryBubbling = options.enableDirectoryBubbling ?? false;
815
968
  }
816
969
  /**
@@ -1007,6 +1160,10 @@ var MCPConfigService = class {
1007
1160
  } else {
1008
1161
  source = serverConfig.command || "";
1009
1162
  }
1163
+ const versionInfo = this.versionDetectionService.analyzeServerVersion(
1164
+ serverConfig.command || "",
1165
+ Array.isArray(serverConfig.args) ? serverConfig.args : void 0
1166
+ );
1010
1167
  serverInfos.push({
1011
1168
  name: serverName,
1012
1169
  command: serverConfig.command || "",
@@ -1019,6 +1176,7 @@ var MCPConfigService = class {
1019
1176
  headers: serverConfig.headers,
1020
1177
  status: "stopped",
1021
1178
  // Default status, will be updated by server manager
1179
+ versionInfo: versionInfo || void 0,
1022
1180
  credentials: CredentialDetectionService.analyzeServerConfig({
1023
1181
  env: serverConfig.env,
1024
1182
  args: serverConfig.args,
package/dist/main.d.cts CHANGED
@@ -25,6 +25,12 @@ interface MCPFilePath {
25
25
  parsable?: boolean;
26
26
  servers?: MCPServerInfo[];
27
27
  }
28
+ interface PackageVersionInfo {
29
+ packageName: string;
30
+ version?: string;
31
+ isPinned: boolean;
32
+ isLatest: boolean;
33
+ }
28
34
  interface MCPServerInfo {
29
35
  name: string;
30
36
  command: string;
@@ -35,6 +41,7 @@ interface MCPServerInfo {
35
41
  env?: Record<string, string>;
36
42
  headers?: Record<string, string>;
37
43
  status?: 'running' | 'stopped';
44
+ versionInfo?: PackageVersionInfo;
38
45
  credentials?: CredentialAnalysisResult;
39
46
  }
40
47
  interface MCPFileGroups {
@@ -86,6 +93,7 @@ declare class MCPConfigService {
86
93
  private currentOS;
87
94
  private debug;
88
95
  private directoryBubbleService;
96
+ private versionDetectionService;
89
97
  private enableDirectoryBubbling;
90
98
  constructor(options?: MCPConfigServiceOptions);
91
99
  getConfigFilesPerApp(appName: string): MCPFilePath[];
package/dist/main.d.ts CHANGED
@@ -25,6 +25,12 @@ interface MCPFilePath {
25
25
  parsable?: boolean;
26
26
  servers?: MCPServerInfo[];
27
27
  }
28
+ interface PackageVersionInfo {
29
+ packageName: string;
30
+ version?: string;
31
+ isPinned: boolean;
32
+ isLatest: boolean;
33
+ }
28
34
  interface MCPServerInfo {
29
35
  name: string;
30
36
  command: string;
@@ -35,6 +41,7 @@ interface MCPServerInfo {
35
41
  env?: Record<string, string>;
36
42
  headers?: Record<string, string>;
37
43
  status?: 'running' | 'stopped';
44
+ versionInfo?: PackageVersionInfo;
38
45
  credentials?: CredentialAnalysisResult;
39
46
  }
40
47
  interface MCPFileGroups {
@@ -86,6 +93,7 @@ declare class MCPConfigService {
86
93
  private currentOS;
87
94
  private debug;
88
95
  private directoryBubbleService;
96
+ private versionDetectionService;
89
97
  private enableDirectoryBubbling;
90
98
  constructor(options?: MCPConfigServiceOptions);
91
99
  getConfigFilesPerApp(appName: string): MCPFilePath[];