@zeph-to/mcp-server 1.0.0 → 1.1.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 +9 -1
- package/dist/api-client.d.ts +6 -4
- package/dist/api-client.d.ts.map +1 -1
- package/dist/tools/file.d.ts.map +1 -1
- package/dist/tools/file.js +1 -4
- package/dist/tools/notify.d.ts.map +1 -1
- package/dist/tools/notify.js +30 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,15 @@ Zeph MCP server for AI agents. Send notifications, copy to clipboard, request co
|
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The easiest way to set up for all agents at once:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @zeph-to/hook-sdk install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This saves credentials to `~/.zeph/config.json` and configures your agents automatically. The MCP server reads from this file — no env vars needed.
|
|
14
|
+
|
|
15
|
+
### Claude Code (manual)
|
|
8
16
|
|
|
9
17
|
Add to `~/.claude/settings.json`:
|
|
10
18
|
|
package/dist/api-client.d.ts
CHANGED
|
@@ -17,10 +17,12 @@ export declare class ZephApiClient {
|
|
|
17
17
|
priority?: string;
|
|
18
18
|
targetDeviceId?: string;
|
|
19
19
|
channelId?: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
files?: {
|
|
21
|
+
fileKey: string;
|
|
22
|
+
fileName: string;
|
|
23
|
+
fileSize: number;
|
|
24
|
+
fileType: string;
|
|
25
|
+
}[];
|
|
24
26
|
}): Promise<PushResponse>;
|
|
25
27
|
triggerHook(hookId: string, params: {
|
|
26
28
|
title: string;
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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E,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAQjF,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIrD,gBAAgB,IAAI,OAAO,CAAC,eAAe,CAAC;IAI5C,YAAY,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAIzC,aAAa,CAAC,MAAM,EAAE;QAC1B,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI5B,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAYpE,OAAO;CAsCtB"}
|
package/dist/tools/file.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/tools/file.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,EAAE,QAAQ,aAAa,EAAE,QAAQ,eAAe,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/tools/file.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,EAAE,QAAQ,aAAa,EAAE,QAAQ,eAAe,SA2CjG,CAAC"}
|
package/dist/tools/file.js
CHANGED
|
@@ -29,10 +29,7 @@ const registerFileTool = (server, client, config) => {
|
|
|
29
29
|
const result = await client.sendPush({
|
|
30
30
|
title: title ?? fileName,
|
|
31
31
|
type: 'file',
|
|
32
|
-
fileKey: upload.data.fileKey,
|
|
33
|
-
fileName,
|
|
34
|
-
fileSize,
|
|
35
|
-
fileType,
|
|
32
|
+
files: [{ fileKey: upload.data.fileKey, fileName, fileSize, fileType }],
|
|
36
33
|
targetDeviceId: targetDeviceId ?? config.deviceId,
|
|
37
34
|
});
|
|
38
35
|
return (0, error_format_js_1.textResult)({ pushId: result.data.pushId, fileKey: upload.data.fileKey, fileSize });
|
|
@@ -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,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,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,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAWpD,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,EAAE,QAAQ,aAAa,EAAE,QAAQ,eAAe,SA+DnG,CAAC"}
|
package/dist/tools/notify.js
CHANGED
|
@@ -3,9 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerNotifyTool = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const error_format_js_1 = require("../error-format.js");
|
|
6
|
+
const BODY_FILE_THRESHOLD = 1024;
|
|
7
|
+
const PREVIEW_LENGTH = 200;
|
|
8
|
+
const inferMimeType = (fileName) => {
|
|
9
|
+
const ext = fileName.split('.').pop()?.toLowerCase();
|
|
10
|
+
const map = { md: 'text/markdown', txt: 'text/plain', json: 'application/json' };
|
|
11
|
+
return map[ext ?? ''] ?? 'text/plain';
|
|
12
|
+
};
|
|
6
13
|
const registerNotifyTool = (server, client, config) => {
|
|
7
14
|
server.registerTool('zeph_notify', {
|
|
8
|
-
description: 'Send a one-way push notification to the user\'s devices. Use this to inform the user about task completion, errors, or status updates.',
|
|
15
|
+
description: 'Send a one-way push notification to the user\'s devices. Use this to inform the user about task completion, errors, or status updates. Long bodies (>1KB) are automatically uploaded as a file for full viewing.',
|
|
9
16
|
annotations: {
|
|
10
17
|
readOnlyHint: false,
|
|
11
18
|
destructiveHint: false,
|
|
@@ -23,13 +30,34 @@ const registerNotifyTool = (server, client, config) => {
|
|
|
23
30
|
},
|
|
24
31
|
}, async ({ title, body, url, priority, targetDeviceId }) => {
|
|
25
32
|
try {
|
|
33
|
+
const deviceId = targetDeviceId ?? config.deviceId;
|
|
34
|
+
const bodyBytes = body ? new TextEncoder().encode(body).byteLength : 0;
|
|
35
|
+
const isLongBody = bodyBytes > BODY_FILE_THRESHOLD;
|
|
36
|
+
if (isLongBody && body) {
|
|
37
|
+
const fileName = 'response.md';
|
|
38
|
+
const fileType = inferMimeType(fileName);
|
|
39
|
+
const fileSize = bodyBytes;
|
|
40
|
+
const upload = await client.requestUpload({ fileName, fileType, fileSize });
|
|
41
|
+
await client.uploadToS3(upload.data.uploadUrl, body, fileType);
|
|
42
|
+
const preview = body.length > PREVIEW_LENGTH ? body.slice(0, PREVIEW_LENGTH) + '...' : body;
|
|
43
|
+
const result = await client.sendPush({
|
|
44
|
+
title,
|
|
45
|
+
body: preview,
|
|
46
|
+
url,
|
|
47
|
+
type: 'file',
|
|
48
|
+
priority,
|
|
49
|
+
files: [{ fileKey: upload.data.fileKey, fileName, fileSize, fileType }],
|
|
50
|
+
targetDeviceId: deviceId,
|
|
51
|
+
});
|
|
52
|
+
return (0, error_format_js_1.textResult)({ pushId: result.data.pushId, fileKey: upload.data.fileKey, autoFile: true });
|
|
53
|
+
}
|
|
26
54
|
const result = await client.sendPush({
|
|
27
55
|
title,
|
|
28
56
|
body,
|
|
29
57
|
url,
|
|
30
58
|
type: 'hook',
|
|
31
59
|
priority,
|
|
32
|
-
targetDeviceId:
|
|
60
|
+
targetDeviceId: deviceId,
|
|
33
61
|
});
|
|
34
62
|
return (0, error_format_js_1.textResult)({ pushId: result.data.pushId });
|
|
35
63
|
}
|