@danainnovations/cortex-mcp 1.0.97 → 1.0.99

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
@@ -822,7 +822,18 @@ function getWizardHtml() {
822
822
  </div>
823
823
  </div>
824
824
 
825
- <!-- Step 5: Connect Accounts -->
825
+ <!-- Step 5: Manual Setup Walkthrough -->
826
+ <div id="step-manual-setup" class="step">
827
+ <div class="card">
828
+ <div id="manual-setup-content"></div>
829
+ <div class="btn-row">
830
+ <button class="btn btn-secondary" id="btn-manual-skip" onclick="skipManualSetup()">Skip for now</button>
831
+ <button class="btn btn-primary" id="btn-manual-done" onclick="completeManualSetup()">I've done this</button>
832
+ </div>
833
+ </div>
834
+ </div>
835
+
836
+ <!-- Step 6: Connect Accounts -->
826
837
  <div id="step-connect" class="step">
827
838
  <div class="card">
828
839
  <h2>Connect Accounts</h2>
@@ -868,10 +879,12 @@ function getWizardHtml() {
868
879
  configuredClients: [],
869
880
  connections: [],
870
881
  serverUrl: '',
882
+ manualQueue: [],
883
+ currentManualIndex: 0,
871
884
  };
872
885
 
873
886
  // \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
874
- var STEP_ORDER = ['welcome', 'signin', 'mcps', 'clients', 'connect', 'done'];
887
+ var STEP_ORDER = ['welcome', 'signin', 'mcps', 'clients', 'manual-setup', 'connect', 'done'];
875
888
  var currentStepIndex = 0;
876
889
 
877
890
  // \u2500\u2500 MCP Icons (inline SVG) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
@@ -901,10 +914,19 @@ function getWizardHtml() {
901
914
  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>',
902
915
  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>',
903
916
  '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>',
917
+ 'claude-cowork': '<svg viewBox="0 0 16 16"><path d="M4 3a2 2 0 00-2 2v6a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2H4z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M5 7h2v2H5zM9 7h2v2H9z" fill="currentColor"/><path d="M6 10.5c0-.3.4-1 2-1s2 .7 2 1" fill="none" stroke="currentColor" stroke-width="0.8" stroke-linecap="round"/></svg>',
904
918
  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>',
905
919
  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>',
906
920
  };
907
921
 
922
+ // \u2500\u2500 Manual Client Display Names \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
923
+ var MANUAL_CLIENT_NAMES = {
924
+ 'claude-cowork': 'Claude CoWork',
925
+ 'claude-ai': 'Claude.ai & Mobile',
926
+ 'perplexity': 'Perplexity',
927
+ 'stdio': 'OpenClaw / Stdio',
928
+ };
929
+
908
930
  // \u2500\u2500 Init \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
909
931
  async function init() {
910
932
  try {
@@ -960,6 +982,7 @@ function getWizardHtml() {
960
982
  if (step === 'signin') renderSignin();
961
983
  if (step === 'mcps') renderMcps();
962
984
  if (step === 'clients') renderClients();
985
+ if (step === 'manual-setup') renderManualSetup();
963
986
  if (step === 'connect') renderConnect();
964
987
  if (step === 'done') renderDone();
965
988
  }
@@ -1238,7 +1261,7 @@ function getWizardHtml() {
1238
1261
  return nonAutoTypes.indexOf(c) === -1;
1239
1262
  });
1240
1263
 
1241
- // Split into auto-configured, web/mobile, and manual-setup clients
1264
+ // Split into auto-configured, web/mobile/cowork, and manual-setup clients
1242
1265
  var autoClients = state.detectedClients.filter(function(c) {
1243
1266
  return c.type !== 'perplexity' && c.type !== 'stdio' && c.type !== 'claude-ai';
1244
1267
  });
@@ -1317,50 +1340,37 @@ function getWizardHtml() {
1317
1340
 
1318
1341
  state.configuredClients = data.results.filter(function(r) { return r.success; }).map(function(r) { return r.client; });
1319
1342
 
1343
+ // Separate manual-setup clients from auto-configured ones
1344
+ var manualClientTypes = ['claude-cowork', 'claude-ai', 'perplexity', 'stdio'];
1345
+
1320
1346
  // Update per-client status inline
1321
1347
  data.results.forEach(function(r) {
1322
1348
  var item = document.querySelector('[data-client="' + r.client + '"]');
1323
1349
  if (item) {
1324
1350
  var statusSpan = item.querySelector('.client-status');
1325
1351
  if (r.success) {
1326
- statusSpan.innerHTML = '<span style="color: #4CAF50;">&#10003; Done</span>';
1352
+ var isManual = manualClientTypes.indexOf(r.client) !== -1;
1353
+ statusSpan.innerHTML = isManual
1354
+ ? '<span style="color: #00A3E1;">Setup required \u2192</span>'
1355
+ : '<span style="color: #4CAF50;">&#10003; Done</span>';
1327
1356
  } else {
1328
1357
  statusSpan.innerHTML = '<span style="color: #EF5350;">&#10007; Failed</span>';
1329
1358
  }
1330
1359
  }
1331
1360
  });
1361
+ state.manualQueue = data.results.filter(function(r) {
1362
+ return r.success && manualClientTypes.indexOf(r.client) !== -1;
1363
+ });
1364
+ state.currentManualIndex = 0;
1332
1365
 
1333
1366
  var resultEl = document.getElementById('client-result');
1334
1367
  resultEl.className = '';
1335
1368
  resultEl.innerHTML = data.results.map(function(r) {
1369
+ var isManualClient = manualClientTypes.indexOf(r.client) !== -1;
1336
1370
  var html = '<div class="status ' + (r.success ? 'status-success' : 'status-error') + '">' +
1337
1371
  '<span>' + (r.success ? '&#10003;' : '&#10007;') + '</span>' +
1338
- '<span>' + (r.success ? escapeHtml(r.message || 'Configured') : escapeHtml(r.client) + ': ' + (r.error || 'Failed')) + '</span>' +
1372
+ '<span>' + (r.success ? escapeHtml(isManualClient ? (MANUAL_CLIENT_NAMES[r.client] || r.client) + ' \u2014 setup instructions on next page' : (r.message || 'Configured')) : escapeHtml(r.client) + ': ' + (r.error || 'Failed')) + '</span>' +
1339
1373
  '</div>';
1340
- // Show Claude.ai instructions with copyable URL
1341
- if (r.client === 'claude-ai' && r.success && r.message) {
1342
- var mcpUrl = (state.serverUrl || 'https://cortex-bice.vercel.app') + '/mcp/cortex';
1343
- html += '<div class="stdio-snippet" style="text-align: left;">' +
1344
- '<ol style="margin: 0 0 12px 0; padding-left: 20px; line-height: 1.8;">' +
1345
- '<li>Open <a href="https://claude.ai/settings/integrations" target="_blank" style="color: #00A3E1;">claude.ai/settings/integrations</a></li>' +
1346
- '<li>Click <strong>Add custom integration</strong></li>' +
1347
- '<li>Paste this URL and click Add:</li>' +
1348
- '</ol>' +
1349
- '<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;">' +
1350
- '<code style="flex: 1; font-size: 12px; word-break: break-all;">' + escapeHtml(mcpUrl) + '</code>' +
1351
- '<button class="copy-btn" onclick="copySnippet(this)">Copy</button>' +
1352
- '</div>' +
1353
- '<p style="margin: 10px 0 0 0; font-size: 12px; opacity: 0.7;">Claude handles SSO authentication automatically. Tools sync to mobile.</p>' +
1354
- '</div>';
1355
- }
1356
- // Show copyable snippet for stdio/OpenClaw and Perplexity instructions
1357
- if ((r.client === 'stdio' || r.client === 'perplexity') && r.success && r.message) {
1358
- var snippet = r.message.replace(/^Add this to your client config:\\n\\n/, '');
1359
- html += '<div class="stdio-snippet">' +
1360
- '<button class="copy-btn" onclick="copySnippet(this)">Copy</button>' +
1361
- '<pre>' + escapeHtml(snippet) + '</pre>' +
1362
- '</div>';
1363
- }
1364
1374
  return html;
1365
1375
  }).join('');
1366
1376
 
@@ -1373,7 +1383,13 @@ function getWizardHtml() {
1373
1383
 
1374
1384
  btn.textContent = 'Continue';
1375
1385
  btn.disabled = false;
1376
- btn.onclick = function() { goToStep('connect'); };
1386
+ btn.onclick = function() {
1387
+ if (state.manualQueue.length > 0) {
1388
+ goToStep('manual-setup');
1389
+ } else {
1390
+ goToStep('connect');
1391
+ }
1392
+ };
1377
1393
  } catch (err) {
1378
1394
  btn.disabled = false;
1379
1395
  btn.textContent = 'Retry';
@@ -1383,7 +1399,106 @@ function getWizardHtml() {
1383
1399
  }
1384
1400
  }
1385
1401
 
1386
- // \u2500\u2500 Step 5: Connect Accounts \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1402
+ // \u2500\u2500 Step 5: Manual Setup Walkthrough \u2500\u2500\u2500\u2500\u2500\u2500
1403
+ function getManualSetupContent(clientType) {
1404
+ var mcpUrl = (state.serverUrl || 'https://cortex-bice.vercel.app') + '/mcp/cortex';
1405
+
1406
+ if (clientType === 'claude-cowork') {
1407
+ return '<ol style="margin: 0 0 20px 0; padding-left: 20px; line-height: 2; font-size: 15px;">' +
1408
+ '<li>Open <strong>Claude Desktop</strong> \u2192 <strong>Settings</strong> \u2192 <strong>Connectors</strong></li>' +
1409
+ '<li>Click <strong>Add custom connector</strong></li>' +
1410
+ '<li>Enter the name: <strong>Cortex CoWork</strong></li>' +
1411
+ '<li>Paste the URL below into <strong>Remote MCP server URL</strong></li>' +
1412
+ '<li>Click <strong>Add</strong> \u2014 sign in via <strong>Okta</strong> when prompted</li>' +
1413
+ '</ol>' +
1414
+ '<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: 8px; padding: 12px 16px; margin-bottom: 16px;">' +
1415
+ '<code style="flex: 1; font-size: 13px; word-break: break-all;">' + escapeHtml(mcpUrl) + '</code>' +
1416
+ '<button class="copy-btn" onclick="copySnippet(this)">Copy</button>' +
1417
+ '</div>' +
1418
+ '<p style="font-size: 13px; opacity: 0.6;">Once connected, Cortex tools are available in all CoWork sessions.</p>';
1419
+ }
1420
+
1421
+ if (clientType === 'claude-ai') {
1422
+ return '<ol style="margin: 0 0 20px 0; padding-left: 20px; line-height: 2; font-size: 15px;">' +
1423
+ '<li>Open <a href="https://claude.ai/settings/integrations" target="_blank" style="color: #00A3E1;">claude.ai/settings/integrations</a></li>' +
1424
+ '<li>Click <strong>Add custom integration</strong></li>' +
1425
+ '<li>Paste the URL below and click <strong>Add</strong></li>' +
1426
+ '<li>Claude handles SSO authentication automatically</li>' +
1427
+ '</ol>' +
1428
+ '<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: 8px; padding: 12px 16px; margin-bottom: 16px;">' +
1429
+ '<code style="flex: 1; font-size: 13px; word-break: break-all;">' + escapeHtml(mcpUrl) + '</code>' +
1430
+ '<button class="copy-btn" onclick="copySnippet(this)">Copy</button>' +
1431
+ '</div>' +
1432
+ '<p style="font-size: 13px; opacity: 0.6;">Tools sync automatically to claude.ai, Claude Desktop (web), and the Claude mobile app.</p>';
1433
+ }
1434
+
1435
+ if (clientType === 'perplexity') {
1436
+ var item = state.manualQueue[state.currentManualIndex];
1437
+ var msg = (item && item.message) || '';
1438
+ return '<div style="font-size: 14px; line-height: 1.8; margin-bottom: 16px;">' + escapeHtml(msg).replace(/\\n/g, '<br>') + '</div>';
1439
+ }
1440
+
1441
+ if (clientType === 'stdio') {
1442
+ var item = state.manualQueue[state.currentManualIndex];
1443
+ var msg = (item && item.message) || '';
1444
+ var snippet = msg.replace(/^Add this to your client config:\\n\\n/, '');
1445
+ return '<p style="margin-bottom: 12px; font-size: 14px;">Add this to your client\u2019s MCP config:</p>' +
1446
+ '<div class="stdio-snippet">' +
1447
+ '<button class="copy-btn" onclick="copySnippet(this)">Copy</button>' +
1448
+ '<pre>' + escapeHtml(snippet) + '</pre>' +
1449
+ '</div>';
1450
+ }
1451
+
1452
+ return '';
1453
+ }
1454
+
1455
+ function renderManualSetup() {
1456
+ var el = document.getElementById('manual-setup-content');
1457
+ var total = state.manualQueue.length;
1458
+ var idx = state.currentManualIndex;
1459
+
1460
+ if (idx >= total) {
1461
+ goToStep('connect');
1462
+ return;
1463
+ }
1464
+
1465
+ var item = state.manualQueue[idx];
1466
+ var clientType = item.client;
1467
+ var clientName = MANUAL_CLIENT_NAMES[clientType] || clientType;
1468
+ var icon = CLIENT_ICONS[clientType] || '';
1469
+
1470
+ var progressHtml = total > 1
1471
+ ? '<div style="font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.5; margin-bottom: 8px;">Setup ' + (idx + 1) + ' of ' + total + '</div>'
1472
+ : '';
1473
+
1474
+ el.innerHTML = progressHtml +
1475
+ '<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 24px;">' +
1476
+ (icon ? '<div class="client-icon" style="width: 32px; height: 32px;">' + icon + '</div>' : '') +
1477
+ '<h2 style="margin: 0;">Set up ' + escapeHtml(clientName) + '</h2>' +
1478
+ '</div>' +
1479
+ '<p class="subtitle" style="margin-bottom: 24px;">Follow these steps to connect Cortex</p>' +
1480
+ getManualSetupContent(clientType);
1481
+ }
1482
+
1483
+ function completeManualSetup() {
1484
+ state.currentManualIndex++;
1485
+ if (state.currentManualIndex < state.manualQueue.length) {
1486
+ renderManualSetup();
1487
+ } else {
1488
+ goToStep('connect');
1489
+ }
1490
+ }
1491
+
1492
+ function skipManualSetup() {
1493
+ state.currentManualIndex++;
1494
+ if (state.currentManualIndex < state.manualQueue.length) {
1495
+ renderManualSetup();
1496
+ } else {
1497
+ goToStep('connect');
1498
+ }
1499
+ }
1500
+
1501
+ // \u2500\u2500 Step 6: Connect Accounts \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1387
1502
  async function renderConnect() {
1388
1503
  var el = document.getElementById('conn-list');
1389
1504
  el.innerHTML = '<div class="status status-info"><span class="spinner"></span> Loading connections...</div>';
@@ -1710,6 +1825,12 @@ function detectClients() {
1710
1825
  configPath: null,
1711
1826
  detected: true
1712
1827
  });
1828
+ clients.push({
1829
+ type: "claude-cowork",
1830
+ name: "Claude CoWork",
1831
+ configPath: null,
1832
+ detected: true
1833
+ });
1713
1834
  clients.push({
1714
1835
  type: "stdio",
1715
1836
  name: "OpenClaw",
@@ -1974,6 +2095,10 @@ function configureClaudeAi(serverUrl, _apiKey, _mcps) {
1974
2095
  const url = `${serverUrl}/mcp/cortex`;
1975
2096
  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.";
1976
2097
  }
2098
+ function configureClaudeCowork(serverUrl, _apiKey, _mcps) {
2099
+ const url = `${serverUrl}/mcp/cortex`;
2100
+ return 'Add Cortex to Claude CoWork:\n\n1. Open Claude Desktop \u2192 Settings \u2192 Connectors\n2. Click "Add custom connector"\n3. Name: Cortex CoWork\n4. Remote MCP server URL: ' + url + "\n5. Click Add \u2014 sign in via Okta when prompted\n6. Cortex tools are now available in CoWork sessions";
2101
+ }
1977
2102
  function generateStdioSnippet(_apiKey) {
1978
2103
  const isWindowsTarget = getPlatform() === "windows" || isWSL();
1979
2104
  const config = {
@@ -2091,6 +2216,8 @@ function configureClient(clientType, serverUrl, apiKey, mcps) {
2091
2216
  return configurePerplexity(serverUrl, apiKey, mcps);
2092
2217
  case "claude-ai":
2093
2218
  return configureClaudeAi(serverUrl, apiKey, mcps);
2219
+ case "claude-cowork":
2220
+ return configureClaudeCowork(serverUrl, apiKey, mcps);
2094
2221
  case "stdio":
2095
2222
  return "Add this to your client config:\n\n" + generateStdioSnippet(apiKey);
2096
2223
  }