@cybermem/dashboard 0.14.6 → 0.14.8
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 +13 -0
- package/app/api/mcp-config/route.ts +42 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @cybermem/dashboard
|
|
2
2
|
|
|
3
|
+
## 0.14.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Automated patch version bump.
|
|
8
|
+
|
|
9
|
+
## 0.14.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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
|
|
14
|
+
fix(dashboard): update mcp-config API to support SSE and --allow-http
|
|
15
|
+
|
|
3
16
|
## 0.14.6
|
|
4
17
|
|
|
5
18
|
### 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
|
-
|
|
54
|
-
"http://localhost:8626/
|
|
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(
|
|
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:
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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 = {
|