ls-mcp 1.8.2 → 1.9.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 +125 -81
- package/dist/bin/cli.mjs +125 -81
- package/dist/main.cjs +125 -81
- package/dist/main.d.cts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.mjs +125 -81
- package/package.json +19 -2
- package/src/main.ts +15 -115
- package/src/services/mcp-config-linter-service.ts +6 -2
- package/src/services/mcp-server-manager-service.ts +4 -1
- package/src/types.ts +38 -0
- package/src/utils/os-paths.ts +102 -0
package/src/main.ts
CHANGED
|
@@ -3,125 +3,15 @@ import { platform } from 'node:os'
|
|
|
3
3
|
import path from 'node:path'
|
|
4
4
|
import { MCPConfigLinterService } from './services/mcp-config-linter-service.ts'
|
|
5
5
|
import { MCPServerManagerService } from './services/mcp-server-manager-service.ts'
|
|
6
|
+
import { getWindowsPaths, getDarwinPaths } from './utils/os-paths.ts'
|
|
7
|
+
import { type MCPServerInfo, type MCPFilePath, type MCPFilePathGroupsRecord, type MCPFileGroupsResultRecord } from './types.ts'
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
name: string
|
|
9
|
-
command: string
|
|
10
|
-
args?: string[]
|
|
11
|
-
transport?: 'stdio' | 'sse' | 'http',
|
|
12
|
-
type?: 'sse' | 'http' | 'stdio'
|
|
13
|
-
source?: string
|
|
14
|
-
env?: Record<string, string>
|
|
15
|
-
status?: 'running' | 'stopped'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface MCPFilePath {
|
|
19
|
-
filePath: string
|
|
20
|
-
type: 'local' | 'global'
|
|
21
|
-
parsable?: boolean
|
|
22
|
-
servers?: MCPServerInfo[]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface MCPFileGroups {
|
|
26
|
-
name: string
|
|
27
|
-
friendlyName: string
|
|
28
|
-
paths: MCPFilePath[]
|
|
29
|
-
stats?: {
|
|
30
|
-
serversCount?: number
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface MCPFileGroupsResult {
|
|
35
|
-
name: string
|
|
36
|
-
friendlyName: string
|
|
37
|
-
paths: MCPFilePath[]
|
|
38
|
-
stats: {
|
|
39
|
-
serversCount?: number
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type MCPFilePathGroupsRecord = Record<string, MCPFileGroups>
|
|
44
|
-
type MCPFileGroupsResultRecord = Record<string, MCPFileGroupsResult>
|
|
45
|
-
|
|
46
|
-
const osSpecificPaths: { [key: string]: MCPFilePath[] } = {
|
|
47
|
-
claude: [],
|
|
48
|
-
claude_code: [],
|
|
49
|
-
cursor: [],
|
|
50
|
-
vscode: [],
|
|
51
|
-
cline: [],
|
|
52
|
-
windsurf: [],
|
|
53
|
-
roo: [],
|
|
54
|
-
'intellij-github-copilot': []
|
|
55
|
-
}
|
|
9
|
+
let osSpecificPaths: { [key: string]: MCPFilePath[] } = {}
|
|
56
10
|
|
|
57
11
|
if (platform() === 'win32') {
|
|
58
|
-
osSpecificPaths
|
|
59
|
-
{ filePath: `${process.env.APPDATA}\\Claude\\claude_desktop_config.json`, type: 'global' }
|
|
60
|
-
]
|
|
61
|
-
osSpecificPaths['claude_code'] = [
|
|
62
|
-
{ filePath: '.mcp.json', type: 'local' }
|
|
63
|
-
]
|
|
64
|
-
osSpecificPaths['cursor'] = [
|
|
65
|
-
{ filePath: `${process.env.HOME}\\.cursor\\mcp.json`, type: 'global' },
|
|
66
|
-
{ filePath: '.cursor\\mcp.json', type: 'local' }
|
|
67
|
-
]
|
|
68
|
-
osSpecificPaths['vscode'] = [
|
|
69
|
-
{ filePath: '.vscode\\mcp.json', type: 'local' },
|
|
70
|
-
{ filePath: `${process.env.APPDATA}\\Code\\User\\settings.json`, type: 'global' },
|
|
71
|
-
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\settings.json`, type: 'global' },
|
|
72
|
-
]
|
|
73
|
-
osSpecificPaths['cline'] = [
|
|
74
|
-
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: 'global' },
|
|
75
|
-
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json`, type: 'global' }
|
|
76
|
-
]
|
|
77
|
-
osSpecificPaths['windsurf'] = [
|
|
78
|
-
{ filePath: '.codeium\\windsurf\\mcp_config.json', type: 'local' },
|
|
79
|
-
]
|
|
80
|
-
osSpecificPaths['roo'] = [
|
|
81
|
-
{ filePath: `${process.env.APPDATA}\\Code\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: 'global' },
|
|
82
|
-
{ filePath: `${process.env.APPDATA}\\Code - Insiders\\User\\globalStorage\\rooveterinaryinc.roo-cline\\settings\\cline_mcp_settings.json`, type: 'global' },
|
|
83
|
-
]
|
|
84
|
-
osSpecificPaths['intellij-github-copilot'] = [
|
|
85
|
-
{ filePath: `${process.env.LOCALAPPDATA}\\github-copilot\\intellij\\mcp.json`, type: 'global' },
|
|
86
|
-
]
|
|
87
|
-
osSpecificPaths['zed'] = [
|
|
88
|
-
{ filePath: `${process.env.LOCALAPPDATA}\\zed\\settings.json`, type: 'global' },
|
|
89
|
-
{ filePath: '.zed\\settings.json', type: 'local' }
|
|
90
|
-
]
|
|
12
|
+
osSpecificPaths = getWindowsPaths()
|
|
91
13
|
} else {
|
|
92
|
-
osSpecificPaths
|
|
93
|
-
{ filePath: '~/Library/Application Support/Claude/claude_desktop_config.json', type: 'global' }
|
|
94
|
-
]
|
|
95
|
-
osSpecificPaths['claude_code'] = [
|
|
96
|
-
{ filePath: '.mcp.json', type: 'local' }
|
|
97
|
-
]
|
|
98
|
-
osSpecificPaths['cursor'] = [
|
|
99
|
-
{ filePath: '~/.cursor/mcp.json', type: 'global' },
|
|
100
|
-
{ filePath: '.cursor/mcp.json', type: 'local' }
|
|
101
|
-
]
|
|
102
|
-
osSpecificPaths['vscode'] = [
|
|
103
|
-
{ filePath: '.vscode/mcp.json', type: 'local' },
|
|
104
|
-
{ filePath: '~/Library/Application Support/Code/User/settings.json', type: 'global' },
|
|
105
|
-
{ filePath: '~/Library/Application Support/Code - Insiders/User/settings.json', type: 'global' },
|
|
106
|
-
]
|
|
107
|
-
osSpecificPaths['cline'] = [
|
|
108
|
-
{ filePath: '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', type: 'global' },
|
|
109
|
-
{ filePath: '~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', type: 'global' }
|
|
110
|
-
]
|
|
111
|
-
osSpecificPaths['windsurf'] = [
|
|
112
|
-
{ filePath: '.codeium/windsurf/mcp_config.json', type: 'local' },
|
|
113
|
-
]
|
|
114
|
-
osSpecificPaths['roo'] = [
|
|
115
|
-
{ filePath: '~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json', type: 'global' },
|
|
116
|
-
{ filePath: '~/Library/Application Support/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json', type: 'global' },
|
|
117
|
-
]
|
|
118
|
-
osSpecificPaths['intellij-github-copilot'] = [
|
|
119
|
-
{ filePath: '~/.config/github-copilot/intellij/mcp.json', type: 'global' },
|
|
120
|
-
]
|
|
121
|
-
osSpecificPaths['zed'] = [
|
|
122
|
-
{ filePath: '~/.config/zed/settings.json', type: 'global' },
|
|
123
|
-
{ filePath: '.zed/settings.json', type: 'local' }
|
|
124
|
-
]
|
|
14
|
+
osSpecificPaths = getDarwinPaths()
|
|
125
15
|
}
|
|
126
16
|
|
|
127
17
|
export class MCPFiles {
|
|
@@ -166,10 +56,20 @@ export class MCPFiles {
|
|
|
166
56
|
friendlyName: 'IntelliJ GitHub Copilot',
|
|
167
57
|
paths: osSpecificPaths['intellij-github-copilot']
|
|
168
58
|
},
|
|
59
|
+
junie: {
|
|
60
|
+
name: 'junie',
|
|
61
|
+
friendlyName: 'IntelliJ Junie',
|
|
62
|
+
paths: osSpecificPaths['junie']
|
|
63
|
+
},
|
|
169
64
|
zed: {
|
|
170
65
|
name: 'zed',
|
|
171
66
|
friendlyName: 'Zed',
|
|
172
67
|
paths: osSpecificPaths['zed']
|
|
68
|
+
},
|
|
69
|
+
gemini: {
|
|
70
|
+
name: 'gemini-cli',
|
|
71
|
+
friendlyName: 'Gemini CLI',
|
|
72
|
+
paths: osSpecificPaths.gemini
|
|
173
73
|
}
|
|
174
74
|
}
|
|
175
75
|
|
|
@@ -51,8 +51,12 @@ export class MCPConfigLinterService {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
async countMCPServers (): Promise<number> {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
try {
|
|
55
|
+
const mcpServers = await this.getMCPServers()
|
|
56
|
+
return Object.keys(mcpServers).length
|
|
57
|
+
} catch (error) {
|
|
58
|
+
return 0
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
async getMCPServers (): Promise<Record<string, object>> {
|
|
@@ -47,8 +47,11 @@ export class MCPServerManagerService {
|
|
|
47
47
|
|
|
48
48
|
if (serverConfig.url) {
|
|
49
49
|
this.source = serverConfig.url
|
|
50
|
+
this.transport = 'http' // URLs always use http transport
|
|
50
51
|
} else {
|
|
51
|
-
|
|
52
|
+
// Build the full command with arguments
|
|
53
|
+
const fullCommand = [serverConfig.command, ...(serverConfig.args || [])].join(' ')
|
|
54
|
+
this.source = fullCommand
|
|
52
55
|
}
|
|
53
56
|
this.env = serverConfig.env || {}
|
|
54
57
|
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface MCPServerInfo {
|
|
2
|
+
name: string
|
|
3
|
+
command: string
|
|
4
|
+
args?: string[]
|
|
5
|
+
transport?: 'stdio' | 'sse' | 'http',
|
|
6
|
+
type?: 'sse' | 'http' | 'stdio'
|
|
7
|
+
source?: string
|
|
8
|
+
env?: Record<string, string>
|
|
9
|
+
status?: 'running' | 'stopped'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MCPFilePath {
|
|
13
|
+
filePath: string
|
|
14
|
+
type: 'local' | 'global'
|
|
15
|
+
parsable?: boolean
|
|
16
|
+
servers?: MCPServerInfo[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface MCPFileGroups {
|
|
20
|
+
name: string
|
|
21
|
+
friendlyName: string
|
|
22
|
+
paths: MCPFilePath[]
|
|
23
|
+
stats?: {
|
|
24
|
+
serversCount?: number
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface MCPFileGroupsResult {
|
|
29
|
+
name: string
|
|
30
|
+
friendlyName: string
|
|
31
|
+
paths: MCPFilePath[]
|
|
32
|
+
stats: {
|
|
33
|
+
serversCount?: number
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type MCPFilePathGroupsRecord = Record<string, MCPFileGroups>
|
|
38
|
+
export type MCPFileGroupsResultRecord = Record<string, MCPFileGroupsResult>
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
}
|