ls-mcp 1.15.0 → 1.15.2

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
@@ -1578,8 +1578,6 @@ var RenderService = class _RenderService {
1578
1578
  }).join(" ");
1579
1579
  console.log(leftPadding + dataRow);
1580
1580
  }
1581
- console.log("\n");
1582
- console.log(`${leftPadding}\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584`);
1583
1581
  }
1584
1582
  // Example mocked data for rendering the group information
1585
1583
  // const mcpGroupDataMock = [
@@ -1716,12 +1714,16 @@ async function init() {
1716
1714
  }
1717
1715
  if (group.paths.length > 0) {
1718
1716
  for (const filePathData of group.paths) {
1717
+ const totalMCPServers = filePathData.servers ? filePathData.servers.length : 0;
1718
+ const shouldSkipFile = !showAll && !isCustomFilesMode && totalMCPServers === 0;
1719
+ if (shouldSkipFile) {
1720
+ continue;
1721
+ }
1719
1722
  pathIndex++;
1720
1723
  const filePath = filePathData.filePath.replace("~", process.env.HOME || "");
1721
1724
  const filePathValid = filePathData.parsable ? "VALID" : "INVALID";
1722
1725
  const filePathDataType = filePathData.type.toUpperCase();
1723
1726
  const mcpServers = filePathData.servers || [];
1724
- const totalMCPServers = filePathData.servers ? filePathData.servers.length : 0;
1725
1727
  const totalMCPServersRunning = mcpServers.filter((server) => server.status === "running").length;
1726
1728
  totalServers += totalMCPServers;
1727
1729
  totalRunning += totalMCPServersRunning;
@@ -1774,11 +1776,18 @@ async function init() {
1774
1776
  if (jsonOutput) {
1775
1777
  const isCustomFilesMode = customFiles && customFiles.length > 0;
1776
1778
  const filteredMcpFiles = Object.fromEntries(
1777
- Object.entries(mcpFilesList).filter(([, group]) => {
1778
- if (showAll || isCustomFilesMode) {
1779
- return group.paths.length > 0;
1780
- }
1781
- return (group.stats?.serversCount ?? 0) > 0;
1779
+ Object.entries(mcpFilesList).map(([groupName, group]) => {
1780
+ const filteredPaths = group.paths.filter((filePathData) => {
1781
+ const fileServerCount = filePathData.servers ? filePathData.servers.length : 0;
1782
+ if (showAll || isCustomFilesMode) {
1783
+ return true;
1784
+ }
1785
+ return fileServerCount > 0;
1786
+ });
1787
+ return [groupName, { ...group, paths: filteredPaths }];
1788
+ }).filter((entry) => {
1789
+ const [, group] = entry;
1790
+ return group.paths.length > 0;
1782
1791
  })
1783
1792
  );
1784
1793
  const output = {
package/dist/bin/cli.mjs CHANGED
@@ -1556,8 +1556,6 @@ var RenderService = class _RenderService {
1556
1556
  }).join(" ");
1557
1557
  console.log(leftPadding + dataRow);
1558
1558
  }
1559
- console.log("\n");
1560
- console.log(`${leftPadding}\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584`);
1561
1559
  }
1562
1560
  // Example mocked data for rendering the group information
1563
1561
  // const mcpGroupDataMock = [
@@ -1694,12 +1692,16 @@ async function init() {
1694
1692
  }
1695
1693
  if (group.paths.length > 0) {
1696
1694
  for (const filePathData of group.paths) {
1695
+ const totalMCPServers = filePathData.servers ? filePathData.servers.length : 0;
1696
+ const shouldSkipFile = !showAll && !isCustomFilesMode && totalMCPServers === 0;
1697
+ if (shouldSkipFile) {
1698
+ continue;
1699
+ }
1697
1700
  pathIndex++;
1698
1701
  const filePath = filePathData.filePath.replace("~", process.env.HOME || "");
1699
1702
  const filePathValid = filePathData.parsable ? "VALID" : "INVALID";
1700
1703
  const filePathDataType = filePathData.type.toUpperCase();
1701
1704
  const mcpServers = filePathData.servers || [];
1702
- const totalMCPServers = filePathData.servers ? filePathData.servers.length : 0;
1703
1705
  const totalMCPServersRunning = mcpServers.filter((server) => server.status === "running").length;
1704
1706
  totalServers += totalMCPServers;
1705
1707
  totalRunning += totalMCPServersRunning;
@@ -1752,11 +1754,18 @@ async function init() {
1752
1754
  if (jsonOutput) {
1753
1755
  const isCustomFilesMode = customFiles && customFiles.length > 0;
1754
1756
  const filteredMcpFiles = Object.fromEntries(
1755
- Object.entries(mcpFilesList).filter(([, group]) => {
1756
- if (showAll || isCustomFilesMode) {
1757
- return group.paths.length > 0;
1758
- }
1759
- return (group.stats?.serversCount ?? 0) > 0;
1757
+ Object.entries(mcpFilesList).map(([groupName, group]) => {
1758
+ const filteredPaths = group.paths.filter((filePathData) => {
1759
+ const fileServerCount = filePathData.servers ? filePathData.servers.length : 0;
1760
+ if (showAll || isCustomFilesMode) {
1761
+ return true;
1762
+ }
1763
+ return fileServerCount > 0;
1764
+ });
1765
+ return [groupName, { ...group, paths: filteredPaths }];
1766
+ }).filter((entry) => {
1767
+ const [, group] = entry;
1768
+ return group.paths.length > 0;
1760
1769
  })
1761
1770
  );
1762
1771
  const output = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-mcp",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "description": "list and detect MCP servers and configurations",
5
5
  "types": "dist/main.d.ts",
6
6
  "type": "module",
package/src/bin/cli.ts CHANGED
@@ -78,6 +78,14 @@ async function init () {
78
78
  if (group.paths.length > 0) {
79
79
  // handle file path list of MCP Servers
80
80
  for (const filePathData of group.paths) {
81
+ const totalMCPServers = filePathData.servers ? filePathData.servers.length : 0
82
+
83
+ // Skip file paths with zero servers unless --all is specified or in --files mode
84
+ const shouldSkipFile = !showAll && !isCustomFilesMode && totalMCPServers === 0
85
+ if (shouldSkipFile) {
86
+ continue
87
+ }
88
+
81
89
  pathIndex++
82
90
 
83
91
  const filePath = filePathData.filePath.replace('~', process.env.HOME || '')
@@ -85,7 +93,6 @@ async function init () {
85
93
  const filePathDataType = filePathData.type.toUpperCase()
86
94
  const mcpServers = filePathData.servers || []
87
95
 
88
- const totalMCPServers = filePathData.servers ? filePathData.servers.length : 0
89
96
  const totalMCPServersRunning = mcpServers.filter((server: MCPServerInfo) => server.status === 'running').length
90
97
 
91
98
  // Accumulate summary statistics
@@ -157,12 +164,24 @@ async function init () {
157
164
  // Filter out providers with zero servers unless --all is specified or in --files mode
158
165
  const isCustomFilesMode = customFiles && customFiles.length > 0
159
166
  const filteredMcpFiles = Object.fromEntries(
160
- Object.entries(mcpFilesList).filter(([, group]) => {
161
- if (showAll || isCustomFilesMode) {
167
+ Object.entries(mcpFilesList)
168
+ .map(([groupName, group]) => {
169
+ // Filter individual file paths with zero servers unless --all or --files mode
170
+ const filteredPaths = group.paths.filter(filePathData => {
171
+ const fileServerCount = filePathData.servers ? filePathData.servers.length : 0
172
+ if (showAll || isCustomFilesMode) {
173
+ return true // Keep all files
174
+ }
175
+ return fileServerCount > 0 // Only keep files with servers
176
+ })
177
+
178
+ return [groupName, { ...group, paths: filteredPaths }] as const
179
+ })
180
+ .filter((entry): entry is [string, typeof entry[1]] => {
181
+ // After filtering file paths, remove groups with no remaining paths
182
+ const [, group] = entry
162
183
  return group.paths.length > 0
163
- }
164
- return (group.stats?.serversCount ?? 0) > 0
165
- })
184
+ })
166
185
  )
167
186
 
168
187
  const output = {
@@ -158,9 +158,6 @@ export class RenderService {
158
158
  }).join(' ')
159
159
  console.log(leftPadding + dataRow)
160
160
  }
161
-
162
- console.log('\n')
163
- console.log(`${leftPadding}▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄`)
164
161
  }
165
162
 
166
163
  // Example mocked data for rendering the group information