@danainnovations/cortex-mcp 1.0.74 → 1.0.76

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
@@ -857,6 +857,7 @@ function getWizardHtml() {
857
857
  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>',
858
858
  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>',
859
859
  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>',
860
+ 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>',
860
861
  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>',
861
862
  };
862
863
 
@@ -1040,6 +1041,18 @@ function getWizardHtml() {
1040
1041
  async function renderMcps() {
1041
1042
  var container = document.getElementById('mcp-list-container');
1042
1043
 
1044
+ // Fetch per-user available MCPs (uses API key from login)
1045
+ try {
1046
+ var userResp = await fetch('/api/user-mcps');
1047
+ var userData = await userResp.json();
1048
+ if (userData.mcps && userData.mcps.length > 0) {
1049
+ state.enabledMcps = userData.mcps.map(function(m) { return m.name; });
1050
+ state.selectedMcps = state.enabledMcps.slice();
1051
+ }
1052
+ } catch (e) {
1053
+ // Fall back to global enabledMcps from initial state
1054
+ }
1055
+
1043
1056
  // Fetch existing OAuth connections to show connected status
1044
1057
  try {
1045
1058
  var resp = await fetch('/api/connections');
@@ -1206,8 +1219,8 @@ function getWizardHtml() {
1206
1219
  '<span>' + (r.success ? '&#10003;' : '&#10007;') + '</span>' +
1207
1220
  '<span>' + escapeHtml(r.client) + ': ' + (r.success ? 'Configured' : r.error || 'Failed') + '</span>' +
1208
1221
  '</div>';
1209
- // Show copyable snippet for stdio/OpenClaw
1210
- if (r.client === 'stdio' && r.success && r.message) {
1222
+ // Show copyable snippet for stdio/OpenClaw and Perplexity instructions
1223
+ if ((r.client === 'stdio' || r.client === 'perplexity') && r.success && r.message) {
1211
1224
  var snippet = r.message.replace(/^Add this to your client config:\\n\\n/, '');
1212
1225
  html += '<div class="stdio-snippet">' +
1213
1226
  '<button class="copy-btn" onclick="copySnippet(this)">Copy</button>' +
@@ -1498,6 +1511,13 @@ function detectClients() {
1498
1511
  configPath: codexPath,
1499
1512
  detected: codexDetected
1500
1513
  });
1514
+ const perplexityDir = join(home, "Library", "Containers", "ai.perplexity.mac");
1515
+ clients.push({
1516
+ type: "perplexity",
1517
+ name: "Perplexity Computer",
1518
+ configPath: null,
1519
+ detected: getPlatform() === "macos" && existsSync(perplexityDir)
1520
+ });
1501
1521
  clients.push({
1502
1522
  type: "stdio",
1503
1523
  name: "OpenClaw (stdio)",
@@ -1670,6 +1690,25 @@ http_headers = { "x-api-key" = "${apiKey}" }`
1670
1690
  const newContent = (cleaned ? cleaned + "\n\n" : "") + tomlEntries.join("\n\n") + "\n";
1671
1691
  writeFileSync(configPath, newContent);
1672
1692
  }
1693
+ function configurePerplexity(serverUrl, _apiKey, mcps) {
1694
+ const lines = [
1695
+ "Add each MCP as a separate connector in Perplexity:",
1696
+ " Settings \u2192 Connectors \u2192 Add custom connector",
1697
+ ""
1698
+ ];
1699
+ for (const mcp of AVAILABLE_MCPS) {
1700
+ if (!mcps.includes(mcp.name)) continue;
1701
+ lines.push(`\u2500\u2500 ${mcp.displayName} \u2500\u2500`);
1702
+ lines.push(` Name: Cortex ${mcp.displayName}`);
1703
+ lines.push(` MCP server URL: ${serverUrl}/mcp/${mcp.name}`);
1704
+ lines.push(` Authentication: OAuth`);
1705
+ lines.push(` Client ID: perplexity`);
1706
+ lines.push(` Client Secret: (leave empty)`);
1707
+ lines.push(` Transport: Streamable HTTP`);
1708
+ lines.push("");
1709
+ }
1710
+ return lines.join("\n");
1711
+ }
1673
1712
  function generateStdioSnippet(_apiKey) {
1674
1713
  const isWindows = getPlatform() === "windows";
1675
1714
  const config = {
@@ -1778,6 +1817,8 @@ function configureClient(clientType, serverUrl, apiKey, mcps) {
1778
1817
  case "codex":
1779
1818
  configureCodex(serverUrl, apiKey, mcps);
1780
1819
  return "Codex configured";
1820
+ case "perplexity":
1821
+ return configurePerplexity(serverUrl, apiKey, mcps);
1781
1822
  case "stdio":
1782
1823
  return "Add this to your client config:\n\n" + generateStdioSnippet(apiKey);
1783
1824
  }
@@ -1974,6 +2015,42 @@ async function handleApiRoute(path, searchParams, req, res, options, onComplete)
1974
2015
  }
1975
2016
  return true;
1976
2017
  }
2018
+ if (path === "/api/user-mcps" && method === "GET") {
2019
+ const apiKey = getState().apiKey;
2020
+ if (!apiKey) {
2021
+ json(res, { mcps: [] });
2022
+ return true;
2023
+ }
2024
+ try {
2025
+ const resp = await fetch(
2026
+ `${options.serverUrl}/api/v1/mcps/user-available`,
2027
+ { headers: { "x-api-key": apiKey } }
2028
+ );
2029
+ if (resp.ok) {
2030
+ const data = await resp.json();
2031
+ json(res, data);
2032
+ } else {
2033
+ json(res, {
2034
+ mcps: AVAILABLE_MCPS.map((m) => ({
2035
+ name: m.name,
2036
+ displayName: m.displayName,
2037
+ authMode: m.authMode,
2038
+ connected: false
2039
+ }))
2040
+ });
2041
+ }
2042
+ } catch {
2043
+ json(res, {
2044
+ mcps: AVAILABLE_MCPS.map((m) => ({
2045
+ name: m.name,
2046
+ displayName: m.displayName,
2047
+ authMode: m.authMode,
2048
+ connected: false
2049
+ }))
2050
+ });
2051
+ }
2052
+ return true;
2053
+ }
1977
2054
  if (path === "/api/clients/configure" && method === "POST") {
1978
2055
  const body = await parseBody(req);
1979
2056
  const clients = body.clients || [];
@@ -2187,6 +2264,7 @@ var VALID_CLIENTS = {
2187
2264
  "claude-code": "claude-code",
2188
2265
  cursor: "cursor",
2189
2266
  codex: "codex",
2267
+ perplexity: "perplexity",
2190
2268
  stdio: "stdio"
2191
2269
  };
2192
2270
  async function runConfigure(options) {