@danainnovations/cortex-mcp 1.0.85 → 1.0.87

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.
@@ -8,8 +8,9 @@ import {
8
8
  DEFAULT_MCPS,
9
9
  DEFAULT_SERVER_URL,
10
10
  MCP_NAMES,
11
- PROTOCOL_VERSION
12
- } from "./chunk-D4PD3E6J.js";
11
+ PROTOCOL_VERSION,
12
+ SONANCE_BRAND_CONFIG
13
+ } from "./chunk-3X6WPEWI.js";
13
14
  export {
14
15
  AVAILABLE_MCPS,
15
16
  CONFIG_DIR_NAME,
@@ -19,6 +20,7 @@ export {
19
20
  DEFAULT_MCPS,
20
21
  DEFAULT_SERVER_URL,
21
22
  MCP_NAMES,
22
- PROTOCOL_VERSION
23
+ PROTOCOL_VERSION,
24
+ SONANCE_BRAND_CONFIG
23
25
  };
24
- //# sourceMappingURL=constants-QSLA3TAZ.js.map
26
+ //# sourceMappingURL=constants-76SAPZ3D.js.map
package/dist/index.d.ts CHANGED
@@ -78,29 +78,29 @@ declare function detectClients(): DetectedClient[];
78
78
  * Uses command/args/env format (Claude Desktop does not support HTTP url/headers).
79
79
  * Preserves existing non-Cortex entries.
80
80
  */
81
- declare function configureClaudeDesktop(_serverUrl: string, apiKey: string, _mcps: string[]): string;
81
+ declare function configureClaudeDesktop(_serverUrl: string, apiKey: string, _mcps: string[], includeSonanceBrand?: boolean): string;
82
82
  /**
83
83
  * Configure Claude Code by running `claude mcp add` commands.
84
84
  */
85
- declare function configureClaudeCode(serverUrl: string, apiKey: string, mcps: string[]): void;
85
+ declare function configureClaudeCode(serverUrl: string, apiKey: string, mcps: string[], includeSonanceBrand?: boolean): void;
86
86
  /**
87
87
  * Configure Cursor by writing HTTP MCP entries to its config file.
88
88
  * Cursor supports HTTP transport natively.
89
89
  */
90
- declare function configureCursor(serverUrl: string, apiKey: string, mcps: string[]): void;
90
+ declare function configureCursor(serverUrl: string, apiKey: string, mcps: string[], includeSonanceBrand?: boolean): void;
91
91
  /**
92
92
  * Configure Perplexity Computer by generating per-MCP connector instructions.
93
93
  * Perplexity uses OAuth + Streamable HTTP — users add connectors manually via UI.
94
94
  */
95
- declare function configurePerplexity(serverUrl: string, _apiKey: string, mcps: string[]): string;
95
+ declare function configurePerplexity(serverUrl: string, _apiKey: string, mcps: string[], _includeSonanceBrand?: boolean): string;
96
96
  /**
97
97
  * Generate a stdio config snippet for clients that need it (OpenClaw, etc.)
98
98
  */
99
- declare function generateStdioSnippet(_apiKey: string): string;
99
+ declare function generateStdioSnippet(_apiKey: string, includeSonanceBrand?: boolean): string;
100
100
  /**
101
101
  * Configure a specific client type.
102
102
  */
103
- declare function configureClient(clientType: ClientType, serverUrl: string, apiKey: string, mcps: string[]): string;
103
+ declare function configureClient(clientType: ClientType, serverUrl: string, apiKey: string, mcps: string[], includeSonanceBrand?: boolean): string;
104
104
 
105
105
  /**
106
106
  * Validate that a string looks like a Cortex API key.
package/dist/index.js CHANGED
@@ -95,6 +95,14 @@ var AVAILABLE_MCPS = [
95
95
  authMode: "personal"
96
96
  }
97
97
  ];
98
+ var SONANCE_BRAND_CONFIG = {
99
+ name: "sonance-brand",
100
+ displayName: "Sonance Brand",
101
+ description: "Brand guidelines, design tokens, component library, logos (28 tools)",
102
+ serverName: "sonance-brand",
103
+ command: "npx",
104
+ args: ["-y", "sonance-brand-mcp@latest"]
105
+ };
98
106
  var MCP_NAMES = AVAILABLE_MCPS.map((m) => m.name);
99
107
  var DEFAULT_MCPS = [...MCP_NAMES];
100
108
  var DEFAULT_API_KEY = "ctx_07d37a81_9f7be06af38d04753090a4034f907a65ec06cd675ed26f65653898388e2d1709";
@@ -1256,7 +1264,8 @@ function detectClients() {
1256
1264
  });
1257
1265
  let claudeCodeDetected = false;
1258
1266
  try {
1259
- execSync2("which claude", { stdio: "pipe" });
1267
+ const whichCmd = getPlatform() === "windows" ? "where claude" : "which claude";
1268
+ execSync2(whichCmd, { stdio: "pipe" });
1260
1269
  claudeCodeDetected = true;
1261
1270
  } catch {
1262
1271
  }
@@ -1293,7 +1302,8 @@ function detectClients() {
1293
1302
  let codexDetected = existsSync3(join4(home, ".codex"));
1294
1303
  if (!codexDetected) {
1295
1304
  try {
1296
- execSync2("which codex", { stdio: "pipe" });
1305
+ const whichCmd = getPlatform() === "windows" ? "where codex" : "which codex";
1306
+ execSync2(whichCmd, { stdio: "pipe" });
1297
1307
  codexDetected = true;
1298
1308
  } catch {
1299
1309
  }
@@ -1319,6 +1329,10 @@ function detectClients() {
1319
1329
  });
1320
1330
  return clients;
1321
1331
  }
1332
+ function buildSonanceBrandEntry() {
1333
+ const isWindowsTarget = getPlatform() === "windows" || isWSL();
1334
+ return isWindowsTarget ? { command: "cmd", args: ["/c", ...SONANCE_BRAND_CONFIG.args] } : { command: SONANCE_BRAND_CONFIG.command, args: [...SONANCE_BRAND_CONFIG.args] };
1335
+ }
1322
1336
  function buildHttpEntries(serverUrl, apiKey, mcps) {
1323
1337
  const entries = {};
1324
1338
  for (const mcp of AVAILABLE_MCPS) {
@@ -1330,13 +1344,21 @@ function buildHttpEntries(serverUrl, apiKey, mcps) {
1330
1344
  }
1331
1345
  return entries;
1332
1346
  }
1333
- function configureClaudeDesktop(_serverUrl, apiKey, _mcps) {
1347
+ function configureClaudeDesktop(_serverUrl, apiKey, _mcps, includeSonanceBrand = true) {
1334
1348
  const configPath = getClaudeDesktopConfigPath();
1335
1349
  const dir = dirname2(configPath);
1336
1350
  if (!existsSync3(dir)) {
1337
1351
  mkdirSync3(dir, { recursive: true });
1338
1352
  }
1339
1353
  const isWindowsTarget = getPlatform() === "windows" || isWSL();
1354
+ try {
1355
+ const whichCmd = isWindowsTarget ? "where npx" : "which npx";
1356
+ execSync2(whichCmd, { stdio: "pipe" });
1357
+ } catch {
1358
+ throw new Error(
1359
+ "Node.js is required but 'npx' was not found in your system PATH. Please install Node.js from https://nodejs.org and re-run setup."
1360
+ );
1361
+ }
1340
1362
  const cortexEntry = isWindowsTarget ? {
1341
1363
  command: "cmd",
1342
1364
  args: ["/c", "npx", "-y", "@danainnovations/cortex-mcp@latest", "serve"]
@@ -1358,11 +1380,14 @@ function configureClaudeDesktop(_serverUrl, apiKey, _mcps) {
1358
1380
  }
1359
1381
  const servers = config.mcpServers;
1360
1382
  for (const key of Object.keys(servers)) {
1361
- if (key.startsWith("cortex-") || key === "cortex") {
1383
+ if (key.startsWith("cortex-") || key === "cortex" || key === SONANCE_BRAND_CONFIG.name) {
1362
1384
  delete servers[key];
1363
1385
  }
1364
1386
  }
1365
1387
  servers["cortex"] = cortexEntry;
1388
+ if (includeSonanceBrand) {
1389
+ servers[SONANCE_BRAND_CONFIG.name] = buildSonanceBrandEntry();
1390
+ }
1366
1391
  writeFileSync3(configPath, JSON.stringify(config, null, 2) + "\n");
1367
1392
  if (getPlatform() === "windows") {
1368
1393
  const storePath = getStoreClaudePath();
@@ -1386,9 +1411,12 @@ function configureClaudeDesktop(_serverUrl, apiKey, _mcps) {
1386
1411
  }
1387
1412
  const altServers = altConfig.mcpServers;
1388
1413
  for (const key of Object.keys(altServers)) {
1389
- if (key.startsWith("cortex-") || key === "cortex") delete altServers[key];
1414
+ if (key.startsWith("cortex-") || key === "cortex" || key === SONANCE_BRAND_CONFIG.name) delete altServers[key];
1390
1415
  }
1391
1416
  altServers["cortex"] = cortexEntry;
1417
+ if (includeSonanceBrand) {
1418
+ altServers[SONANCE_BRAND_CONFIG.name] = buildSonanceBrandEntry();
1419
+ }
1392
1420
  writeFileSync3(altPath, JSON.stringify(altConfig, null, 2) + "\n");
1393
1421
  } catch {
1394
1422
  }
@@ -1396,7 +1424,7 @@ function configureClaudeDesktop(_serverUrl, apiKey, _mcps) {
1396
1424
  }
1397
1425
  if (isWindowsTarget) {
1398
1426
  const start = Date.now();
1399
- while (Date.now() - start < 500) {
1427
+ while (Date.now() - start < 1500) {
1400
1428
  }
1401
1429
  try {
1402
1430
  const verify = JSON.parse(readFileSync5(configPath, "utf-8"));
@@ -1423,7 +1451,7 @@ function configureClaudeDesktop(_serverUrl, apiKey, _mcps) {
1423
1451
  `Failed to write config to ${configPath}. Claude Desktop may be overwriting the file. Please close Claude Desktop completely (quit from the system tray), then re-run setup.`
1424
1452
  );
1425
1453
  }
1426
- function configureClaudeCode(serverUrl, apiKey, mcps) {
1454
+ function configureClaudeCode(serverUrl, apiKey, mcps, includeSonanceBrand = true) {
1427
1455
  for (const mcp of AVAILABLE_MCPS) {
1428
1456
  if (!mcps.includes(mcp.name)) continue;
1429
1457
  const url = `${serverUrl}/mcp/${mcp.name}`;
@@ -1436,8 +1464,18 @@ function configureClaudeCode(serverUrl, apiKey, mcps) {
1436
1464
  { stdio: "pipe" }
1437
1465
  );
1438
1466
  }
1467
+ if (includeSonanceBrand) {
1468
+ try {
1469
+ execSync2(`claude mcp remove ${SONANCE_BRAND_CONFIG.name}`, { stdio: "pipe" });
1470
+ } catch {
1471
+ }
1472
+ execSync2(
1473
+ `claude mcp add ${SONANCE_BRAND_CONFIG.name} -- ${SONANCE_BRAND_CONFIG.command} ${SONANCE_BRAND_CONFIG.args.join(" ")}`,
1474
+ { stdio: "pipe" }
1475
+ );
1476
+ }
1439
1477
  }
1440
- function configureCursor(serverUrl, apiKey, mcps) {
1478
+ function configureCursor(serverUrl, apiKey, mcps, includeSonanceBrand = true) {
1441
1479
  const configPath = getCursorConfigPath();
1442
1480
  const dir = dirname2(configPath);
1443
1481
  if (!existsSync3(dir)) {
@@ -1455,15 +1493,18 @@ function configureCursor(serverUrl, apiKey, mcps) {
1455
1493
  }
1456
1494
  const servers = config.mcpServers;
1457
1495
  for (const key of Object.keys(servers)) {
1458
- if (key.startsWith("cortex-")) {
1496
+ if (key.startsWith("cortex-") || key === SONANCE_BRAND_CONFIG.name) {
1459
1497
  delete servers[key];
1460
1498
  }
1461
1499
  }
1462
1500
  const entries = buildHttpEntries(serverUrl, apiKey, mcps);
1463
1501
  Object.assign(servers, entries);
1502
+ if (includeSonanceBrand) {
1503
+ servers[SONANCE_BRAND_CONFIG.name] = buildSonanceBrandEntry();
1504
+ }
1464
1505
  writeFileSync3(configPath, JSON.stringify(config, null, 2) + "\n");
1465
1506
  }
1466
- function configureVSCode(serverUrl, apiKey, mcps) {
1507
+ function configureVSCode(serverUrl, apiKey, mcps, includeSonanceBrand = true) {
1467
1508
  const configPath = getVSCodeMcpConfigPath();
1468
1509
  const dir = dirname2(configPath);
1469
1510
  if (!existsSync3(dir)) {
@@ -1481,15 +1522,18 @@ function configureVSCode(serverUrl, apiKey, mcps) {
1481
1522
  }
1482
1523
  const servers = config.mcpServers;
1483
1524
  for (const key of Object.keys(servers)) {
1484
- if (key.startsWith("cortex-")) {
1525
+ if (key.startsWith("cortex-") || key === SONANCE_BRAND_CONFIG.name) {
1485
1526
  delete servers[key];
1486
1527
  }
1487
1528
  }
1488
1529
  const entries = buildHttpEntries(serverUrl, apiKey, mcps);
1489
1530
  Object.assign(servers, entries);
1531
+ if (includeSonanceBrand) {
1532
+ servers[SONANCE_BRAND_CONFIG.name] = buildSonanceBrandEntry();
1533
+ }
1490
1534
  writeFileSync3(configPath, JSON.stringify(config, null, 2) + "\n");
1491
1535
  }
1492
- function configureAntigravity(serverUrl, apiKey, mcps) {
1536
+ function configureAntigravity(serverUrl, apiKey, mcps, includeSonanceBrand = true) {
1493
1537
  const configPath = getAntigravityConfigPath();
1494
1538
  const dir = dirname2(configPath);
1495
1539
  if (!existsSync3(dir)) {
@@ -1507,15 +1551,18 @@ function configureAntigravity(serverUrl, apiKey, mcps) {
1507
1551
  }
1508
1552
  const servers = config.mcpServers;
1509
1553
  for (const key of Object.keys(servers)) {
1510
- if (key.startsWith("cortex-")) {
1554
+ if (key.startsWith("cortex-") || key === SONANCE_BRAND_CONFIG.name) {
1511
1555
  delete servers[key];
1512
1556
  }
1513
1557
  }
1514
1558
  const entries = buildHttpEntries(serverUrl, apiKey, mcps);
1515
1559
  Object.assign(servers, entries);
1560
+ if (includeSonanceBrand) {
1561
+ servers[SONANCE_BRAND_CONFIG.name] = buildSonanceBrandEntry();
1562
+ }
1516
1563
  writeFileSync3(configPath, JSON.stringify(config, null, 2) + "\n");
1517
1564
  }
1518
- function configureCodex(serverUrl, apiKey, mcps) {
1565
+ function configureCodex(serverUrl, apiKey, mcps, includeSonanceBrand = true) {
1519
1566
  const configPath = getCodexConfigPath();
1520
1567
  const dir = dirname2(configPath);
1521
1568
  if (!existsSync3(dir)) {
@@ -1529,7 +1576,7 @@ function configureCodex(serverUrl, apiKey, mcps) {
1529
1576
  }
1530
1577
  }
1531
1578
  const cleaned = existingContent.replace(
1532
- /\[mcp_servers\.cortex-[^\]]*\][^[]*(?=\[|$)/g,
1579
+ /\[mcp_servers\.(?:cortex-[^\]]*|sonance-brand)\][^[]*(?=\[|$)/g,
1533
1580
  ""
1534
1581
  ).trim();
1535
1582
  const tomlEntries = [];
@@ -1541,10 +1588,17 @@ url = "${serverUrl}/mcp/${mcp.name}"
1541
1588
  http_headers = { "x-api-key" = "${apiKey}" }`
1542
1589
  );
1543
1590
  }
1591
+ if (includeSonanceBrand) {
1592
+ tomlEntries.push(
1593
+ `[mcp_servers.${SONANCE_BRAND_CONFIG.name}]
1594
+ command = "${SONANCE_BRAND_CONFIG.command}"
1595
+ args = [${SONANCE_BRAND_CONFIG.args.map((a) => `"${a}"`).join(", ")}]`
1596
+ );
1597
+ }
1544
1598
  const newContent = (cleaned ? cleaned + "\n\n" : "") + tomlEntries.join("\n\n") + "\n";
1545
1599
  writeFileSync3(configPath, newContent);
1546
1600
  }
1547
- function configurePerplexity(serverUrl, _apiKey, mcps) {
1601
+ function configurePerplexity(serverUrl, _apiKey, mcps, _includeSonanceBrand = true) {
1548
1602
  const lines = [
1549
1603
  "Add each MCP as a separate connector in Perplexity:",
1550
1604
  " Settings \u2192 Connectors \u2192 Add custom connector",
@@ -1561,9 +1615,11 @@ function configurePerplexity(serverUrl, _apiKey, mcps) {
1561
1615
  lines.push(` Transport: Streamable HTTP`);
1562
1616
  lines.push("");
1563
1617
  }
1618
+ lines.push("Note: Sonance Brand MCP requires stdio transport (npx sonance-brand-mcp).");
1619
+ lines.push("Perplexity may not support stdio \u2014 use Claude Desktop or Claude Code for brand tools.");
1564
1620
  return lines.join("\n");
1565
1621
  }
1566
- function generateStdioSnippet(_apiKey) {
1622
+ function generateStdioSnippet(_apiKey, includeSonanceBrand = true) {
1567
1623
  const isWindowsTarget = getPlatform() === "windows" || isWSL();
1568
1624
  const config = {
1569
1625
  mcpServers: {
@@ -1576,33 +1632,36 @@ function generateStdioSnippet(_apiKey) {
1576
1632
  }
1577
1633
  }
1578
1634
  };
1635
+ if (includeSonanceBrand) {
1636
+ config.mcpServers[SONANCE_BRAND_CONFIG.name] = buildSonanceBrandEntry();
1637
+ }
1579
1638
  return JSON.stringify(config, null, 2);
1580
1639
  }
1581
- function configureClient(clientType, serverUrl, apiKey, mcps) {
1640
+ function configureClient(clientType, serverUrl, apiKey, mcps, includeSonanceBrand = true) {
1582
1641
  switch (clientType) {
1583
1642
  case "claude-desktop": {
1584
- const path = configureClaudeDesktop(serverUrl, apiKey, mcps);
1643
+ const path = configureClaudeDesktop(serverUrl, apiKey, mcps, includeSonanceBrand);
1585
1644
  return `Claude Desktop configured (${path})`;
1586
1645
  }
1587
1646
  case "claude-code":
1588
- configureClaudeCode(serverUrl, apiKey, mcps);
1647
+ configureClaudeCode(serverUrl, apiKey, mcps, includeSonanceBrand);
1589
1648
  return "Claude Code configured";
1590
1649
  case "cursor":
1591
- configureCursor(serverUrl, apiKey, mcps);
1650
+ configureCursor(serverUrl, apiKey, mcps, includeSonanceBrand);
1592
1651
  return "Cursor configured";
1593
1652
  case "vscode":
1594
- configureVSCode(serverUrl, apiKey, mcps);
1653
+ configureVSCode(serverUrl, apiKey, mcps, includeSonanceBrand);
1595
1654
  return "VS Code configured";
1596
1655
  case "antigravity":
1597
- configureAntigravity(serverUrl, apiKey, mcps);
1656
+ configureAntigravity(serverUrl, apiKey, mcps, includeSonanceBrand);
1598
1657
  return "Antigravity configured";
1599
1658
  case "codex":
1600
- configureCodex(serverUrl, apiKey, mcps);
1659
+ configureCodex(serverUrl, apiKey, mcps, includeSonanceBrand);
1601
1660
  return "Codex configured";
1602
1661
  case "perplexity":
1603
- return configurePerplexity(serverUrl, apiKey, mcps);
1662
+ return configurePerplexity(serverUrl, apiKey, mcps, includeSonanceBrand);
1604
1663
  case "stdio":
1605
- return "Add this to your client config:\n\n" + generateStdioSnippet(apiKey);
1664
+ return "Add this to your client config:\n\n" + generateStdioSnippet(apiKey, includeSonanceBrand);
1606
1665
  }
1607
1666
  }
1608
1667