@aistoragedepot/mcp 0.5.0 → 0.5.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/README.md CHANGED
@@ -56,7 +56,7 @@ your library as **native** slash-commands, sync it to command files — for ever
56
56
  use, not just Claude:
57
57
 
58
58
  ```bash
59
- npx -y @aistoragedepot/mcp pull --token=aisd_your_token --to=all
59
+ npx -y -p @aistoragedepot/mcp aistoragedepot-mcp pull --token=aisd_your_token --to=all
60
60
  ```
61
61
 
62
62
  | Target | Writes to | Commands appear as |
package/index.mjs CHANGED
@@ -23,7 +23,7 @@ import {
23
23
 
24
24
  const BASE_URL = (process.env.AISD_BASE_URL || "https://www.aistoragedepot.com").replace(/\/+$/, "");
25
25
 
26
- // CLI mode: `aistoragedepot-mcp pull` syncs the library to native slash-command files, then
26
+ // CLI mode: `npx -y @aistoragedepot/mcp pull` syncs the library to native slash-command files, then
27
27
  // exits. The brief settle delay lets undici finish closing its sockets (Connection: close)
28
28
  // before process.exit — a hard exit mid-teardown trips a libuv assert on Windows (Node 24)
29
29
  // that prints a scary-but-harmless message after the sync succeeds.
@@ -52,7 +52,12 @@ async function api(path) {
52
52
  headers: { Authorization: `Bearer ${TOKEN}`, Accept: "application/json" },
53
53
  });
54
54
  if (res.status === 401) throw new Error("AIStorageDepot rejected the token (401) — check AISD_TOKEN.");
55
- if (!res.ok) throw new Error(`AIStorageDepot ${path} → HTTP ${res.status}`);
55
+ if (!res.ok) {
56
+ // Surface the server's own message when it sends one (e.g. the free-plan
57
+ // monthly pull limit returns 402 with an upgrade note) instead of a bare code.
58
+ const detail = await res.json().then((d) => d?.error).catch(() => null);
59
+ throw new Error(detail || `AIStorageDepot ${path} → HTTP ${res.status}`);
60
+ }
56
61
  return res.json();
57
62
  }
58
63
 
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@aistoragedepot/mcp",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Model Context Protocol server for your AIStorageDepot library — exposes your prompts, rules, docs, and skills to MCP-aware AI clients (Claude, Cursor, Cline, …).",
5
5
  "type": "module",
6
6
  "bin": {
7
+ "mcp": "index.mjs",
7
8
  "aistoragedepot-mcp": "index.mjs"
8
9
  },
9
10
  "files": [
package/pull.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // `aistoragedepot-mcp pull` — sync your library into native slash-command files for the
1
+ // `npx @aistoragedepot/mcp pull` — sync your library into native slash-command files for the
2
2
  // AI tools you use.
3
3
  //
4
4
  // Every major client now reads commands from a folder of markdown files; only the folder
@@ -196,7 +196,11 @@ export async function pull({ BASE_URL, argv }) {
196
196
  headers: { Authorization: `Bearer ${token}`, Accept: "application/json", Connection: "close" },
197
197
  });
198
198
  if (r.status === 401) throw new Error("Token rejected (401) — check it in Settings → API tokens.");
199
- if (!r.ok) throw new Error(`${p} → HTTP ${r.status}`);
199
+ if (!r.ok) {
200
+ // Prefer the server's message (e.g. the free-plan pull limit's 402 upgrade note).
201
+ const detail = await r.json().then((d) => d?.error).catch(() => null);
202
+ throw new Error(detail || `${p} → HTTP ${r.status}`);
203
+ }
200
204
  return r.json();
201
205
  };
202
206