@danainnovations/cortex-mcp 1.0.92 → 1.0.94

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/cli.js CHANGED
@@ -858,6 +858,7 @@ function getWizardHtml() {
858
858
  selectedClients: [],
859
859
  configuredClients: [],
860
860
  connections: [],
861
+ serverUrl: '',
861
862
  };
862
863
 
863
864
  // \u2500\u2500 Step Index Map \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
@@ -890,6 +891,7 @@ function getWizardHtml() {
890
891
  vscode: '<svg viewBox="0 0 16 16"><path d="M11.5 1L5 7l-3-2.5L1 5l3.5 3L1 11l1 .5L5 9l6.5 6 2.5-1V2z"/></svg>',
891
892
  antigravity: '<svg viewBox="0 0 16 16"><path d="M8 1l2 5h5l-4 3 1.5 5L8 11l-4.5 3L5 9 1 6h5z"/></svg>',
892
893
  codex: '<svg viewBox="0 0 16 16"><circle cx="8" cy="8" r="3" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M8 1v3M8 12v3M1 8h3M12 8h3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',
894
+ 'claude-ai': '<svg viewBox="0 0 16 16"><path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 1.2a5.8 5.8 0 110 11.6A5.8 5.8 0 018 2.2z"/><path d="M2.5 8h11M8 2.5c-1.8 2-2.7 3.5-2.7 5.5S6.2 12 8 13.5c1.8-1.5 2.7-3.5 2.7-5.5S9.8 4.5 8 2.5z" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"/></svg>',
893
895
  perplexity: '<svg viewBox="0 0 16 16"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M8 2v12M2 8h12M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1" stroke-linecap="round"/></svg>',
894
896
  stdio: '<svg viewBox="0 0 16 16"><path d="M2 3h12a1 1 0 011 1v8a1 1 0 01-1 1H2a1 1 0 01-1-1V4a1 1 0 011-1zm1 2v6h10V5H3z"/></svg>',
895
897
  };
@@ -902,12 +904,14 @@ function getWizardHtml() {
902
904
  state.credentials = data.credentials;
903
905
  state.availableMcps = data.availableMcps || [];
904
906
  state.enabledMcps = data.enabledMcps || ['m365'];
905
- if (state.enabledMcps.indexOf('sonance_brand') === -1) {
906
- state.enabledMcps.push('sonance_brand');
907
- }
907
+ // Ensure all company MCPs are always enabled (API fallback may miss them)
908
+ ['github', 'vercel', 'supabase', 'databricks', 'bestbuy', 'feedback', 'sonance_brand'].forEach(function(name) {
909
+ if (state.enabledMcps.indexOf(name) === -1) state.enabledMcps.push(name);
910
+ });
908
911
  state.selectedMcps = state.enabledMcps.slice();
909
912
  state.detectedClients = data.detectedClients || [];
910
913
  state.configuredClients = (data.config && data.config.configuredClients) || [];
914
+ state.serverUrl = data.serverUrl || '';
911
915
  } catch (err) {
912
916
  console.error('Failed to load state:', err);
913
917
  }
