ls-mcp 1.9.1 → 1.10.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 +12 -0
- package/dist/bin/cli.cjs +841 -289
- package/dist/bin/cli.mjs +823 -271
- package/dist/main.cjs +703 -263
- package/dist/main.d.cts +76 -14
- package/dist/main.d.ts +76 -14
- package/dist/main.mjs +702 -264
- package/package.json +3 -1
- package/src/bin/cli.ts +37 -5
- package/src/components/credential-warning.ts +37 -0
- package/src/components/summary.ts +57 -0
- package/src/main.ts +49 -140
- package/src/services/credential-detection-service.ts +166 -0
- package/src/services/mcp-config-linter-service.ts +13 -74
- package/src/services/mcp-config-parser.ts +233 -0
- package/src/services/mcp-config-service.ts +267 -0
- package/src/services/mcp-path-registry.ts +164 -0
- package/src/services/mcp-server-manager-service.ts +3 -3
- package/src/services/render-service.ts +46 -2
- package/src/types/mcp-config-service.types.ts +75 -0
- package/src/types.ts +1 -1
- package/src/utils/os-paths.ts +0 -102
|
@@ -6,12 +6,25 @@ import MCPServerNameComponent from '../components/mcp-server-name.js'
|
|
|
6
6
|
import MCPServerSourceComponent from '../components/mcp-server-source.js'
|
|
7
7
|
import FilePathComponent from '../components/file-path.js'
|
|
8
8
|
import MCPServersConfigParsableComponent from '../components/mcp-servers-config-parsable.js'
|
|
9
|
+
import CredentialWarningComponent from '../components/credential-warning.js'
|
|
10
|
+
import SummaryComponent from '../components/summary.js'
|
|
9
11
|
|
|
10
12
|
interface GroupMetadata {
|
|
11
13
|
mcpServersRunning?: number
|
|
12
14
|
mcpServersTotal?: number
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
interface SummaryStats {
|
|
18
|
+
totalServers: number
|
|
19
|
+
runningServers: number
|
|
20
|
+
highRiskCredentials: number
|
|
21
|
+
transportBreakdown: {
|
|
22
|
+
stdio: number
|
|
23
|
+
sse: number
|
|
24
|
+
http: number
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
15
28
|
export class RenderService {
|
|
16
29
|
// Example mocked data for rendering the servers information
|
|
17
30
|
// const mcpServersDataMock = [
|
|
@@ -28,8 +41,8 @@ export class RenderService {
|
|
|
28
41
|
static printMcpServers (data: any[]) {
|
|
29
42
|
if (data.length === 0) return
|
|
30
43
|
|
|
31
|
-
const headers = ['STATUS', 'NAME', 'SOURCE', 'TRANSPORT']
|
|
32
|
-
const keys = ['status', 'name', 'source', 'transport']
|
|
44
|
+
const headers = ['STATUS', 'NAME', 'SOURCE', 'TRANSPORT', 'CREDENTIALS']
|
|
45
|
+
const keys = ['status', 'name', 'source', 'transport', 'credentials']
|
|
33
46
|
const centerColumns = [0, 2, 3] // STATUS and TRANSPORT column indices
|
|
34
47
|
const leftPadding = ' ' // 6 characters
|
|
35
48
|
|
|
@@ -56,6 +69,10 @@ export class RenderService {
|
|
|
56
69
|
text = MCPServerNameComponent(text)
|
|
57
70
|
}
|
|
58
71
|
|
|
72
|
+
if (keys[index] === 'credentials') {
|
|
73
|
+
text = CredentialWarningComponent(row[keys[index]])
|
|
74
|
+
}
|
|
75
|
+
|
|
59
76
|
return RenderService.getVisibleLength(text)
|
|
60
77
|
}))
|
|
61
78
|
return Math.max(headerWidth, dataWidth)
|
|
@@ -119,6 +136,10 @@ export class RenderService {
|
|
|
119
136
|
text = MCPServerNameComponent(text)
|
|
120
137
|
}
|
|
121
138
|
|
|
139
|
+
if (key === 'credentials') {
|
|
140
|
+
text = CredentialWarningComponent(row[key])
|
|
141
|
+
}
|
|
142
|
+
|
|
122
143
|
// Apply alignment
|
|
123
144
|
if (centerColumns.includes(index)) {
|
|
124
145
|
return centerText(text, columnWidths[index])
|
|
@@ -220,4 +241,27 @@ export class RenderService {
|
|
|
220
241
|
|
|
221
242
|
return `${filled}${empty} ${count} / ${total} ${label}`
|
|
222
243
|
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Print summary statistics at the end of the output
|
|
247
|
+
*/
|
|
248
|
+
static printSummary (stats: SummaryStats): void {
|
|
249
|
+
console.log('\n')
|
|
250
|
+
console.log(' ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄')
|
|
251
|
+
console.log()
|
|
252
|
+
|
|
253
|
+
const summaryOutput = SummaryComponent(stats)
|
|
254
|
+
const lines = summaryOutput.split('\n')
|
|
255
|
+
|
|
256
|
+
for (const line of lines) {
|
|
257
|
+
if (line === 'SUMMARY') {
|
|
258
|
+
console.log(' ' + line)
|
|
259
|
+
} else {
|
|
260
|
+
console.log(' ' + line)
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
console.log()
|
|
265
|
+
console.log(' ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄')
|
|
266
|
+
}
|
|
223
267
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export interface MCPConfigData {
|
|
2
|
+
raw: any
|
|
3
|
+
parsed: boolean
|
|
4
|
+
valid: boolean
|
|
5
|
+
servers: Record<string, MCPServerConfig>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface MCPServerConfig {
|
|
9
|
+
name: string
|
|
10
|
+
command: string
|
|
11
|
+
args?: string[]
|
|
12
|
+
transport?: 'stdio' | 'sse' | 'http'
|
|
13
|
+
type?: 'sse' | 'http' | 'stdio' | 'streamable-http'
|
|
14
|
+
env?: Record<string, string>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface MCPAppMetadata {
|
|
18
|
+
name: string
|
|
19
|
+
friendlyName: string
|
|
20
|
+
paths: MCPFilePath[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface MCPFilePath {
|
|
24
|
+
filePath: string
|
|
25
|
+
type: 'local' | 'global'
|
|
26
|
+
parsable?: boolean
|
|
27
|
+
servers?: MCPServerInfo[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface MCPServerInfo {
|
|
31
|
+
name: string
|
|
32
|
+
command: string
|
|
33
|
+
args?: string[]
|
|
34
|
+
transport?: 'stdio' | 'sse' | 'http'
|
|
35
|
+
type?: 'sse' | 'http' | 'stdio' | 'streamable-http'
|
|
36
|
+
source?: string
|
|
37
|
+
env?: Record<string, string>
|
|
38
|
+
status?: 'running' | 'stopped'
|
|
39
|
+
credentials?: CredentialAnalysisResult
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface MCPFileGroups {
|
|
43
|
+
name: string
|
|
44
|
+
friendlyName: string
|
|
45
|
+
paths: MCPFilePath[]
|
|
46
|
+
stats?: {
|
|
47
|
+
serversCount?: number
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface MCPFileGroupsResult {
|
|
52
|
+
name: string
|
|
53
|
+
friendlyName: string
|
|
54
|
+
paths: MCPFilePath[]
|
|
55
|
+
stats: {
|
|
56
|
+
serversCount?: number
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type MCPFilePathGroupsRecord = Record<string, MCPFileGroups>
|
|
61
|
+
export type MCPFileGroupsResultRecord = Record<string, MCPFileGroups>
|
|
62
|
+
export type MCPAppPathsRecord = Record<string, MCPFilePath[]>
|
|
63
|
+
|
|
64
|
+
// Credential detection types
|
|
65
|
+
export interface CredentialVariable {
|
|
66
|
+
name: string
|
|
67
|
+
value: string
|
|
68
|
+
riskLevel: 'low' | 'high'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface CredentialAnalysisResult {
|
|
72
|
+
hasCredentials: boolean
|
|
73
|
+
credentialVars: CredentialVariable[]
|
|
74
|
+
riskLevel: 'none' | 'low' | 'high'
|
|
75
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface MCPServerInfo {
|
|
|
3
3
|
command: string
|
|
4
4
|
args?: string[]
|
|
5
5
|
transport?: 'stdio' | 'sse' | 'http',
|
|
6
|
-
type?: 'sse' | 'http' | 'stdio'
|
|
6
|
+
type?: 'sse' | 'http' | 'stdio' | 'streamable-http'
|
|
7
7
|
source?: string
|
|
8
8
|
env?: Record<string, string>
|
|
9
9
|
status?: 'running' | 'stopped'
|
package/src/utils/os-paths.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import path from 'node:path'
|
|
2
|
-
import { type MCPFilePath } from '../types.ts'
|
|
3
|
-
|
|
4
|
-
const appData = process.env.APPDATA || ''
|
|
5
|
-
const localAppData = process.env.LOCALAPPDATA || ''
|
|
6
|
-
const homeDir = process.env.HOME || ''
|
|
7
|
-
|
|
8
|
-
export function getWindowsPaths (): Record<string, MCPFilePath[]> {
|
|
9
|
-
return {
|
|
10
|
-
claude: [
|
|
11
|
-
{ filePath: path.join(appData, 'Claude', 'claude_desktop_config.json'), type: 'global' }
|
|
12
|
-
],
|
|
13
|
-
claude_code: [
|
|
14
|
-
{ filePath: '.mcp.json', type: 'local' }
|
|
15
|
-
],
|
|
16
|
-
cursor: [
|
|
17
|
-
{ filePath: path.join(homeDir, '.cursor', 'mcp.json'), type: 'global' },
|
|
18
|
-
{ filePath: path.join('.cursor', 'mcp.json'), type: 'local' }
|
|
19
|
-
],
|
|
20
|
-
vscode: [
|
|
21
|
-
{ filePath: path.join('.vscode', 'mcp.json'), type: 'local' },
|
|
22
|
-
{ filePath: path.join(appData, 'Code', 'User', 'settings.json'), type: 'global' },
|
|
23
|
-
{ filePath: path.join(appData, 'Code - Insiders', 'User', 'settings.json'), type: 'global' },
|
|
24
|
-
{ filePath: path.join(appData, 'Code', 'User', 'mcp.json'), type: 'global' },
|
|
25
|
-
{ filePath: path.join(appData, 'Code - Insiders', 'User', 'mcp.json'), type: 'global' }
|
|
26
|
-
],
|
|
27
|
-
cline: [
|
|
28
|
-
{ filePath: path.join(appData, 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' },
|
|
29
|
-
{ filePath: path.join(appData, 'Code - Insiders', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' }
|
|
30
|
-
],
|
|
31
|
-
windsurf: [
|
|
32
|
-
{ filePath: path.join('.codeium', 'windsurf', 'mcp_config.json'), type: 'local' },
|
|
33
|
-
],
|
|
34
|
-
roo: [
|
|
35
|
-
{ filePath: path.join(appData, 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' },
|
|
36
|
-
{ filePath: path.join(appData, 'Code - Insiders', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' },
|
|
37
|
-
],
|
|
38
|
-
'intellij-github-copilot': [
|
|
39
|
-
{ filePath: path.join(localAppData, 'github-copilot', 'intellij', 'mcp.json'), type: 'global' },
|
|
40
|
-
],
|
|
41
|
-
junie: [
|
|
42
|
-
{ filePath: path.join(homeDir, '.junie', 'mcp', 'mcp.json'), type: 'global' },
|
|
43
|
-
],
|
|
44
|
-
zed: [
|
|
45
|
-
{ filePath: path.join(localAppData, 'zed', 'settings.json'), type: 'global' },
|
|
46
|
-
{ filePath: path.join('.zed', 'settings.json'), type: 'local' }
|
|
47
|
-
],
|
|
48
|
-
gemini: [
|
|
49
|
-
{ filePath: path.join(homeDir, '.gemini', 'settings.json'), type: 'global' },
|
|
50
|
-
{ filePath: path.join('.gemini', 'settings.json'), type: 'local' }
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function getDarwinPaths (): Record<string, MCPFilePath[]> {
|
|
56
|
-
return {
|
|
57
|
-
claude: [
|
|
58
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'), type: 'global' }
|
|
59
|
-
],
|
|
60
|
-
claude_code: [
|
|
61
|
-
{ filePath: '.mcp.json', type: 'local' }
|
|
62
|
-
],
|
|
63
|
-
cursor: [
|
|
64
|
-
{ filePath: path.join(homeDir, '.cursor', 'mcp.json'), type: 'global' },
|
|
65
|
-
{ filePath: path.join('.cursor', 'mcp.json'), type: 'local' }
|
|
66
|
-
],
|
|
67
|
-
vscode: [
|
|
68
|
-
{ filePath: path.join('.vscode', 'mcp.json'), type: 'local' },
|
|
69
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'settings.json'), type: 'global' },
|
|
70
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'mcp.json'), type: 'global' },
|
|
71
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code - Insiders', 'User', 'settings.json'), type: 'global' },
|
|
72
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code - Insiders', 'User', 'mcp.json'), type: 'global' }
|
|
73
|
-
],
|
|
74
|
-
cline: [
|
|
75
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' },
|
|
76
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code - Insiders', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' }
|
|
77
|
-
],
|
|
78
|
-
windsurf: [
|
|
79
|
-
{ filePath: path.join('.codeium', 'windsurf', 'mcp_config.json'), type: 'local' },
|
|
80
|
-
],
|
|
81
|
-
roo: [
|
|
82
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' },
|
|
83
|
-
{ filePath: path.join(homeDir, 'Library', 'Application Support', 'Code - Insiders', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' },
|
|
84
|
-
],
|
|
85
|
-
'intellij-github-copilot': [
|
|
86
|
-
{ filePath: path.join(homeDir, '.config', 'github-copilot', 'intellij', 'mcp.json'), type: 'global' },
|
|
87
|
-
],
|
|
88
|
-
junie: [
|
|
89
|
-
{ filePath: path.join(homeDir, '.junie', 'mcp', 'mcp.json'), type: 'global' },
|
|
90
|
-
{ filePath: path.join('.junie', 'mcp', 'mcp.json'), type: 'local' }
|
|
91
|
-
],
|
|
92
|
-
|
|
93
|
-
zed: [
|
|
94
|
-
{ filePath: path.join(homeDir, '.config', 'zed', 'settings.json'), type: 'global' },
|
|
95
|
-
{ filePath: path.join('.zed', 'settings.json'), type: 'local' }
|
|
96
|
-
],
|
|
97
|
-
gemini: [
|
|
98
|
-
{ filePath: path.join(homeDir, '.gemini', 'settings.json'), type: 'global' },
|
|
99
|
-
{ filePath: path.join('.gemini', 'settings.json'), type: 'local' }
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|