Skip to content

Commit 6fdeea4

Browse files
authored
fix: user correct settings location (#82)
1 parent c033fd1 commit 6fdeea4

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/commands/configureMCP.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,23 @@ function getCorrectMcpConfig(): {
201201
configAccessor: 'mcpServers',
202202
}
203203

204+
// Get platform-specific VS Code settings directory
205+
let vsCodeSettingsPath: string
206+
207+
switch (process.platform) {
208+
case 'darwin': // macOS
209+
vsCodeSettingsPath = path.join(os.homedir(), 'Library', 'Application Support', 'Code', 'User')
210+
break
211+
case 'win32': // Windows
212+
vsCodeSettingsPath = path.join(os.homedir(), 'AppData', 'Roaming', 'Code', 'User')
213+
break
214+
default: // Linux and others
215+
vsCodeSettingsPath = path.join(os.homedir(), '.config', 'Code', 'User')
216+
break
217+
}
218+
204219
return {
205-
fileDir: path.join(os.homedir(), 'Library', 'Application Support', 'Code', 'User'),
220+
fileDir: vsCodeSettingsPath,
206221
fileName: 'settings.json',
207222
configAccessor: 'mcp.servers',
208223
}

0 commit comments

Comments
 (0)