yungle-mcp 0.3.0 → 0.3.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 +1 -1
- package/dist/index.mjs +55 -53
- package/dist/server.mjs +60 -54
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Or by hand:
|
|
|
61
61
|
| `get_account`, `list_transfers`, `get_transfer`, `get_transfer_downloads`, `list_collections`, `get_collection`, `list_collection_files`, `list_folders`, `list_guests`, `list_contacts`, `list_upload_requests`, `get_upload_request` | read | Answer questions about your transfers, collections, contacts and upload requests |
|
|
62
62
|
| `get_download_links` | read | Signed, resumable download URLs for a link someone shared (`/t/…`, `/c/…`) or your own transfer or collection |
|
|
63
63
|
| `get_import_status` | write | How far the files Yungle is fetching from URLs have got |
|
|
64
|
-
| `create_transfer` |
|
|
64
|
+
| `create_transfer` | write | Prepare a draft and get one keyless `npx yungle-cli put …` command per file, for an assistant with a shell |
|
|
65
65
|
| `finalize_transfer` | write | Make a prepared draft a link. Emails nobody |
|
|
66
66
|
| `share_from_urls` | write | Share files that are already online (a presigned S3 link, a CDN URL) — Yungle fetches them, so any size works, hosted too. Emails nobody |
|
|
67
67
|
| `create_share_link` | write | Turn content the assistant has (up to 25 MB) into a link. Emails nobody |
|
package/dist/index.mjs
CHANGED
|
@@ -121,7 +121,7 @@ async function fetchTo(url, dest, size, doFetch) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// src/server.ts
|
|
124
|
-
var MCP_VERSION = true ? "0.3.
|
|
124
|
+
var MCP_VERSION = true ? "0.3.1" : "dev";
|
|
125
125
|
function createServer(client, opts = { canWrite: false, canEmail: false, local: false }) {
|
|
126
126
|
const server = new McpServer(
|
|
127
127
|
{ name: "yungle", version: MCP_VERSION },
|
|
@@ -359,60 +359,62 @@ function createServer(client, opts = { canWrite: false, canEmail: false, local:
|
|
|
359
359
|
}
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
z.
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
362
|
+
if (opts.canWrite) {
|
|
363
|
+
server.registerTool(
|
|
364
|
+
"create_transfer",
|
|
365
|
+
{
|
|
366
|
+
title: "Prepare a transfer",
|
|
367
|
+
description: [
|
|
368
|
+
"Prepare a draft transfer for files that live on a machine with a shell, and return one",
|
|
369
|
+
"upload command per file. Each command (`npx -y yungle-cli put \u2026`) needs no Yungle key: it",
|
|
370
|
+
"carries a token that can write only that file, for two hours, and it resumes if interrupted.",
|
|
371
|
+
"Nothing is shared and nobody is emailed until the transfer is finalized."
|
|
372
|
+
].join("\n"),
|
|
373
|
+
inputSchema: {
|
|
374
|
+
files: z.array(
|
|
375
|
+
z.object({
|
|
376
|
+
name: z.string(),
|
|
377
|
+
size: z.number().int().nonnegative().describe("Exact byte size."),
|
|
378
|
+
path: z.string().optional().describe("Folder within the upload."),
|
|
379
|
+
localPath: z.string().optional().describe("Where the file is on the machine that will run the command.")
|
|
380
|
+
})
|
|
381
|
+
).min(1).max(500),
|
|
382
|
+
title: z.string().optional().describe("Label for the dashboard; never shown to recipients."),
|
|
383
|
+
expiresInDays: z.number().int().positive().optional()
|
|
384
|
+
},
|
|
385
|
+
annotations: { title: "Prepare a transfer", readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
383
386
|
},
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
return fail(errorText(err));
|
|
387
|
+
async ({ files, title, expiresInDays }) => {
|
|
388
|
+
try {
|
|
389
|
+
const created = await client.createTransfer({
|
|
390
|
+
files: files.map(({ localPath: _local, ...f }) => f),
|
|
391
|
+
title,
|
|
392
|
+
expiresInDays
|
|
393
|
+
});
|
|
394
|
+
return ok({
|
|
395
|
+
transferId: created.transfer.id,
|
|
396
|
+
// Said in the payload, not only the description: the payload is what a
|
|
397
|
+
// model summarises back to the user.
|
|
398
|
+
status: "draft \u2014 nothing uploaded yet, nobody emailed",
|
|
399
|
+
uploadCommands: created.files.map((t, i) => ({
|
|
400
|
+
name: t.name,
|
|
401
|
+
command: `npx -y yungle-cli@latest put ${shellQuote(files[i].localPath ?? `./${t.name}`)} --target ${packTarget({
|
|
402
|
+
e: created.tusEndpoint,
|
|
403
|
+
i: t.id,
|
|
404
|
+
t: t.uploadToken,
|
|
405
|
+
n: t.name,
|
|
406
|
+
s: t.size
|
|
407
|
+
})}`
|
|
408
|
+
})),
|
|
409
|
+
next: "Run each command where the file is. When they have finished, finalize the transfer to get its link \u2014 or upload in the Yungle dashboard instead.",
|
|
410
|
+
expiresAt: created.transfer.expiresAt
|
|
411
|
+
});
|
|
412
|
+
} catch (err) {
|
|
413
|
+
return fail(errorText(err));
|
|
414
|
+
}
|
|
413
415
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
+
);
|
|
417
|
+
}
|
|
416
418
|
if (opts.canWrite) {
|
|
417
419
|
server.registerTool(
|
|
418
420
|
"finalize_transfer",
|
package/dist/server.mjs
CHANGED
|
@@ -222,7 +222,7 @@ function pageQuery(page, extra = {}) {
|
|
|
222
222
|
const q = params.toString();
|
|
223
223
|
return q ? `?${q}` : "";
|
|
224
224
|
}
|
|
225
|
-
var CLIENT_VERSION = true ? "0.3.
|
|
225
|
+
var CLIENT_VERSION = true ? "0.3.1" : "dev";
|
|
226
226
|
var YungleClient = class {
|
|
227
227
|
baseUrl;
|
|
228
228
|
apiKey;
|
|
@@ -262,6 +262,10 @@ var YungleClient = class {
|
|
|
262
262
|
me() {
|
|
263
263
|
return this.request("GET", "/me");
|
|
264
264
|
}
|
|
265
|
+
/** Your invite code and link, and the free months it has earned. */
|
|
266
|
+
getReferral() {
|
|
267
|
+
return this.request("GET", "/me/referral");
|
|
268
|
+
}
|
|
265
269
|
// ── Transfers ─────────────────────────────────────────────────────────────
|
|
266
270
|
/**
|
|
267
271
|
* One page of transfers, newest first — 100 by default, up to 500. Pass the
|
|
@@ -686,7 +690,7 @@ async function fetchTo(url, dest, size, doFetch) {
|
|
|
686
690
|
}
|
|
687
691
|
|
|
688
692
|
// src/server.ts
|
|
689
|
-
var MCP_VERSION = true ? "0.3.
|
|
693
|
+
var MCP_VERSION = true ? "0.3.1" : "dev";
|
|
690
694
|
function createServer(client, opts = { canWrite: false, canEmail: false, local: false }) {
|
|
691
695
|
const server = new McpServer(
|
|
692
696
|
{ name: "yungle", version: MCP_VERSION },
|
|
@@ -924,60 +928,62 @@ function createServer(client, opts = { canWrite: false, canEmail: false, local:
|
|
|
924
928
|
}
|
|
925
929
|
);
|
|
926
930
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
z.
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
931
|
+
if (opts.canWrite) {
|
|
932
|
+
server.registerTool(
|
|
933
|
+
"create_transfer",
|
|
934
|
+
{
|
|
935
|
+
title: "Prepare a transfer",
|
|
936
|
+
description: [
|
|
937
|
+
"Prepare a draft transfer for files that live on a machine with a shell, and return one",
|
|
938
|
+
"upload command per file. Each command (`npx -y yungle-cli put \u2026`) needs no Yungle key: it",
|
|
939
|
+
"carries a token that can write only that file, for two hours, and it resumes if interrupted.",
|
|
940
|
+
"Nothing is shared and nobody is emailed until the transfer is finalized."
|
|
941
|
+
].join("\n"),
|
|
942
|
+
inputSchema: {
|
|
943
|
+
files: z.array(
|
|
944
|
+
z.object({
|
|
945
|
+
name: z.string(),
|
|
946
|
+
size: z.number().int().nonnegative().describe("Exact byte size."),
|
|
947
|
+
path: z.string().optional().describe("Folder within the upload."),
|
|
948
|
+
localPath: z.string().optional().describe("Where the file is on the machine that will run the command.")
|
|
949
|
+
})
|
|
950
|
+
).min(1).max(500),
|
|
951
|
+
title: z.string().optional().describe("Label for the dashboard; never shown to recipients."),
|
|
952
|
+
expiresInDays: z.number().int().positive().optional()
|
|
953
|
+
},
|
|
954
|
+
annotations: { title: "Prepare a transfer", readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
948
955
|
},
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
return fail(errorText(err));
|
|
956
|
+
async ({ files, title, expiresInDays }) => {
|
|
957
|
+
try {
|
|
958
|
+
const created = await client.createTransfer({
|
|
959
|
+
files: files.map(({ localPath: _local, ...f }) => f),
|
|
960
|
+
title,
|
|
961
|
+
expiresInDays
|
|
962
|
+
});
|
|
963
|
+
return ok({
|
|
964
|
+
transferId: created.transfer.id,
|
|
965
|
+
// Said in the payload, not only the description: the payload is what a
|
|
966
|
+
// model summarises back to the user.
|
|
967
|
+
status: "draft \u2014 nothing uploaded yet, nobody emailed",
|
|
968
|
+
uploadCommands: created.files.map((t, i) => ({
|
|
969
|
+
name: t.name,
|
|
970
|
+
command: `npx -y yungle-cli@latest put ${shellQuote(files[i].localPath ?? `./${t.name}`)} --target ${packTarget({
|
|
971
|
+
e: created.tusEndpoint,
|
|
972
|
+
i: t.id,
|
|
973
|
+
t: t.uploadToken,
|
|
974
|
+
n: t.name,
|
|
975
|
+
s: t.size
|
|
976
|
+
})}`
|
|
977
|
+
})),
|
|
978
|
+
next: "Run each command where the file is. When they have finished, finalize the transfer to get its link \u2014 or upload in the Yungle dashboard instead.",
|
|
979
|
+
expiresAt: created.transfer.expiresAt
|
|
980
|
+
});
|
|
981
|
+
} catch (err) {
|
|
982
|
+
return fail(errorText(err));
|
|
983
|
+
}
|
|
978
984
|
}
|
|
979
|
-
|
|
980
|
-
|
|
985
|
+
);
|
|
986
|
+
}
|
|
981
987
|
if (opts.canWrite) {
|
|
982
988
|
server.registerTool(
|
|
983
989
|
"finalize_transfer",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yungle-mcp",
|
|
3
3
|
"mcpName": "co.yungle/yungle",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "MCP server for Yungle: let Claude, Cursor or any MCP client read your file transfers, share files and send them, with your approval.",
|
|
7
7
|
"bin": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
17
17
|
"zod": "^3.24.1",
|
|
18
|
-
"yungle-client": "^0.3.
|
|
18
|
+
"yungle-client": "^0.3.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.10.5",
|