@zeph-to/mcp-server 1.14.0 → 1.14.1

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
@@ -5,7 +5,9 @@
5
5
  [![node](https://img.shields.io/node/v/@zeph-to/mcp-server.svg)](https://nodejs.org)
6
6
  [![license](https://img.shields.io/npm/l/@zeph-to/mcp-server.svg)](./LICENSE)
7
7
 
8
- Zeph MCP server for AI agents. Send notifications, copy to clipboard, request confirmations, and collect text input from users across their devices — all via the [Model Context Protocol](https://modelcontextprotocol.io).
8
+ Zeph MCP server the agent side of the round trip. Your agent finishes a build or hits a decision, calls `zeph_ask`, and the question lands on the user's phone as buttons + a text field; the reply comes back into the same tool call and the agent keeps going. Also: one-way notifications, clipboard, files, and channel broadcasts — all via the [Model Context Protocol](https://modelcontextprotocol.io).
9
+
10
+ Works with Claude Code, Cursor, Windsurf, Gemini CLI, and any MCP client. Part of the Zeph toolchain: [`@zeph-to/cli`](https://github.com/zeph-to/cli) (installer, push CLI, tmux remote control) · [`zeph-to/plugin`](https://github.com/zeph-to/plugin) (Claude Code plugin bundling this server) · the [Zeph app](https://zeph.to) on your phone.
9
11
 
10
12
  ## Setup
11
13
 
@@ -57,12 +59,17 @@ Add to `~/.claude/settings.json`:
57
59
  | `ZEPH_HOOK_ID` | No | Hook ID (optional — only needed for interactive tools like `zeph_ask`/`zeph_prompt`/`zeph_input`) |
58
60
  | `ZEPH_DEVICE_ID` | No | Target device ID (optional — only needed for interactive tools like `zeph_ask`/`zeph_prompt`/`zeph_input`). Omit to send to all devices |
59
61
  | `ZEPH_BASE_URL` | No | API base URL (default: `https://api.zeph.to/v1`) |
62
+ | `ZEPH_WS_URL` | No | WebSocket endpoint for the hook-response fast path — `zeph_ask`/`zeph_prompt`/`zeph_input` answers arrive the moment the user submits them instead of on the next poll. Falls back to pure polling when unset. Also read from `wsUrl` in `~/.zeph/config.json` |
60
63
  | `ZEPH_DISABLE_SESSION_CACHE` | No | Set to `1`/`true` to skip writing the session-id handoff file under `~/.cache/zeph/`. Useful for read-only filesystems, ephemeral CI runners, or sandboxed envs that audit filesystem writes. The plugin's stop hook still works without it (transcript-path UUID extraction is the primary path; the cache is a fallback for older Claude Code versions). |
64
+ | `ZEPH_SESSION_ID` | No | Override the session id attached to pushes (grouping in the app). Auto-detected from the newest Claude Code transcript when unset |
65
+ | `ZEPH_DISABLE_ENCRYPTION` | No | Set to `1`/`true` to force E2E-style push encryption off, even when the account has keys. Useful while cleaning up legacy key state |
61
66
 
62
67
  \* If env vars are not set, the server reads from `~/.zeph/config.json` (created by `npx @zeph-to/cli install`). Unresolved `${...}` interpolations are also treated as unset.
63
68
 
64
69
  ## Tools
65
70
 
71
+ Push titles are automatically prefixed with the project directory name — `myapp · Build complete` — so the phone feed stays scannable when several sessions push at once.
72
+
66
73
  ### zeph_notify
67
74
 
68
75
  Send a one-way push notification. Supports optional URL (auto-switches to link type).
@@ -188,7 +195,7 @@ Returns: `{ value: "feat: add clipboard sync", timedOut: false }`
188
195
 
189
196
  ### Client timeouts
190
197
 
191
- `zeph_ask`, `zeph_prompt`, and `zeph_input` block until the user responds, up to their `timeout` (max 600s). That whole time the MCP request stays open. To keep the client from giving up early, the server emits a `notifications/progress` every 5s while waiting. Clients must either set a per-request timeout above the tool's `timeout`, or reset their timeout on progress notifications. Claude Code does the latter by default.
198
+ `zeph_ask`, `zeph_prompt`, and `zeph_input` block until the user responds, up to their `timeout` (max 600s). With `ZEPH_WS_URL` configured the response arrives over WebSocket the instant it's submitted; otherwise the server polls. Either way the MCP request stays open the whole time. To keep the client from giving up early, the server emits a `notifications/progress` every 5s while waiting. Clients must either set a per-request timeout above the tool's `timeout`, or reset their timeout on progress notifications. Claude Code does the latter by default.
192
199
 
193
200
  ## Resources
194
201
 
@@ -207,13 +214,27 @@ Lists channels the user owns or subscribes to. Use to find `channelId` for `zeph
207
214
  | Situation | Tool | Example |
208
215
  |-----------|------|---------|
209
216
  | Long task finished | `zeph_notify` | Build complete, test results, deploy done |
210
- | Need user decision | `zeph_prompt` | Choose deploy target, confirm destructive action |
211
- | Need free-form input | `zeph_input` | Commit message, env var value, description |
217
+ | Need a decision (buttons + optional free text) | `zeph_ask` | "Tests green. Deploy?" with a custom-instruction escape hatch |
218
+ | Decision from fixed options only | `zeph_prompt` | Choose deploy target, confirm destructive action |
219
+ | Free-form input only | `zeph_input` | Commit message, env var value, description |
212
220
  | Share code/logs | `zeph_file` | Error logs, test reports, generated config |
213
221
  | Share snippet | `zeph_clipboard` | API key, URL, shell command |
214
222
 
215
223
  ### Recommended patterns
216
224
 
225
+ **Decision gate with an escape hatch (preferred):**
226
+ ```
227
+ zeph_ask(
228
+ title: "Tests green. Deploy to production?",
229
+ actions: [
230
+ { id: "deploy", label: "Deploy", style: "primary" },
231
+ { id: "hold", label: "Hold", style: "secondary" }
232
+ ],
233
+ placeholder: "Or tell me what to do instead...",
234
+ fallback: "hold"
235
+ )
236
+ ```
237
+
217
238
  **Task completion notification:**
218
239
  ```
219
240
  zeph_notify(
@@ -271,7 +292,7 @@ The API key needs the following scopes:
271
292
 
272
293
  - `push:read` — for `zeph_list`
273
294
  - `push:write` — for `zeph_notify`, `zeph_clipboard`, `zeph_dismiss`, `zeph_dismiss_all`, `zeph_file`
274
- - `hook:write` — for `zeph_prompt` and `zeph_input`
295
+ - `hook:write` — for `zeph_ask`, `zeph_prompt`, and `zeph_input`
275
296
  - `channel:read` — for `zeph://channels` resource
276
297
 
277
298
  Create an API key with the **MCP** preset in Settings > API Keys for the correct permissions.
package/dist/crypto.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Device-shared encryption for MCP server — self-contained ECDH P-256 +
3
3
  * AES-256-GCM. Mirrors @zeph/crypto API but bundled inline (no external
4
- * dependency). Uses Web Crypto API (globalThis.crypto.subtle) — Node.js 18+.
4
+ * dependency). Uses Web Crypto API via node:crypto webcrypto — Node.js 18+
5
+ * (the `crypto` global only exists unflagged from Node 19, so we import it).
5
6
  *
6
7
  * Threat model honesty (do not call this "E2E" without a footnote):
7
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAoJH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,CAsE5E,CAAC;AA8BF,eAAO,MAAM,UAAU,QAAO,aAAa,GAAG,IAAqB,CAAC;AACpE,eAAO,MAAM,YAAY,QAAO,MAAM,GAAG,IAA+B,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,KACrD,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,CAAC;CACnB,CAaA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,MAAM,KACd,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAQlE,CAAC"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA0JH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,CAsE5E,CAAC;AAmCF,eAAO,MAAM,UAAU,QAAO,aAAa,GAAG,IAAqB,CAAC;AACpE,eAAO,MAAM,YAAY,QAAO,MAAM,GAAG,IAA+B,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,KACrD,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,CAAC;CACnB,CAaA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,MAAM,KACd,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAQlE,CAAC"}
package/dist/crypto.js CHANGED
@@ -2,7 +2,8 @@
2
2
  /**
3
3
  * Device-shared encryption for MCP server — self-contained ECDH P-256 +
4
4
  * AES-256-GCM. Mirrors @zeph/crypto API but bundled inline (no external
5
- * dependency). Uses Web Crypto API (globalThis.crypto.subtle) — Node.js 18+.
5
+ * dependency). Uses Web Crypto API via node:crypto webcrypto — Node.js 18+
6
+ * (the `crypto` global only exists unflagged from Node 19, so we import it).
6
7
  *
7
8
  * Threat model honesty (do not call this "E2E" without a footnote):
8
9
  *
@@ -33,6 +34,11 @@ exports.encryptFileForSelf = exports.encryptPushBodyForSelf = exports.getPublicK
33
34
  const fs_1 = require("fs");
34
35
  const os_1 = require("os");
35
36
  const path_1 = require("path");
37
+ const node_crypto_1 = require("node:crypto");
38
+ // Node 18 has no `crypto` global (unflagged only from 19.0.0) — resolve the
39
+ // Web Crypto implementation explicitly so encryption works on the declared
40
+ // minimum runtime instead of silently staying disabled.
41
+ const crypto = node_crypto_1.webcrypto;
36
42
  // ─── Base64 helpers ───
37
43
  const toBase64 = (buffer) => Buffer.from(buffer).toString('base64');
38
44
  const fromBase64 = (base64) => {
@@ -208,7 +214,12 @@ exports.initCrypto = initCrypto;
208
214
  const fetchServerKeys = async (apiKey, baseUrl) => {
209
215
  try {
210
216
  const url = `${baseUrl.replace(/\/$/, '')}/users/me/keys`;
211
- const res = await fetch(url, { headers: { 'X-API-Key': apiKey } });
217
+ // Bounded: index.ts awaits initCrypto before connecting the MCP
218
+ // transport, so a hanging fetch here would block server startup.
219
+ const res = await fetch(url, {
220
+ headers: { 'X-API-Key': apiKey },
221
+ signal: AbortSignal.timeout(5_000),
222
+ });
212
223
  if (!res.ok)
213
224
  return null;
214
225
  const json = await res.json();
@@ -1 +1 @@
1
- {"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../src/tools/notify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AASrE,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,EAAE,QAAQ,aAAa,EAAE,QAAQ,eAAe,SAmHnG,CAAC"}
1
+ {"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../src/tools/notify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AASrE,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,EAAE,QAAQ,aAAa,EAAE,QAAQ,eAAe,SA2HnG,CAAC"}
@@ -48,6 +48,7 @@ const registerNotifyTool = (server, client, config) => {
48
48
  let uploadContentType = fileType;
49
49
  let fileIv;
50
50
  let fileEncryptedKey;
51
+ let fileEncrypted = false;
51
52
  if (canEncrypt) {
52
53
  try {
53
54
  const encrypted = await (0, crypto_js_1.encryptFileForSelf)(fileMarkdown);
@@ -55,6 +56,7 @@ const registerNotifyTool = (server, client, config) => {
55
56
  uploadContentType = 'application/octet-stream';
56
57
  fileIv = encrypted.iv;
57
58
  fileEncryptedKey = encrypted.encryptedKey;
59
+ fileEncrypted = true;
58
60
  }
59
61
  catch (err) {
60
62
  console.error('[Crypto] File encryption failed, sending plaintext:', err);
@@ -74,17 +76,21 @@ const registerNotifyTool = (server, client, config) => {
74
76
  targetDeviceId: deviceId,
75
77
  sessionId: config.sessionId,
76
78
  };
79
+ let pushEncrypted = false;
77
80
  if (canEncrypt) {
78
81
  try {
79
82
  const enc = await (0, crypto_js_1.encryptPushBodyForSelf)({ title: pushTitle, body: preview, url });
80
83
  pushPayload = { ...pushPayload, title: undefined, body: enc.body, isEncrypted: enc.isEncrypted, encryptedKey: enc.encryptedKey, senderPublicKey: enc.senderPublicKey };
84
+ pushEncrypted = true;
81
85
  }
82
86
  catch (err) {
83
87
  console.error('[Crypto] Push encryption failed, sending plaintext:', err);
84
88
  }
85
89
  }
86
90
  const result = await client.sendPush(pushPayload);
87
- return (0, error_format_js_1.textResult)({ pushId: result.data.pushId, fileKey: upload.data.fileKey, autoFile: true, encrypted: canEncrypt });
91
+ // Report what actually went out an encryption failure above falls
92
+ // back to plaintext, so `canEncrypt` alone would over-claim.
93
+ return (0, error_format_js_1.textResult)({ pushId: result.data.pushId, fileKey: upload.data.fileKey, autoFile: true, encrypted: fileEncrypted && pushEncrypted });
88
94
  }
89
95
  // Short body — encrypt push only
90
96
  let pushPayload = {
@@ -96,17 +102,19 @@ const registerNotifyTool = (server, client, config) => {
96
102
  targetDeviceId: deviceId,
97
103
  sessionId: config.sessionId,
98
104
  };
105
+ let pushEncrypted = false;
99
106
  if (canEncrypt) {
100
107
  try {
101
108
  const enc = await (0, crypto_js_1.encryptPushBodyForSelf)({ title: pushTitle, body: cleanBody, url });
102
109
  pushPayload = { ...pushPayload, title: undefined, body: enc.body, isEncrypted: enc.isEncrypted, encryptedKey: enc.encryptedKey, senderPublicKey: enc.senderPublicKey };
110
+ pushEncrypted = true;
103
111
  }
104
112
  catch (err) {
105
113
  console.error('[Crypto] Push encryption failed, sending plaintext:', err);
106
114
  }
107
115
  }
108
116
  const result = await client.sendPush(pushPayload);
109
- return (0, error_format_js_1.textResult)({ pushId: result.data.pushId, encrypted: canEncrypt });
117
+ return (0, error_format_js_1.textResult)({ pushId: result.data.pushId, encrypted: pushEncrypted });
110
118
  }
111
119
  catch (err) {
112
120
  return (0, error_format_js_1.formatToolError)(err);
@@ -1 +1 @@
1
- {"version":3,"file":"ws-wait.d.ts","sourceRoot":"","sources":["../src/ws-wait.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,MAAM,WAAW,MAAM;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;KAAE,KAAK,IAAI,GAAG,IAAI,CAAC;CACxF;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAMhD,MAAM,WAAW,gBAAgB;IAC7B,2EAA2E;IAC3E,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,+DAA+D;IAC/D,WAAW,IAAI,OAAO,CAAC;IACvB,OAAO,IAAI,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB;AAQD,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAY;IACrC,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,SAAS,CAA+C;IAChE,OAAO,CAAC,SAAS,CAA8C;gBAEnD,IAAI,EAAE,yBAAyB;IAM3C,uEAAuE;IACvE,OAAO,IAAI,OAAO;IAIlB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAgB5C,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,cAAc;CAUzB"}
1
+ {"version":3,"file":"ws-wait.d.ts","sourceRoot":"","sources":["../src/ws-wait.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,MAAM,WAAW,MAAM;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;KAAE,KAAK,IAAI,GAAG,IAAI,CAAC;CACxF;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAMhD,MAAM,WAAW,gBAAgB;IAC7B,2EAA2E;IAC3E,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,+DAA+D;IAC/D,WAAW,IAAI,OAAO,CAAC;IACvB,OAAO,IAAI,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB;AAQD,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAY;IACrC,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,SAAS,CAA+C;IAChE,OAAO,CAAC,SAAS,CAA8C;gBAEnD,IAAI,EAAE,yBAAyB;IAM3C,uEAAuE;IACvE,OAAO,IAAI,OAAO;IAIlB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAgB5C,OAAO,CAAC,YAAY;IAmCpB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,cAAc;CAUzB"}
package/dist/ws-wait.js CHANGED
@@ -72,9 +72,15 @@ class HookResponseWaiter {
72
72
  return;
73
73
  try {
74
74
  const sep = this.wsUrl.includes('?') ? '&' : '?';
75
+ // KNOWN TRADEOFF: apiKey rides the query string — the WHATWG
76
+ // WebSocket (Node 21+ global) can't set headers, and the API GW
77
+ // $connect route authenticates on the query param. It can land in
78
+ // gateway access logs; first-message auth needs a server change.
75
79
  const sock = this.factory(`${this.wsUrl}${sep}apiKey=${encodeURIComponent(this.apiKey)}`);
76
80
  this.sock = sock;
77
81
  sock.addEventListener('open', () => {
82
+ if (this.sock !== sock)
83
+ return; // stale socket — already replaced
78
84
  this.connected = true;
79
85
  this.pingTimer = setInterval(() => {
80
86
  try {
@@ -88,7 +94,12 @@ class HookResponseWaiter {
88
94
  this.pingTimer.unref?.();
89
95
  });
90
96
  sock.addEventListener('message', (event) => this.handleMessage(event.data));
91
- const drop = () => this.teardownSocket();
97
+ // Guard against stale events: 'error' and 'close' both fire on a
98
+ // dying socket, and a new subscribe() may have already created a
99
+ // replacement between them — a late event from the old socket
100
+ // must not tear down the new one.
101
+ const drop = () => { if (this.sock === sock)
102
+ this.teardownSocket(); };
92
103
  sock.addEventListener('close', drop);
93
104
  sock.addEventListener('error', drop);
94
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeph-to/mcp-server",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "Zeph MCP server — AI agent notifications, prompts, and input via MCP protocol",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",