@cybermem/dashboard 0.14.6 → 0.14.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @cybermem/dashboard
2
2
 
3
+ ## 0.14.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#120](https://github.com/mikhailkogan17/cybermem/pull/120) [`2319994`](https://github.com/mikhailkogan17/cybermem/commit/2319994f096e4063e2ca4bc4ca02eb8b33f192ce) Thanks [@mikhailkogan17-antigravity](https://github.com/mikhailkogan17-antigravity)! - fix(mcp): remove redundant transport.start() call causing SSE crash loop; switch to SSEServerTransport for multi-client support
8
+ fix(dashboard): update mcp-config API to support SSE and --allow-http
9
+
10
+ ## 0.14.8
11
+
12
+ ### Patch Changes
13
+
14
+ - Automated patch version bump.
15
+
16
+ ## 0.14.7
17
+
18
+ ### Patch Changes
19
+
20
+ - [#114](https://github.com/mikhailkogan17/cybermem/pull/114) [`7871ba9`](https://github.com/mikhailkogan17/cybermem/commit/7871ba96c9008a8188a84bc379e9687e716ed9e9) Thanks [@mikhailkogan17-antigravity](https://github.com/mikhailkogan17-antigravity)! - fix(mcp): switch to SSEServerTransport for multi-client support
21
+ fix(dashboard): update mcp-config API to support SSE and --allow-http
22
+
3
23
  ## 0.14.6
4
24
 
5
25
  ### Patch Changes
@@ -48,10 +48,15 @@ export async function GET(request: Request) {
48
48
  }
49
49
 
50
50
  const apiKey = settings.apiKey !== "not-set" ? settings.apiKey : "";
51
+ const rawEndpoint =
52
+ typeof settings.endpoint === "string" ? settings.endpoint : "";
53
+ const normalizedEndpoint = rawEndpoint.endsWith("/mcp")
54
+ ? rawEndpoint.replace(/\/mcp$/, "/sse")
55
+ : rawEndpoint;
51
56
  const baseUrl =
52
57
  searchParams.get("baseUrl") ||
53
- settings.endpoint ||
54
- "http://localhost:8626/mcp";
58
+ normalizedEndpoint ||
59
+ "http://localhost:8626/sse";
55
60
  const isManaged = settings.isManaged || false;
56
61
  const env = settings.env || "prod";
57
62
  const isStaging = env === "staging";
@@ -61,11 +66,19 @@ export async function GET(request: Request) {
61
66
  : apiKey || "sk-your-generated-token";
62
67
  const actualKey = apiKey || "sk-your-generated-token";
63
68
 
64
- const client = clientsConfig.find((c: any) => c.id === clientId);
69
+ const client = clientsConfig.find(
70
+ (c: { id: string; configType?: string }) => c.id === clientId,
71
+ );
65
72
 
66
73
  // Generate config based on client type
67
- let config: any;
68
- let configType = client?.configType || "json";
74
+ let config: string | object;
75
+ const configType = client?.configType || "json";
76
+
77
+ const isHttp = baseUrl.startsWith("http://");
78
+ const isLocalhost =
79
+ baseUrl.includes("localhost") || baseUrl.includes("127.0.0.1");
80
+ // RPi LAN is trusted, no auth required
81
+ const isRpiLan = baseUrl.includes("raspberrypi.local");
69
82
 
70
83
  // Local envs (isManaged): use @cybermem/mcp directly
71
84
  // Remote envs: use mcp-remote (standard stdio-to-HTTP bridge)
@@ -77,7 +90,15 @@ export async function GET(request: Request) {
77
90
  config = `[mcpServers.cybermem]\ncommand = "npx"\nargs = ${localArgs}`;
78
91
  } else {
79
92
  const keyVal = maskKey ? displayKey : actualKey;
80
- config = `[mcpServers.cybermem]\ncommand = "npx"\nargs = ["-y", "mcp-remote", "${baseUrl}", "--header", "X-API-Key:${keyVal}"]`;
93
+ const args: string[] = ["-y", "mcp-remote", baseUrl];
94
+ if (isHttp && !isLocalhost) {
95
+ args.push("--allow-http");
96
+ }
97
+ if (!isRpiLan && !isLocalhost && apiKey) {
98
+ args.push("--header", `X-API-Key:${keyVal}`);
99
+ }
100
+ const argsStr = JSON.stringify(args);
101
+ config = `[mcpServers.cybermem]\ncommand = "npx"\nargs = ${argsStr}`;
81
102
  }
82
103
  } else if (configType === "command" || configType === "cmd") {
83
104
  // Generate command directly (don't rely on clients.json templates)
@@ -89,7 +110,11 @@ export async function GET(request: Request) {
89
110
  const keyVal = maskKey ? displayKey : actualKey;
90
111
  const clientName = client?.id || "cybermem";
91
112
  const cliPrefix = client?.id === "gemini-cli" ? "gemini" : "claude";
92
- config = `${cliPrefix} mcp add ${clientName} -- npx -y mcp-remote ${baseUrl} --header X-API-Key:${keyVal}`;
113
+ let cmd = `${cliPrefix} mcp add ${clientName} -- npx -y mcp-remote ${baseUrl}`;
114
+ if (isHttp && !isLocalhost) cmd += ` --allow-http`;
115
+ if (!isRpiLan && !isLocalhost && apiKey)
116
+ cmd += ` --header X-API-Key:${keyVal}`;
117
+ config = cmd;
93
118
  }
94
119
  } else {
95
120
  // JSON (default)
@@ -103,13 +128,16 @@ export async function GET(request: Request) {
103
128
  }
104
129
  } else {
105
130
  // Remote: use mcp-remote (standard stdio-to-HTTP bridge)
106
- args = [
107
- "-y",
108
- "mcp-remote",
109
- baseUrl,
110
- "--header",
111
- `X-API-Key:${maskKey ? displayKey : actualKey}`,
112
- ];
131
+ args = ["-y", "mcp-remote", baseUrl];
132
+ if (isHttp && !isLocalhost) {
133
+ args.push("--allow-http");
134
+ }
135
+ if (!isRpiLan && !isLocalhost && apiKey) {
136
+ args.push(
137
+ "--header",
138
+ `X-API-Key:${maskKey ? displayKey : actualKey}`,
139
+ );
140
+ }
113
141
  }
114
142
 
115
143
  config = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cybermem/dashboard",
3
- "version": "0.14.6",
3
+ "version": "0.14.10",
4
4
  "description": "CyberMem Monitoring Dashboard",
5
5
  "homepage": "https://cybermem.dev",
6
6
  "repository": {