@@ -1078,10 +1082,10 @@ function getWizardHtml() {
1078
1082
  function renderMcpList(container) {
1079
1083
  var enabledList = (state.enabledMcps && state.enabledMcps.length > 0)
1080
1084
  ? state.enabledMcps : ['m365'];
1081
- // Sonance Brand is always enabled for all users
1082
- if (enabledList.indexOf('sonance_brand') === -1) {
1083
- enabledList.push('sonance_brand');
1084
- }
1085
+ // Ensure all company MCPs are always enabled
1086
+ ['github', 'vercel', 'supabase', 'databricks', 'bestbuy', 'feedback', 'sonance_brand'].forEach(function(name) {
1087
+ if (enabledList.indexOf(name) === -1) enabledList.push(name);
1088
+ });
1085
1089
  var enabledMcps = state.availableMcps.filter(function(m) { return enabledList.indexOf(m.name) !== -1; });
1086
1090
  var disabledMcps = state.availableMcps.filter(function(m) { return enabledList.indexOf(m.name) === -1; });
1087
1091
 
@@ -1147,9 +1151,9 @@ function getWizardHtml() {
1147
1151
 
1148
1152
  if (userData.mcps && userData.mcps.length > 0) {
1149
1153
  state.enabledMcps = userData.mcps.map(function(m) { return m.name; });
1150
- if (state.enabledMcps.indexOf('sonance_brand') === -1) {
1151
- state.enabledMcps.push('sonance_brand');
1152
- }
1154
+ ['github', 'vercel', 'supabase', 'databricks', 'bestbuy', 'feedback', 'sonance_brand'].forEach(function(name) {
1155
+ if (state.enabledMcps.indexOf(name) === -1) state.enabledMcps.push(name);
1156
+ });
1153
1157
  state.selectedMcps = state.enabledMcps.slice();
1154
1158
  }
1155
1159
  state.connections = connData.connections || [];
@@ -1199,7 +1203,7 @@ function getWizardHtml() {
1199
1203
  function renderClientItem(client) {
1200
1204
  var detected = client.detected;
1201
1205
  var icon = CLIENT_ICONS[client.type] || '';
1202
- var isManual = client.type === 'perplexity' || client.type === 'stdio';
1206
+ var isManual = client.type === 'perplexity' || client.type === 'stdio' || client.type === 'claude-ai';
1203
1207
  var alreadyConfigured = !isManual && state.configuredClients.indexOf(client.type) !== -1;
1204
1208
  var statusText = alreadyConfigured ? 'Configured' : (detected ? 'Detected' : 'Not found');
1205
1209
  return (
@@ -1220,14 +1224,17 @@ function getWizardHtml() {
1220
1224
  document.getElementById('btn-configure').textContent = 'Configure';
1221
1225
 
1222
1226
  // Pre-select already-configured clients (exclude manual/additional ones)
1223
- var manualClientTypes = ['perplexity', 'stdio'];
1227
+ var nonAutoTypes = ['perplexity', 'stdio', 'claude-ai'];
1224
1228
  state.selectedClients = state.configuredClients.filter(function(c) {
1225
- return manualClientTypes.indexOf(c) === -1;
1229
+ return nonAutoTypes.indexOf(c) === -1;
1226
1230
  });
1227
1231
 
1228
- // Split into auto-configured and manual-setup clients
1232
+ // Split into auto-configured, web/mobile, and manual-setup clients
1229
1233
  var autoClients = state.detectedClients.filter(function(c) {
1230
- return c.type !== 'perplexity' && c.type !== 'stdio';
1234
+ return c.type !== 'perplexity' && c.type !== 'stdio' && c.type !== 'claude-ai';
1235
+ });
1236
+ var webClients = state.detectedClients.filter(function(c) {
1237
+ return c.type === 'claude-ai';
1231
1238
  });
1232
1239
  var manualClients = state.detectedClients.filter(function(c) {
1233
1240
  return c.type === 'perplexity' || c.type === 'stdio';
@@ -1235,6 +1242,14 @@ function getWizardHtml() {
1235
1242
 
1236
1243
  var html = autoClients.map(renderClientItem).join('');
1237
1244
 
1245
+ if (webClients.length > 0) {
1246
+ html += '<div class="client-section-divider">' +
1247
+ '<div class="client-section-title">Web & Mobile</div>' +
1248
+ '<div class="client-section-subtitle">Use Cortex tools on claude.ai and the Claude mobile app</div>' +
1249
+ '</div>';
1250
+ html += webClients.map(renderClientItem).join('');
1251
+ }
1252
+
1238
1253
  if (manualClients.length > 0) {
1239
1254
  html += '<div class="client-section-divider">' +
1240
1255
  '<div class="client-section-title">Additional Clients</div>' +
@@ -1245,9 +1260,9 @@ function getWizardHtml() {
1245
1260
 
1246
1261
  el.innerHTML = html;
1247
1262
 
1248
- var manualTypes = ['perplexity', 'stdio'];
1263
+ var manualTypes = ['perplexity', 'stdio', 'claude-ai'];
1249
1264
  el.querySelectorAll('.client-item:not(.disabled):not(.already-configured)').forEach(function(item) {
1250
- // Auto-select detected clients, but NOT manual/additional ones (Perplexity, OpenClaw)
1265
+ // Auto-select detected clients, but NOT manual/additional/web ones
1251
1266
  if (manualTypes.indexOf(item.dataset.client) === -1) {
1252
1267
  item.classList.add('checked');
1253
1268
  }
@@ -1313,6 +1328,22 @@ function getWizardHtml() {
1313
1328
  '<span>' + (r.success ? '&#10003;' : '&#10007;') + '</span>' +
1314
1329
  '<span>' + (r.success ? escapeHtml(r.message || 'Configured') : escapeHtml(r.client) + ': ' + (r.error || 'Failed')) + '</span>' +
1315
1330
  '</div>';
1331
+ // Show Claude.ai instructions with copyable URL
1332
+ if (r.client === 'claude-ai' && r.success && r.message) {
1333
+ var mcpUrl = (state.serverUrl || 'https://cortex-bice.vercel.app') + '/mcp/cortex';
1334
+ html += '<div class="stdio-snippet" style="text-align: left;">' +
1335
+ '<ol style="margin: 0 0 12px 0; padding-left: 20px; line-height: 1.8;">' +
1336
+ '<li>Open <a href="https://claude.ai/settings/integrations" target="_blank" style="color: #00A3E1;">claude.ai/settings/integrations</a></li>' +
1337
+ '<li>Click <strong>Add custom integration</strong></li>' +
1338
+ '<li>Paste this URL and click Add:</li>' +
1339
+ '</ol>' +
1340
+ '<div style="display: flex; align-items: center; gap: 8px; background: rgba(0,163,225,0.08); border: 1px solid rgba(0,163,225,0.2); border-radius: 6px; padding: 8px 12px;">' +
1341
+ '<code style="flex: 1; font-size: 12px; word-break: break-all;">' + escapeHtml(mcpUrl) + '</code>' +
1342
+ '<button class="copy-btn" onclick="copySnippet(this)">Copy</button>' +
1343
+ '</div>' +
1344
+ '<p style="margin: 10px 0 0 0; font-size: 12px; opacity: 0.7;">Claude handles SSO authentication automatically. Tools sync to mobile.</p>' +
1345
+ '</div>';
1346
+ }
1316
1347
  // Show copyable snippet for stdio/OpenClaw and Perplexity instructions
1317
1348
  if ((r.client === 'stdio' || r.client === 'perplexity') && r.success && r.message) {
1318
1349
  var snippet = r.message.replace(/^Add this to your client config:\\n\\n/, '');
@@ -1645,6 +1676,12 @@ function detectClients() {
1645
1676
  configPath: null,
1646
1677
  detected: getPlatform() === "macos" && existsSync(perplexityDir)
1647
1678
  });
1679
+ clients.push({
1680
+ type: "claude-ai",
1681
+ name: "Claude.ai & Mobile",
1682
+ configPath: null,
1683
+ detected: true
1684
+ });
1648
1685
  clients.push({
1649
1686
  type: "stdio",
1650
1687
  name: "OpenClaw",
@@ -1905,6 +1942,10 @@ function configurePerplexity(serverUrl, _apiKey, mcps) {
1905
1942
  }
1906
1943
  return lines.join("\n");
1907
1944
  }
1945
+ function configureClaudeAi(serverUrl, _apiKey, _mcps) {
1946
+ const url = `${serverUrl}/mcp/cortex`;
1947
+ return 'Add Cortex to Claude.ai & Mobile:\n\n1. Open claude.ai/settings/integrations\n2. Click "Add custom integration"\n3. Paste this URL: ' + url + "\n4. Click Add \u2014 Claude handles SSO authentication automatically\n\nOnce added, Cortex tools are available on claude.ai, Claude Desktop (web), and the Claude mobile app.";
1948
+ }
1908
1949
  function generateStdioSnippet(_apiKey) {
1909
1950
  const isWindowsTarget = getPlatform() === "windows" || isWSL();
1910
1951
  const config = {
@@ -2020,6 +2061,8 @@ function configureClient(clientType, serverUrl, apiKey, mcps) {
2020
2061
  return "Codex configured";
2021
2062
  case "perplexity":
2022
2063
  return configurePerplexity(serverUrl, apiKey, mcps);
2064
+ case "claude-ai":
2065
+ return configureClaudeAi(serverUrl, apiKey, mcps);
2023
2066
  case "stdio":
2024
2067
  return "Add this to your client config:\n\n" + generateStdioSnippet(apiKey);
2025
2068
  }
@@ -2163,7 +2206,8 @@ async function handleApiRoute(path, searchParams, req, res, options, onComplete)
2163
2206
  description: m.description,
2164
2207
  authMode: m.authMode
2165
2208
  })),
2166
- detectedClients: clients
2209
+ detectedClients: clients,
2210
+ serverUrl: options.serverUrl
2167
2211
  });
2168
2212
  return true;
2169
2213
  }