@danainnovations/cortex-mcp 1.0.80 → 1.0.82

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/index.js CHANGED
@@ -1129,6 +1129,33 @@ function getWindowsHomeFromWSL() {
1129
1129
  }
1130
1130
  return null;
1131
1131
  }
1132
+ function getStoreClaudePath() {
1133
+ try {
1134
+ const localAppData = process.env.LOCALAPPDATA || join2(homedir(), "AppData", "Local");
1135
+ const packagesDir = join2(localAppData, "Packages");
1136
+ const dirs = readdirSync2(packagesDir).filter((d) => d.startsWith("Claude_"));
1137
+ if (dirs.length > 0) {
1138
+ return join2(
1139
+ packagesDir,
1140
+ dirs[0],
1141
+ "LocalCache",
1142
+ "Roaming",
1143
+ "Claude",
1144
+ "claude_desktop_config.json"
1145
+ );
1146
+ }
1147
+ } catch {
1148
+ }
1149
+ return null;
1150
+ }
1151
+ function getStandardClaudeDesktopPath() {
1152
+ const home = homedir();
1153
+ return join2(
1154
+ process.env.APPDATA || join2(home, "AppData", "Roaming"),
1155
+ "Claude",
1156
+ "claude_desktop_config.json"
1157
+ );
1158
+ }
1132
1159
  function getClaudeDesktopConfigPath() {
1133
1160
  const home = getHomeDir();
1134
1161
  const p = getPlatform();
@@ -1147,12 +1174,11 @@ function getClaudeDesktopConfigPath() {
1147
1174
  "Claude",
1148
1175
  "claude_desktop_config.json"
1149
1176
  );
1150
- case "windows":
1151
- return join2(
1152
- process.env.APPDATA || join2(home, "AppData", "Roaming"),
1153
- "Claude",
1154
- "claude_desktop_config.json"
1155
- );
1177
+ case "windows": {
1178
+ const storePath = getStoreClaudePath();
1179
+ if (storePath) return storePath;
1180
+ return getStandardClaudeDesktopPath();
1181
+ }
1156
1182
  case "linux":
1157
1183
  return join2(home, ".config", "Claude", "claude_desktop_config.json");
1158
1184
  }
@@ -1338,6 +1364,36 @@ function configureClaudeDesktop(_serverUrl, apiKey, _mcps) {
1338
1364
  }
1339
1365
  servers["cortex"] = cortexEntry;
1340
1366
  writeFileSync3(configPath, JSON.stringify(config, null, 2) + "\n");
1367
+ if (getPlatform() === "windows") {
1368
+ const storePath = getStoreClaudePath();
1369
+ const standardPath = getStandardClaudeDesktopPath();
1370
+ const altPath = configPath === storePath ? standardPath : storePath;
1371
+ if (altPath && altPath !== configPath) {
1372
+ try {
1373
+ const altDir = dirname2(altPath);
1374
+ if (!existsSync3(altDir)) {
1375
+ mkdirSync3(altDir, { recursive: true });
1376
+ }
1377
+ let altConfig = {};
1378
+ if (existsSync3(altPath)) {
1379
+ try {
1380
+ altConfig = JSON.parse(readFileSync5(altPath, "utf-8"));
1381
+ } catch {
1382
+ }
1383
+ }
1384
+ if (!altConfig.mcpServers || typeof altConfig.mcpServers !== "object") {
1385
+ altConfig.mcpServers = {};
1386
+ }
1387
+ const altServers = altConfig.mcpServers;
1388
+ for (const key of Object.keys(altServers)) {
1389
+ if (key.startsWith("cortex-") || key === "cortex") delete altServers[key];
1390
+ }
1391
+ altServers["cortex"] = cortexEntry;
1392
+ writeFileSync3(altPath, JSON.stringify(altConfig, null, 2) + "\n");
1393
+ } catch {
1394
+ }
1395
+ }
1396
+ }
1341
1397
  if (isWindowsTarget) {
1342
1398
  const start = Date.now();
1343
1399
  while (Date.now() - start < 500) {