@imenam/mcp-gui-interface 1.0.10 → 1.0.11

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/README.md CHANGED
@@ -174,6 +174,21 @@ await proxy.unregister();
174
174
  - Registration HTTP timeout: **1000 ms** (unregister: **2000 ms**).
175
175
  - On failure, `RegisterResult.port` is **`0`** in the current implementation.
176
176
 
177
+ **Grouping (`group` / `APP_GROUP`):** pass an optional `group` in the register
178
+ options to place the app under a collapsible section (folded by default) in the
179
+ proxy dashboard. Apps sharing the same `group` are shown together; apps without
180
+ one land in a default "ungrouped" section. When `group` is omitted, `register`
181
+ falls back to the **`APP_GROUP`** environment variable, so an MCP can enable
182
+ grouping purely from its `.env` without touching code:
183
+
184
+ ```typescript
185
+ // Explicit:
186
+ await proxy.register({ path: "/my-app", name: "My App", group: "Google" });
187
+
188
+ // Or, with APP_GROUP=Google in the environment, simply:
189
+ await proxy.register({ path: "/my-app", name: "My App" });
190
+ ```
191
+
177
192
  > **Older npm versions** may have exposed `register(options, fallbackPort)`. Check `node_modules/@imenam/mcp-gui-interface/dist/src/proxy-client.d.ts` for the exact signature you have installed.
178
193
 
179
194
  **`getStatus()`:** `"connected" | "fallback" | "error"` — many failure paths set `"error"`.
@@ -13,6 +13,14 @@ export class ProxyClient {
13
13
  }
14
14
  async register(options) {
15
15
  this.registeredPath = options.path;
16
+ // The group can be provided explicitly or, more conveniently, through the
17
+ // APP_GROUP env var — so any MCP using this library can opt into grouping
18
+ // from its .env alone. An empty/whitespace value means "ungrouped".
19
+ const rawGroup = options.group ?? process.env.APP_GROUP;
20
+ const group = typeof rawGroup === "string" && rawGroup.trim() !== ""
21
+ ? rawGroup.trim()
22
+ : undefined;
23
+ const payload = { ...options, ...(group ? { group } : {}) };
16
24
  return new Promise((resolve) => {
17
25
  let url;
18
26
  try {
@@ -77,7 +85,7 @@ export class ProxyClient {
77
85
  this.status = "error";
78
86
  resolve({ success: false, port: 0, error: "Timeout" });
79
87
  });
80
- req.write(JSON.stringify(options));
88
+ req.write(JSON.stringify(payload));
81
89
  req.end();
82
90
  });
83
91
  }
@@ -21,6 +21,16 @@ export interface RegisterOptions {
21
21
  path: string;
22
22
  name?: string;
23
23
  port?: number;
24
+ /**
25
+ * Optional visual group. The proxy dashboard places every app sharing the
26
+ * same `group` under one collapsible section (folded by default). Apps left
27
+ * without a group land in a default "ungrouped" section.
28
+ *
29
+ * When omitted, {@link ProxyClient.register} falls back to the `APP_GROUP`
30
+ * environment variable, so an MCP can enable grouping purely from its `.env`
31
+ * without touching code.
32
+ */
33
+ group?: string;
24
34
  }
25
35
  export interface Logger {
26
36
  debug: (message: string, ...meta: unknown[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imenam/mcp-gui-interface",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Shared library for MCP GUI lifecycle management — spawning, IPC, proxy registration, logging",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",