ls-mcp 1.14.0 → 1.15.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/README.md +18 -1
- package/dist/bin/cli.cjs +19 -2
- package/dist/bin/cli.mjs +19 -2
- package/package.json +1 -1
- package/src/bin/cli.ts +22 -3
package/README.md
CHANGED
|
@@ -56,6 +56,23 @@ The `--files` flag automatically detects the configuration structure in your fil
|
|
|
56
56
|
- `mcp.servers` - Nested configuration format
|
|
57
57
|
- `context_servers` - Context-based configuration format
|
|
58
58
|
|
|
59
|
+
### Show All Providers
|
|
60
|
+
|
|
61
|
+
By default, `ls-mcp` hides providers that have zero configured servers to reduce clutter. To show all providers including those with empty configurations, use the `--all` or `-a` flag:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Show all providers including empty ones
|
|
65
|
+
npx ls-mcp --all
|
|
66
|
+
|
|
67
|
+
# Short form
|
|
68
|
+
npx ls-mcp -a
|
|
69
|
+
|
|
70
|
+
# Combine with JSON output
|
|
71
|
+
npx ls-mcp --all --json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Note**: When using `--files` to analyze specific configuration files, the custom group is always shown even if it contains zero servers, as you explicitly requested to analyze those files.
|
|
75
|
+
|
|
59
76
|
### JSON Output
|
|
60
77
|
|
|
61
78
|
To output results in JSON format (useful for programmatic consumption):
|
|
@@ -68,7 +85,7 @@ npx ls-mcp --files ./config.json --json
|
|
|
68
85
|
```
|
|
69
86
|
|
|
70
87
|
This will return a structured JSON object containing:
|
|
71
|
-
- `mcpFiles`: Complete MCP server configurations organized by provider (only includes providers with configured servers)
|
|
88
|
+
- `mcpFiles`: Complete MCP server configurations organized by provider (only includes providers with configured servers unless `--all` is specified)
|
|
72
89
|
- `summary`: Statistics including total servers, running servers, credential warnings, and transport breakdown
|
|
73
90
|
|
|
74
91
|
### Debug Mode
|
package/dist/bin/cli.cjs
CHANGED
|
@@ -1672,6 +1672,7 @@ var RenderService = class _RenderService {
|
|
|
1672
1672
|
// src/bin/cli.ts
|
|
1673
1673
|
var args = process.argv.slice(2);
|
|
1674
1674
|
var jsonOutput = args.includes("--json");
|
|
1675
|
+
var showAll = args.includes("--all") || args.includes("-a");
|
|
1675
1676
|
var customFiles;
|
|
1676
1677
|
var filesIndex = args.findIndex((arg) => arg === "--files");
|
|
1677
1678
|
if (filesIndex !== -1 && filesIndex < args.length - 1) {
|
|
@@ -1708,6 +1709,11 @@ async function init() {
|
|
|
1708
1709
|
const transportCounts = { stdio: 0, sse: 0, http: 0 };
|
|
1709
1710
|
for (const groupName of Object.keys(mcpFilesList)) {
|
|
1710
1711
|
const group = mcpFilesList[groupName];
|
|
1712
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0;
|
|
1713
|
+
const shouldSkipGroup = !showAll && !isCustomFilesMode && group.stats?.serversCount === 0;
|
|
1714
|
+
if (shouldSkipGroup) {
|
|
1715
|
+
continue;
|
|
1716
|
+
}
|
|
1711
1717
|
if (group.paths.length > 0) {
|
|
1712
1718
|
for (const filePathData of group.paths) {
|
|
1713
1719
|
pathIndex++;
|
|
@@ -1751,7 +1757,12 @@ async function init() {
|
|
|
1751
1757
|
}
|
|
1752
1758
|
}
|
|
1753
1759
|
if (pathIndex === 0) {
|
|
1754
|
-
|
|
1760
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0;
|
|
1761
|
+
if (isCustomFilesMode) {
|
|
1762
|
+
exitWithError("No MCP servers found in specified configuration files.");
|
|
1763
|
+
} else {
|
|
1764
|
+
exitWithError("No MCP servers found in known configuration files.");
|
|
1765
|
+
}
|
|
1755
1766
|
}
|
|
1756
1767
|
const summaryStats = {
|
|
1757
1768
|
totalServers,
|
|
@@ -1761,8 +1772,14 @@ async function init() {
|
|
|
1761
1772
|
transportBreakdown: transportCounts
|
|
1762
1773
|
};
|
|
1763
1774
|
if (jsonOutput) {
|
|
1775
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0;
|
|
1764
1776
|
const filteredMcpFiles = Object.fromEntries(
|
|
1765
|
-
Object.entries(mcpFilesList).filter(([, group]) =>
|
|
1777
|
+
Object.entries(mcpFilesList).filter(([, group]) => {
|
|
1778
|
+
if (showAll || isCustomFilesMode) {
|
|
1779
|
+
return group.paths.length > 0;
|
|
1780
|
+
}
|
|
1781
|
+
return (group.stats?.serversCount ?? 0) > 0;
|
|
1782
|
+
})
|
|
1766
1783
|
);
|
|
1767
1784
|
const output = {
|
|
1768
1785
|
mcpFiles: filteredMcpFiles,
|
package/dist/bin/cli.mjs
CHANGED
|
@@ -1650,6 +1650,7 @@ var RenderService = class _RenderService {
|
|
|
1650
1650
|
// src/bin/cli.ts
|
|
1651
1651
|
var args = process.argv.slice(2);
|
|
1652
1652
|
var jsonOutput = args.includes("--json");
|
|
1653
|
+
var showAll = args.includes("--all") || args.includes("-a");
|
|
1653
1654
|
var customFiles;
|
|
1654
1655
|
var filesIndex = args.findIndex((arg) => arg === "--files");
|
|
1655
1656
|
if (filesIndex !== -1 && filesIndex < args.length - 1) {
|
|
@@ -1686,6 +1687,11 @@ async function init() {
|
|
|
1686
1687
|
const transportCounts = { stdio: 0, sse: 0, http: 0 };
|
|
1687
1688
|
for (const groupName of Object.keys(mcpFilesList)) {
|
|
1688
1689
|
const group = mcpFilesList[groupName];
|
|
1690
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0;
|
|
1691
|
+
const shouldSkipGroup = !showAll && !isCustomFilesMode && group.stats?.serversCount === 0;
|
|
1692
|
+
if (shouldSkipGroup) {
|
|
1693
|
+
continue;
|
|
1694
|
+
}
|
|
1689
1695
|
if (group.paths.length > 0) {
|
|
1690
1696
|
for (const filePathData of group.paths) {
|
|
1691
1697
|
pathIndex++;
|
|
@@ -1729,7 +1735,12 @@ async function init() {
|
|
|
1729
1735
|
}
|
|
1730
1736
|
}
|
|
1731
1737
|
if (pathIndex === 0) {
|
|
1732
|
-
|
|
1738
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0;
|
|
1739
|
+
if (isCustomFilesMode) {
|
|
1740
|
+
exitWithError("No MCP servers found in specified configuration files.");
|
|
1741
|
+
} else {
|
|
1742
|
+
exitWithError("No MCP servers found in known configuration files.");
|
|
1743
|
+
}
|
|
1733
1744
|
}
|
|
1734
1745
|
const summaryStats = {
|
|
1735
1746
|
totalServers,
|
|
@@ -1739,8 +1750,14 @@ async function init() {
|
|
|
1739
1750
|
transportBreakdown: transportCounts
|
|
1740
1751
|
};
|
|
1741
1752
|
if (jsonOutput) {
|
|
1753
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0;
|
|
1742
1754
|
const filteredMcpFiles = Object.fromEntries(
|
|
1743
|
-
Object.entries(mcpFilesList).filter(([, group]) =>
|
|
1755
|
+
Object.entries(mcpFilesList).filter(([, group]) => {
|
|
1756
|
+
if (showAll || isCustomFilesMode) {
|
|
1757
|
+
return group.paths.length > 0;
|
|
1758
|
+
}
|
|
1759
|
+
return (group.stats?.serversCount ?? 0) > 0;
|
|
1760
|
+
})
|
|
1744
1761
|
);
|
|
1745
1762
|
const output = {
|
|
1746
1763
|
mcpFiles: filteredMcpFiles,
|
package/package.json
CHANGED
package/src/bin/cli.ts
CHANGED
|
@@ -19,6 +19,7 @@ interface MCPServerInfo {
|
|
|
19
19
|
// Parse command-line arguments
|
|
20
20
|
const args = process.argv.slice(2)
|
|
21
21
|
const jsonOutput = args.includes('--json')
|
|
22
|
+
const showAll = args.includes('--all') || args.includes('-a')
|
|
22
23
|
|
|
23
24
|
// Parse --files flag
|
|
24
25
|
let customFiles: string[] | undefined
|
|
@@ -67,6 +68,13 @@ async function init () {
|
|
|
67
68
|
for (const groupName of Object.keys(mcpFilesList)) {
|
|
68
69
|
const group = mcpFilesList[groupName]
|
|
69
70
|
|
|
71
|
+
// Skip groups with zero servers unless --all is specified or in --files mode
|
|
72
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0
|
|
73
|
+
const shouldSkipGroup = !showAll && !isCustomFilesMode && (group.stats?.serversCount === 0)
|
|
74
|
+
if (shouldSkipGroup) {
|
|
75
|
+
continue
|
|
76
|
+
}
|
|
77
|
+
|
|
70
78
|
if (group.paths.length > 0) {
|
|
71
79
|
// handle file path list of MCP Servers
|
|
72
80
|
for (const filePathData of group.paths) {
|
|
@@ -127,7 +135,12 @@ async function init () {
|
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
if (pathIndex === 0) {
|
|
130
|
-
|
|
138
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0
|
|
139
|
+
if (isCustomFilesMode) {
|
|
140
|
+
exitWithError('No MCP servers found in specified configuration files.')
|
|
141
|
+
} else {
|
|
142
|
+
exitWithError('No MCP servers found in known configuration files.')
|
|
143
|
+
}
|
|
131
144
|
}
|
|
132
145
|
|
|
133
146
|
// Prepare summary statistics
|
|
@@ -141,9 +154,15 @@ async function init () {
|
|
|
141
154
|
|
|
142
155
|
// Output based on mode
|
|
143
156
|
if (jsonOutput) {
|
|
144
|
-
// Filter out providers with
|
|
157
|
+
// Filter out providers with zero servers unless --all is specified or in --files mode
|
|
158
|
+
const isCustomFilesMode = customFiles && customFiles.length > 0
|
|
145
159
|
const filteredMcpFiles = Object.fromEntries(
|
|
146
|
-
Object.entries(mcpFilesList).filter(([, group]) =>
|
|
160
|
+
Object.entries(mcpFilesList).filter(([, group]) => {
|
|
161
|
+
if (showAll || isCustomFilesMode) {
|
|
162
|
+
return group.paths.length > 0
|
|
163
|
+
}
|
|
164
|
+
return (group.stats?.serversCount ?? 0) > 0
|
|
165
|
+
})
|
|
147
166
|
)
|
|
148
167
|
|
|
149
168
|
const output = {
|