yungle-mcp 0.2.1 → 0.2.2

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/dist/index.mjs CHANGED
@@ -74,7 +74,7 @@ async function uploadPath(endpoint, target, path, size, doFetch = fetch) {
74
74
  }
75
75
 
76
76
  // src/server.ts
77
- var MCP_VERSION = true ? "0.2.1" : "dev";
77
+ var MCP_VERSION = true ? "0.2.2" : "dev";
78
78
  function createServer(client, opts = { canWrite: false, canEmail: false, local: false }) {
79
79
  const server = new McpServer(
80
80
  { name: "yungle", version: MCP_VERSION },
@@ -369,9 +369,11 @@ async function startStdioServer() {
369
369
  const apiKey = process.env.YUNGLE_API_KEY?.trim();
370
370
  if (!apiKey) {
371
371
  process.stderr.write(
372
- "YUNGLE_API_KEY is not set. Create a key at https://yungle.co/dashboard/settings/api\n"
372
+ "YUNGLE_API_KEY is not set: listing tools only. Create a key at https://yungle.co/dashboard/settings/api\n"
373
373
  );
374
- process.exit(2);
374
+ const server2 = createServer(keylessClient(), { canWrite: false, canEmail: false, local: true });
375
+ await server2.connect(new StdioServerTransport());
376
+ return;
375
377
  }
376
378
  const client = new YungleClient({
377
379
  apiKey,
@@ -397,6 +399,12 @@ async function startStdioServer() {
397
399
  });
398
400
  await server.connect(new StdioServerTransport());
399
401
  }
402
+ function keylessClient() {
403
+ const message = "YUNGLE_API_KEY is not set, so this server cannot reach Yungle. Create a key at https://yungle.co/dashboard/settings/api and add it to this MCP server's environment, or connect to the hosted server at https://yungle.co/mcp instead.";
404
+ return new Proxy({}, {
405
+ get: () => () => Promise.reject(new Error(message))
406
+ });
407
+ }
400
408
  function ok(payload) {
401
409
  return { content: [{ type: "text", text: JSON.stringify(payload, null, 2) }] };
402
410
  }
@@ -406,5 +414,6 @@ function fail(message) {
406
414
  export {
407
415
  MCP_VERSION,
408
416
  createServer,
417
+ keylessClient,
409
418
  startStdioServer
410
419
  };
package/dist/server.d.ts CHANGED
@@ -23,3 +23,5 @@ export declare function createServer(client: YungleClient, opts?: ServerOptions)
23
23
  * emails nobody and needs only transfers:write.
24
24
  */
25
25
  export declare function startStdioServer(): Promise<void>;
26
+ /** A client whose every call explains that there is no key. */
27
+ export declare function keylessClient(): YungleClient;
package/dist/server.mjs CHANGED
@@ -345,7 +345,7 @@ async function uploadPath(endpoint, target, path, size, doFetch = fetch) {
345
345
  }
346
346
 
347
347
  // src/server.ts
348
- var MCP_VERSION = true ? "0.2.1" : "dev";
348
+ var MCP_VERSION = true ? "0.2.2" : "dev";
349
349
  function createServer(client, opts = { canWrite: false, canEmail: false, local: false }) {
350
350
  const server = new McpServer(
351
351
  { name: "yungle", version: MCP_VERSION },
@@ -640,9 +640,11 @@ async function startStdioServer() {
640
640
  const apiKey = process.env.YUNGLE_API_KEY?.trim();
641
641
  if (!apiKey) {
642
642
  process.stderr.write(
643
- "YUNGLE_API_KEY is not set. Create a key at https://yungle.co/dashboard/settings/api\n"
643
+ "YUNGLE_API_KEY is not set: listing tools only. Create a key at https://yungle.co/dashboard/settings/api\n"
644
644
  );
645
- process.exit(2);
645
+ const server2 = createServer(keylessClient(), { canWrite: false, canEmail: false, local: true });
646
+ await server2.connect(new StdioServerTransport());
647
+ return;
646
648
  }
647
649
  const client = new YungleClient({
648
650
  apiKey,
@@ -668,6 +670,12 @@ async function startStdioServer() {
668
670
  });
669
671
  await server.connect(new StdioServerTransport());
670
672
  }
673
+ function keylessClient() {
674
+ const message = "YUNGLE_API_KEY is not set, so this server cannot reach Yungle. Create a key at https://yungle.co/dashboard/settings/api and add it to this MCP server's environment, or connect to the hosted server at https://yungle.co/mcp instead.";
675
+ return new Proxy({}, {
676
+ get: () => () => Promise.reject(new Error(message))
677
+ });
678
+ }
671
679
  function ok(payload) {
672
680
  return { content: [{ type: "text", text: JSON.stringify(payload, null, 2) }] };
673
681
  }
@@ -677,6 +685,7 @@ function fail(message) {
677
685
  export {
678
686
  MCP_VERSION,
679
687
  createServer,
688
+ keylessClient,
680
689
  startStdioServer
681
690
  };
682
691
  await startStdioServer();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yungle-mcp",
3
3
  "mcpName": "co.yungle/yungle",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
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": {