ls-mcp 1.13.2 → 1.14.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.
@@ -1,213 +0,0 @@
1
- import path from 'node:path'
2
- import { type MCPAppPathsRecord, type MCPFilePath } from '../types/mcp-config-service.types.js'
3
-
4
- export class MCPPathRegistry {
5
- private static readonly WINDOWS_PATHS: MCPAppPathsRecord = {
6
- claude: [
7
- { filePath: path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json'), type: 'global' }
8
- ],
9
- claude_code: [
10
- { filePath: '.mcp.json', type: 'local' }
11
- ],
12
- cursor: [
13
- { filePath: path.join(process.env.HOME || '', '.cursor', 'mcp.json'), type: 'global' },
14
- { filePath: path.join('.cursor', 'mcp.json'), type: 'local' }
15
- ],
16
- vscode: [
17
- { filePath: path.join('.vscode', 'mcp.json'), type: 'local' },
18
- { filePath: path.join(process.env.APPDATA || '', 'Code', 'User', 'settings.json'), type: 'global' },
19
- { filePath: path.join(process.env.APPDATA || '', 'Code - Insiders', 'User', 'settings.json'), type: 'global' },
20
- { filePath: path.join(process.env.APPDATA || '', 'Code', 'User', 'mcp.json'), type: 'global' },
21
- { filePath: path.join(process.env.APPDATA || '', 'Code - Insiders', 'User', 'mcp.json'), type: 'global' }
22
- ],
23
- cline: [
24
- { filePath: path.join(process.env.APPDATA || '', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' },
25
- { filePath: path.join(process.env.APPDATA || '', 'Code - Insiders', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' }
26
- ],
27
- windsurf: [
28
- { filePath: path.join('.codeium', 'windsurf', 'mcp_config.json'), type: 'local' }
29
- ],
30
- roo: [
31
- { filePath: path.join(process.env.APPDATA || '', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' },
32
- { filePath: path.join(process.env.APPDATA || '', 'Code - Insiders', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' }
33
- ],
34
- 'intellij-github-copilot': [
35
- { filePath: path.join(process.env.LOCALAPPDATA || '', 'github-copilot', 'intellij', 'mcp.json'), type: 'global' }
36
- ],
37
- junie: [
38
- { filePath: path.join(process.env.HOME || '', '.junie', 'mcp', 'mcp.json'), type: 'global' }
39
- ],
40
- zed: [
41
- { filePath: path.join(process.env.LOCALAPPDATA || '', 'zed', 'settings.json'), type: 'global' },
42
- { filePath: path.join('.zed', 'settings.json'), type: 'local' }
43
- ],
44
- gemini: [
45
- { filePath: path.join(process.env.HOME || '', '.gemini', 'settings.json'), type: 'global' },
46
- { filePath: path.join('.gemini', 'settings.json'), type: 'local' }
47
- ]
48
- }
49
-
50
- private static readonly DARWIN_PATHS: MCPAppPathsRecord = {
51
- claude: [
52
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'), type: 'global' }
53
- ],
54
- claude_code: [
55
- { filePath: '.mcp.json', type: 'local' }
56
- ],
57
- cursor: [
58
- { filePath: path.join(process.env.HOME || '', '.cursor', 'mcp.json'), type: 'global' },
59
- { filePath: path.join('.cursor', 'mcp.json'), type: 'local' }
60
- ],
61
- vscode: [
62
- { filePath: path.join('.vscode', 'mcp.json'), type: 'local' },
63
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code', 'User', 'settings.json'), type: 'global' },
64
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code', 'User', 'mcp.json'), type: 'global' },
65
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code - Insiders', 'User', 'settings.json'), type: 'global' },
66
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code - Insiders', 'User', 'mcp.json'), type: 'global' }
67
- ],
68
- cline: [
69
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' },
70
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code - Insiders', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' }
71
- ],
72
- windsurf: [
73
- { filePath: path.join('.codeium', 'windsurf', 'mcp_config.json'), type: 'local' }
74
- ],
75
- roo: [
76
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' },
77
- { filePath: path.join(process.env.HOME || '', 'Library', 'Application Support', 'Code - Insiders', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' }
78
- ],
79
- 'intellij-github-copilot': [
80
- { filePath: path.join(process.env.HOME || '', '.config', 'github-copilot', 'intellij', 'mcp.json'), type: 'global' }
81
- ],
82
- junie: [
83
- { filePath: path.join(process.env.HOME || '', '.junie', 'mcp', 'mcp.json'), type: 'global' },
84
- { filePath: path.join('.junie', 'mcp', 'mcp.json'), type: 'local' }
85
- ],
86
- zed: [
87
- { filePath: path.join(process.env.HOME || '', '.config', 'zed', 'settings.json'), type: 'global' },
88
- { filePath: path.join('.zed', 'settings.json'), type: 'local' }
89
- ],
90
- gemini: [
91
- { filePath: path.join(process.env.HOME || '', '.gemini', 'settings.json'), type: 'global' },
92
- { filePath: path.join('.gemini', 'settings.json'), type: 'local' }
93
- ]
94
- }
95
-
96
- private static readonly LINUX_PATHS: MCPAppPathsRecord = {
97
- claude: [
98
- { filePath: path.join(process.env.HOME || '', '.config', 'Claude', 'claude_desktop_config.json'), type: 'global' }
99
- ],
100
- claude_code: [
101
- { filePath: '.mcp.json', type: 'local' }
102
- ],
103
- cursor: [
104
- { filePath: path.join(process.env.HOME || '', '.cursor', 'mcp.json'), type: 'global' },
105
- { filePath: path.join('.cursor', 'mcp.json'), type: 'local' }
106
- ],
107
- vscode: [
108
- { filePath: path.join('.vscode', 'mcp.json'), type: 'local' },
109
- { filePath: path.join(process.env.HOME || '', '.config', 'Code', 'User', 'settings.json'), type: 'global' },
110
- { filePath: path.join(process.env.HOME || '', '.config', 'Code - Insiders', 'User', 'settings.json'), type: 'global' },
111
- { filePath: path.join(process.env.HOME || '', '.config', 'Code', 'User', 'mcp.json'), type: 'global' },
112
- { filePath: path.join(process.env.HOME || '', '.config', 'Code - Insiders', 'User', 'mcp.json'), type: 'global' },
113
- { filePath: path.join(process.env.HOME || '', '.mcp.json'), type: 'global' }
114
- ],
115
- cline: [
116
- { filePath: path.join(process.env.HOME || '', '.config', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' },
117
- { filePath: path.join(process.env.HOME || '', '.config', 'Code - Insiders', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'), type: 'global' }
118
- ],
119
- windsurf: [
120
- { filePath: path.join('.codeium', 'windsurf', 'mcp_config.json'), type: 'local' }
121
- ],
122
- roo: [
123
- { filePath: path.join(process.env.HOME || '', '.config', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' },
124
- { filePath: path.join(process.env.HOME || '', '.config', 'Code - Insiders', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json'), type: 'global' }
125
- ],
126
- 'intellij-github-copilot': [
127
- { filePath: path.join(process.env.HOME || '', '.config', 'github-copilot', 'intellij', 'mcp.json'), type: 'global' }
128
- ],
129
- junie: [
130
- { filePath: path.join(process.env.HOME || '', '.junie', 'mcp.json'), type: 'global' },
131
- { filePath: path.join('.junie', 'mcp', 'mcp.json'), type: 'local' }
132
- ],
133
- zed: [
134
- { filePath: path.join(process.env.HOME || '', '.config', 'zed', 'settings.json'), type: 'global' },
135
- { filePath: path.join('.zed', 'settings.json'), type: 'local' }
136
- ],
137
- gemini: [
138
- { filePath: path.join(process.env.HOME || '', '.gemini', 'settings.json'), type: 'global' },
139
- { filePath: path.join('.gemini', 'settings.json'), type: 'local' }
140
- ]
141
- }
142
-
143
- private customApps: Map<string, MCPAppPathsRecord> = new Map()
144
-
145
- /**
146
- * Get all MCP configuration file paths for a specific operating system
147
- */
148
- getPathsForOS (os: string): MCPAppPathsRecord {
149
- switch (os.toLowerCase()) {
150
- case 'win32':
151
- case 'windows':
152
- return { ...MCPPathRegistry.WINDOWS_PATHS }
153
- case 'darwin':
154
- case 'macos':
155
- return { ...MCPPathRegistry.DARWIN_PATHS }
156
- case 'linux':
157
- return { ...MCPPathRegistry.LINUX_PATHS }
158
- default:
159
- throw new Error(`Unsupported operating system: ${os}`)
160
- }
161
- }
162
-
163
- /**
164
- * Get MCP configuration file paths for a specific app on a specific OS
165
- */
166
- getPathsForApp (os: string, appName: string): MCPFilePath[] {
167
- const osPaths = this.getPathsForOS(os)
168
- const appPaths = osPaths[appName]
169
-
170
- if (!appPaths) {
171
- throw new Error(`App '${appName}' not found for OS '${os}'`)
172
- }
173
-
174
- return [...appPaths]
175
- }
176
-
177
- /**
178
- * Get all supported app names for a specific OS
179
- */
180
- getSupportedApps (os: string): string[] {
181
- const osPaths = this.getPathsForOS(os)
182
- return Object.keys(osPaths)
183
- }
184
-
185
- /**
186
- * Get all supported operating systems
187
- */
188
- getSupportedOperatingSystems (): string[] {
189
- return ['win32', 'darwin', 'linux']
190
- }
191
-
192
- /**
193
- * Register a custom app with custom paths for a specific OS
194
- */
195
- registerCustomApp (os: string, appName: string, paths: MCPFilePath[]): void {
196
- if (!this.customApps.has(os)) {
197
- this.customApps.set(os, {})
198
- }
199
-
200
- const osCustomApps = this.customApps.get(os)!
201
- osCustomApps[appName] = [...paths]
202
- }
203
-
204
- /**
205
- * Get paths including custom registered apps
206
- */
207
- getPathsForOSWithCustom (os: string): MCPAppPathsRecord {
208
- const basePaths = this.getPathsForOS(os)
209
- const customPaths = this.customApps.get(os) || {}
210
-
211
- return { ...basePaths, ...customPaths }
212
- }
213
- }