@zeph-to/mcp-server 1.4.1 → 1.5.0

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
@@ -49,11 +49,11 @@ Add to `~/.claude/settings.json`:
49
49
  | Variable | Required | Description |
50
50
  |----------|----------|-------------|
51
51
  | `ZEPH_API_KEY` | Yes* | API key from Settings > API Keys |
52
- | `ZEPH_HOOK_ID` | No | Hook ID for interactive tools (`zeph_prompt`, `zeph_input`) |
53
- | `ZEPH_DEVICE_ID` | No | Target device ID. Omit to send to all devices |
52
+ | `ZEPH_HOOK_ID` | No | Hook ID (optional — only needed for interactive tools like `zeph_ask`/`zeph_prompt`/`zeph_input`) |
53
+ | `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 |
54
54
  | `ZEPH_BASE_URL` | No | API base URL (default: `https://api.zeph.to/v1`) |
55
55
 
56
- \* All env vars fall back to `~/.zeph/config.json` if not set or if the value is an unresolved `${...}` interpolation.
56
+ \* If env vars are not set, the server reads from `~/.zeph/config.json` (created by `npx @zeph-to/hook-sdk install`). Unresolved `${...}` interpolations are also treated as unset.
57
57
 
58
58
  ## Tools
59
59
 
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0JH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,CAwD5E,CAAC;AA4BF,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,M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@@ -111,15 +111,22 @@ const initCrypto = (apiKey, baseUrl) => {
111
111
  const stored = loadStoredKeys();
112
112
  // Try server sync if API key available
113
113
  if (apiKey) {
114
- const serverKeys = await fetchServerKeys(apiKey, baseUrl);
115
- if (serverKeys) {
116
- if (!stored || stored.publicKey !== serverKeys.publicKey) {
117
- storeKeys(serverKeys);
114
+ const serverResult = await fetchServerKeys(apiKey, baseUrl);
115
+ // Server says encryption disabled — skip crypto init
116
+ if (serverResult && !serverResult.encryptionEnabled) {
117
+ cachedKeyPair = null;
118
+ cachedExportedPublicKey = null;
119
+ cachedOwnPublicKey = null;
120
+ return '';
121
+ }
122
+ if (serverResult?.keys) {
123
+ if (!stored || stored.publicKey !== serverResult.keys.publicKey) {
124
+ storeKeys(serverResult.keys);
118
125
  }
119
- cachedKeyPair = await importKeyPair(serverKeys);
120
- cachedExportedPublicKey = serverKeys.publicKey;
126
+ cachedKeyPair = await importKeyPair(serverResult.keys);
127
+ cachedExportedPublicKey = serverResult.keys.publicKey;
121
128
  cachedOwnPublicKey = cachedKeyPair.publicKey;
122
- return serverKeys.publicKey;
129
+ return serverResult.keys.publicKey;
123
130
  }
124
131
  if (stored) {
125
132
  await uploadServerKeys(stored, apiKey, baseUrl);
@@ -158,7 +165,6 @@ const initCrypto = (apiKey, baseUrl) => {
158
165
  return initPromise;
159
166
  };
160
167
  exports.initCrypto = initCrypto;
161
- // ─── Server key sync helpers ───
162
168
  const fetchServerKeys = async (apiKey, baseUrl) => {
163
169
  try {
164
170
  const url = `${(baseUrl ?? 'https://api.zeph.to/v1').replace(/\/$/, '')}/users/me/keys`;
@@ -167,7 +173,11 @@ const fetchServerKeys = async (apiKey, baseUrl) => {
167
173
  return null;
168
174
  const json = await res.json();
169
175
  const keys = json.data?.encryptionKeys;
170
- return keys?.publicKey && keys?.privateKey ? keys : null;
176
+ const encryptionEnabled = json.data?.encryptionEnabled ?? (keys ? true : false);
177
+ return {
178
+ keys: keys?.publicKey && keys?.privateKey ? keys : null,
179
+ encryptionEnabled,
180
+ };
171
181
  }
172
182
  catch {
173
183
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeph-to/mcp-server",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
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",