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 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` | read | Prepare a draft and get one keyless `npx yungle-cli put …` command per file, for an assistant with a shell |
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.0" : "dev";
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
- server.registerTool(
363
- "create_transfer",
364
- {
365
- title: "Prepare a transfer",
366
- description: [
367
- "Prepare a draft transfer for files that live on a machine with a shell, and return one",
368
- "upload command per file. Each command (`npx -y yungle-cli put \u2026`) needs no Yungle key: it",
369
- "carries a token that can write only that file, for two hours, and it resumes if interrupted.",
370
- "Nothing is shared and nobody is emailed until the transfer is finalized."
371
- ].join("\n"),
372
- inputSchema: {
373
- files: z.array(
374
- z.object({
375
- name: z.string(),
376
- size: z.number().int().nonnegative().describe("Exact byte size."),
377
- path: z.string().optional().describe("Folder within the upload."),
378
- localPath: z.string().optional().describe("Where the file is on the machine that will run the command.")
379
- })
380
- ).min(1).max(500),
381
- title: z.string().optional().describe("Label for the dashboard; never shown to recipients."),
382
- expiresInDays: z.number().int().positive().optional()
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
- annotations: { title: "Prepare a transfer", readOnlyHint: false, destructiveHint: false, idempotentHint: false }
385
- },
386
- async ({ files, title, expiresInDays }) => {
387
- try {
388
- const created = await client.createTransfer({
389
- files: files.map(({ localPath: _local, ...f }) => f),
390
- title,
391
- expiresInDays
392
- });
393
- return ok({
394
- transferId: created.transfer.id,
395
- // Said in the payload, not only the description: the payload is what a
396
- // model summarises back to the user.
397
- status: "draft \u2014 nothing uploaded yet, nobody emailed",
398
- uploadCommands: created.files.map((t, i) => ({
399
- name: t.name,
400
- command: `npx -y yungle-cli@latest put ${shellQuote(files[i].localPath ?? `./${t.name}`)} --target ${packTarget({
401
- e: created.tusEndpoint,
402
- i: t.id,
403
- t: t.uploadToken,
404
- n: t.name,
405
- s: t.size
406
- })}`
407
- })),
408
- 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.",
409
- expiresAt: created.transfer.expiresAt
410
- });
411
- } catch (err) {
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.0" : "dev";
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.0" : "dev";
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
- server.registerTool(
928
- "create_transfer",
929
- {
930
- title: "Prepare a transfer",
931
- description: [
932
- "Prepare a draft transfer for files that live on a machine with a shell, and return one",
933
- "upload command per file. Each command (`npx -y yungle-cli put \u2026`) needs no Yungle key: it",
934
- "carries a token that can write only that file, for two hours, and it resumes if interrupted.",
935
- "Nothing is shared and nobody is emailed until the transfer is finalized."
936
- ].join("\n"),
937
- inputSchema: {
938
- files: z.array(
939
- z.object({
940
- name: z.string(),
941
- size: z.number().int().nonnegative().describe("Exact byte size."),
942
- path: z.string().optional().describe("Folder within the upload."),
943
- localPath: z.string().optional().describe("Where the file is on the machine that will run the command.")
944
- })
945
- ).min(1).max(500),
946
- title: z.string().optional().describe("Label for the dashboard; never shown to recipients."),
947
- expiresInDays: z.number().int().positive().optional()
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
- annotations: { title: "Prepare a transfer", readOnlyHint: false, destructiveHint: false, idempotentHint: false }
950
- },
951
- async ({ files, title, expiresInDays }) => {
952
- try {
953
- const created = await client.createTransfer({
954
- files: files.map(({ localPath: _local, ...f }) => f),
955
- title,
956
- expiresInDays
957
- });
958
- return ok({
959
- transferId: created.transfer.id,
960
- // Said in the payload, not only the description: the payload is what a
961
- // model summarises back to the user.
962
- status: "draft \u2014 nothing uploaded yet, nobody emailed",
963
- uploadCommands: created.files.map((t, i) => ({
964
- name: t.name,
965
- command: `npx -y yungle-cli@latest put ${shellQuote(files[i].localPath ?? `./${t.name}`)} --target ${packTarget({
966
- e: created.tusEndpoint,
967
- i: t.id,
968
- t: t.uploadToken,
969
- n: t.name,
970
- s: t.size
971
- })}`
972
- })),
973
- 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.",
974
- expiresAt: created.transfer.expiresAt
975
- });
976
- } catch (err) {
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.0",
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.0"
18
+ "yungle-client": "^0.3.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^22.10.5",