suppa-mcp-2 1.1.0 → 1.1.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
@@ -1,23 +1,62 @@
1
1
  # suppa-mcp-2
2
2
 
3
- MCP (Model Context Protocol) server for the [Suppa platform](https://modern.suppa.me) — gives
4
- AI agents tools to manage Tasks, Docs/Pages, Entities & Schema, Forms, Automations, and file
5
- attachments, with multi-tenant Google authentication.
3
+ MCP (Model Context Protocol) server for the **Suppa 2.0** platform ([modern.suppa.me](https://modern.suppa.me)).
4
+ Allows LLMs (Claude, GPT, Copilot, Cursor, etc.) to manage Tasks, Docs/Pages, Entities & Schema, Forms, Automations, and file attachments through standardised MCP tools — with multi-tenant Google authentication.
6
5
 
7
- This is the Node.js/TypeScript port of the Python [`suppa-mcp`](https://pypi.org/project/suppa-mcp/)
8
- package, published to npm as **`suppa-mcp-2`**.
6
+ This is the Node.js/TypeScript port of the Python [`suppa-mcp`](https://pypi.org/project/suppa-mcp/) package, published to npm as **`suppa-mcp-2`**.
9
7
 
10
- ## Install
8
+ [![npm version](https://img.shields.io/npm/v/suppa-mcp-2)](https://www.npmjs.com/package/suppa-mcp-2)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
11
10
 
12
- Zero-install via `npx` — your MCP client fetches and runs the latest release on demand:
11
+ ---
12
+
13
+ ## Quick start
14
+
15
+ ### Run directly with npx
13
16
 
14
17
  ```bash
15
18
  npx suppa-mcp-2
16
19
  ```
17
20
 
18
- ## Connect to your AI agent
21
+ ### Or install from npm
22
+
23
+ ```bash
24
+ npm install -g suppa-mcp-2
25
+ ```
26
+
27
+ No API key needed to start — the server authenticates interactively via the `suppa_login` tool (see [Authentication](#authentication)).
28
+
29
+ ---
30
+
31
+ ## Authentication
32
+
33
+ There is **no API key to paste**. Run the **`suppa_login`** tool from your MCP client — it opens a browser for Google sign-in, then stores the resulting tokens in the OS keychain (Windows Credential Manager / macOS Keychain / libsecret). The server is **multi-tenant**: log in to more than one Suppa tenant and switch with `suppa_use_tenant`.
34
+
35
+ Credentials stay on your machine, are sent only in the `Authorization` header to your configured `SUPPA_BASE_URL`, and are **never** exposed to the AI agent. A `SUPPA_API_KEY` env var is an optional CI-only alternative.
36
+
37
+ ---
38
+
39
+ ## Configuration
19
40
 
20
- Point any MCP client at `npx`:
41
+ All variables are optional — the server works out of the box and authenticates via `suppa_login`.
42
+
43
+ | Variable | Default | Description |
44
+ |---|---|---|
45
+ | `SUPPA_BASE_URL` | `https://modern.suppa.me` | Platform base URL (the active tenant) |
46
+ | `SUPPA_API_KEY` | (none) | JWT / API key; skips interactive login when set (CI) |
47
+ | `SUPPA_REFRESH_TOKEN` | (none) | Refresh token; paired with `SUPPA_API_KEY` for long-lived CI sessions |
48
+ | `SUPPA_LANG` | `en` | Language (`en` / `uk`) |
49
+ | `SUPPA_TZ` | `Europe/Kyiv` | Timezone |
50
+ | `SUPPA_MCP_LOGIN_PORT` | `8080` | Local loopback port for the browser login callback |
51
+ | `SUPPA_MCP_HOME` | `~/.suppa-mcp` | Directory for the tenant registry |
52
+ | `SUPPA_HTTP_TIMEOUT` | `60` | Per-request timeout, seconds |
53
+ | `SUPPA_MCP_DEBUG` | (off) | `1` logs each request line to stderr |
54
+
55
+ ---
56
+
57
+ ## Use with Claude Desktop
58
+
59
+ Add to your `claude_desktop_config.json`:
21
60
 
22
61
  ```json
23
62
  {
@@ -30,29 +69,273 @@ Point any MCP client at `npx`:
30
69
  }
31
70
  ```
32
71
 
33
- ## Authentication
72
+ ## Use with Cursor
73
+
74
+ Add to `.cursor/mcp.json` in your project:
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "suppa-2.0": {
80
+ "command": "npx",
81
+ "args": ["-y", "suppa-mcp-2"]
82
+ }
83
+ }
84
+ }
85
+ ```
34
86
 
35
- No API key to paste. Run the **`suppa_login`** tool from your MCP client — it opens a browser
36
- for Google sign-in, then stores the resulting credentials locally (in the OS keychain). The
37
- server is multi-tenant, so you can log in to more than one Suppa tenant and switch between them.
87
+ ## Use with VS Code (Copilot)
38
88
 
39
- Credentials stay on your machine and are sent only in the `Authorization` header to your
40
- configured `SUPPA_BASE_URL`; they are **never** exposed to the AI agent.
89
+ Add to `.vscode/mcp.json`:
41
90
 
42
- ## Environment Variables
91
+ ```json
92
+ {
93
+ "servers": {
94
+ "suppa-2.0": {
95
+ "command": "npx",
96
+ "args": ["-y", "suppa-mcp-2"]
97
+ }
98
+ }
99
+ }
100
+ ```
43
101
 
44
- All are optional — the server works out of the box and authenticates via `suppa_login`.
102
+ Then run **`suppa_login`** once per tenant to authenticate.
45
103
 
46
- | Variable | Default | Description |
47
- |----------|---------|-------------|
48
- | `SUPPA_BASE_URL` | `https://modern.suppa.me` | Platform URL |
49
- | `SUPPA_API_KEY` | (none) | JWT token or API key; skips interactive login when set |
50
- | `SUPPA_LANG` | `en` | Language (`en` / `uk`) |
51
- | `SUPPA_TZ` | `Europe/Kyiv` | Timezone |
52
- | `SUPPA_MCP_LOGIN_PORT` | (auto) | Local port for the browser login callback |
53
- | `SUPPA_MCP_HOME` | OS config dir | Directory for stored credentials / tenant state |
54
- | `SUPPA_HTTP_TIMEOUT` | `60` | Per-request timeout, seconds |
55
- | `SUPPA_MCP_DEBUG` | (off) | `1` logs each request line to stderr |
104
+ ---
105
+
106
+ ## Agent workflow
107
+
108
+ When an AI agent connects, the server provides built-in instructions describing the correct workflow. Auth first, then discover schema before reading or writing data:
109
+
110
+ ```
111
+ ┌─────────────────────────────────────────────────────────┐
112
+ │ 0. AUTHENTICATE (once per tenant) │
113
+ │ suppa_login — Google browser sign-in │
114
+ │ suppa_use_tenant — switch active tenant │
115
+ ├─────────────────────────────────────────────────────────┤
116
+ │ 1. DISCOVER ENTITIES │
117
+ │ suppa_list_entities(search?: "task") │
118
+ │ suppa_search_entities — fuzzy-find + record count │
119
+ ├─────────────────────────────────────────────────────────┤
120
+ │ 2. DISCOVER FIELDS │
121
+ │ suppa_describe_entity(entity_name) │
122
+ │ suppa_list_field_types / suppa_list_tabular_parts │
123
+ ├─────────────────────────────────────────────────────────┤
124
+ │ 3. READ DATA │
125
+ │ suppa_search_records / suppa_get_record │
126
+ │ suppa_search_tasks / suppa_get_task / … │
127
+ │ suppa_list_docs / suppa_read_page / suppa_get_blocks │
128
+ │ suppa_list_automations / suppa_get_automation │
129
+ ├─────────────────────────────────────────────────────────┤
130
+ │ 4. WRITE DATA (destructive/edit tools are confirm-gated)│
131
+ │ suppa_create_record / suppa_update_record │
132
+ │ suppa_create_entity / suppa_add_field │
133
+ │ suppa_create_automation / suppa_publish_automation │
134
+ └─────────────────────────────────────────────────────────┘
135
+ ```
136
+
137
+ > **Important:** discover with `suppa_list_entities` → `suppa_describe_entity` before reading or writing — field names, types, and filters vary between entities. Edit/delete tools return a **confirmation preview** first and only apply when re-called with `confirm=true`.
138
+
139
+ ---
140
+
141
+ ## Available tools
142
+
143
+ 79 tools across the areas below.
144
+
145
+ ### Session & identity
146
+
147
+ | Tool | Description |
148
+ |---|---|
149
+ | `suppa_get_me` | Current authenticated user's profile |
150
+ | `suppa_login` | Google browser sign-in for a tenant (stores tokens in OS keychain) |
151
+ | `suppa_use_tenant` | Switch the active tenant (alias / host / URL) |
152
+ | `suppa_list_tenants` | List known tenants + which is active / authenticated |
153
+ | `suppa_logout` | Remove stored credentials for a tenant |
154
+ | `suppa_diagnostics` | Validate the whole multi-tenant setup |
155
+ | `suppa_health_check` | Config + upstream connectivity check |
156
+
157
+ ### Tasks
158
+
159
+ | Tool | Description |
160
+ |---|---|
161
+ | `suppa_search_tasks` | Search tasks (my / active / overdue / due-today filters, paginated) |
162
+ | `suppa_count_tasks` | Count tasks matching filters |
163
+ | `suppa_get_task` | Get a single task |
164
+ | `suppa_create_task` | Create a task |
165
+ | `suppa_update_task` | Update a task (confirm-gated) |
166
+ | `suppa_delete_task` | Delete a task (confirm-gated) |
167
+ | `suppa_move_task` | Move a task to another stage (confirm-gated) |
168
+ | `suppa_close_task` | Close a task (confirm-gated) |
169
+ | `suppa_add_comment` | Add a comment (supports @mentions) |
170
+ | `suppa_get_comments` | Get comments on a task |
171
+ | `suppa_attach_file` | Attach a local file to a task |
172
+ | `suppa_list_workflows` | List Task workflows |
173
+ | `suppa_list_stages` | List stages of a workflow |
174
+ | `suppa_list_task_types` | List task types |
175
+ | `suppa_search_users` | Search users (feeds assignee / mentions) |
176
+
177
+ ### Docs & pages
178
+
179
+ | Tool | Description |
180
+ |---|---|
181
+ | `suppa_list_docs` | List docs |
182
+ | `suppa_get_doc` | Get a doc |
183
+ | `suppa_create_doc` | Create a doc |
184
+ | `suppa_update_doc` | Update a doc (confirm-gated) |
185
+ | `suppa_delete_doc` | Delete a doc (confirm-gated) |
186
+ | `suppa_list_pages` | List pages of a doc |
187
+ | `suppa_get_page` | Get a page |
188
+ | `suppa_create_page` | Create a page |
189
+ | `suppa_update_page` | Update a page (confirm-gated) |
190
+ | `suppa_delete_page` | Delete a page (confirm-gated) |
191
+ | `suppa_get_blocks` | Get raw blocks of a page |
192
+ | `suppa_read_page` | Read a page rendered to text |
193
+ | `suppa_create_blocks` | Create blocks from a JSON array (11 block types) |
194
+ | `suppa_insert_block` | Insert a block at a position |
195
+ | `suppa_update_block` | Update a block (confirm-gated) |
196
+ | `suppa_delete_block` | Delete a block (confirm-gated) |
197
+ | `suppa_reorder_blocks` | Reorder blocks on a page |
198
+
199
+ ### Entities & records
200
+
201
+ | Tool | Description |
202
+ |---|---|
203
+ | `suppa_list_entities` | List entities (tables) |
204
+ | `suppa_describe_entity` | Field definitions + types for an entity |
205
+ | `suppa_list_tabular_parts` | List tabular parts (ТЧ) of an entity |
206
+ | `suppa_search_records` | Search / filter records in any entity |
207
+ | `suppa_get_record` | Get a single record |
208
+ | `suppa_create_entity` | Create a new entity |
209
+ | `suppa_create_tabular_part` | Create a tabular part (owned rows) of a parent |
210
+ | `suppa_add_field` | Add a field to an entity |
211
+ | `suppa_add_enum_values` | Add values to an enum field |
212
+ | `suppa_set_title_field` | Set the representative/title field |
213
+ | `suppa_list_field_types` | List supported field types |
214
+ | `suppa_create_record` | Create a record |
215
+ | `suppa_update_record` | Update a record (confirm-gated) |
216
+ | `suppa_delete_record` | Delete a record (confirm-gated) |
217
+ | `suppa_attach_file_to_record` | Attach a local file to any record |
218
+
219
+ ### Automations
220
+
221
+ | Tool | Description |
222
+ |---|---|
223
+ | `suppa_list_automations` | List automation workflows |
224
+ | `suppa_get_automation` | Get one automation as a normalized graph (nodes + edges) |
225
+ | `suppa_list_automation_runs` | List runs (executions) of an automation |
226
+ | `suppa_get_automation_run` | Get one run with per-node steps + trigger payload |
227
+ | `suppa_list_automation_node_types` | Node-type catalog (authoritative + fallback) |
228
+ | `suppa_get_automation_node_schema` | Parameter schema for one node type |
229
+ | `suppa_search_entities` | Fuzzy-find an entity by name/title (+ record count) |
230
+ | `suppa_create_automation` | Create an automation (pre-flight validated; draft) |
231
+ | `suppa_update_automation` | Update an automation (read-modify-write; confirm-gated) |
232
+ | `suppa_delete_automation` | Delete an automation (confirm-gated) |
233
+ | `suppa_publish_automation` | Publish the draft snapshot (confirm-gated) |
234
+ | `suppa_unpublish_automation` | Deactivate an automation (confirm-gated) |
235
+
236
+ ### Forms
237
+
238
+ | Tool | Description |
239
+ |---|---|
240
+ | `suppa_list_forms` | List forms |
241
+ | `suppa_get_form` | Get a form |
242
+ | `suppa_create_form` | Create a form (optionally generated from an entity) |
243
+ | `suppa_update_form` | Update a form (confirm-gated) |
244
+ | `suppa_generate_form_schema` | Generate a grid form schema from an entity |
245
+ | `suppa_add_field_to_form` | Add a field element to a form (confirm-gated) |
246
+ | `suppa_list_form_field_types` | List form element types |
247
+
248
+ ### Migration (Suppa 1.0 → 2.0) & workspace
249
+
250
+ | Tool | Description |
251
+ |---|---|
252
+ | `suppa_migrate_entities_from_v1` | Migrate 1.0 entities → 2.0 (dry-run / create / gap-fill / reconcile) |
253
+ | `suppa_read_v1_entities` | Read entity list from a Suppa 1.0 tenant |
254
+ | `suppa_read_v1_entity_props` | Read 1.0 entity field definitions |
255
+ | `suppa_read_v1_enum` | Read 1.0 enum values |
256
+ | `suppa_create_workspace` | Create a workspace + nav item |
257
+ | `suppa_add_menu_item` | Add a navigation-menu item |
258
+
259
+ ---
260
+
261
+ ## Prompts
262
+
263
+ Guided workflows clients can expose as slash commands:
264
+
265
+ | Prompt | Arguments | Description |
266
+ |---|---|---|
267
+ | `plan_my_day` | — | Triage my Suppa tasks into a prioritized day plan |
268
+ | `build_entity` | `entity_purpose` | Guided design + creation of a new entity, fields, enums, and a form |
269
+ | `migrate_from_v1` | `entity_names?` | Guided Suppa 1.0 → 2.0 schema migration (dry-run, review, execute) |
270
+
271
+ ---
272
+
273
+ ## Development
274
+
275
+ ```bash
276
+ # Install dependencies
277
+ npm install
278
+
279
+ # Build
280
+ npm run build
281
+
282
+ # Run locally (stdio)
283
+ node dist/bin.js
284
+
285
+ # Test with MCP Inspector
286
+ npm run inspect
287
+
288
+ # Tests
289
+ npm test
290
+
291
+ # Watch mode
292
+ npm run dev
293
+ ```
294
+
295
+ ---
296
+
297
+ ## Publish to npm
298
+
299
+ ```bash
300
+ # 1. Make sure you're logged in
301
+ npm login
302
+
303
+ # 2. Build & publish
304
+ npm publish
305
+ ```
306
+
307
+ The `prepublishOnly` script automatically runs `tsc` + the full test suite before publishing.
308
+
309
+ ---
310
+
311
+ ## Project structure
312
+
313
+ ```
314
+ suppa-mcp-node/
315
+ ├── src/
316
+ │ ├── bin.ts # Entry point — stdio transport
317
+ │ ├── server.ts # McpServer + all 79 tool + 3 prompt registrations
318
+ │ ├── config.ts # Env / .env config surface
319
+ │ ├── store.ts # Credentials in the OS keychain (@napi-rs/keyring)
320
+ │ ├── registry.ts # Non-secret tenant registry (~/.suppa-mcp/tenants.json)
321
+ │ ├── tenants.ts # Tenant context, active tenant, resolve, diagnostics
322
+ │ ├── auth.ts # JWT refresh (single-flight) + browser Google login
323
+ │ ├── httpClient.ts # fetch client: retry, envelope unwrap, 401→refresh→retry
324
+ │ ├── utils.ts # filters, dates, JSON params, multipart, confirm gate
325
+ │ └── tools/
326
+ │ ├── tasks.ts docs.ts entity.ts forms.ts
327
+ │ ├── automation.ts # read + write automation tools
328
+ │ ├── migrate.ts nameMap.ts v1Fields.ts
329
+ │ └── workspace.ts
330
+ ├── test/ # vitest suite (ports the Python test suite)
331
+ ├── scripts/ # live read-only / write verify scripts
332
+ ├── package.json
333
+ ├── tsconfig.json
334
+ ├── vitest.config.ts
335
+ └── README.md
336
+ ```
337
+
338
+ ---
56
339
 
57
340
  ## License
58
341
 
package/dist/server.js CHANGED
@@ -199,7 +199,7 @@ export function buildServer() {
199
199
  // Reset so repeated buildServer() calls (e.g. in tests) do not double-count.
200
200
  TOOL_NAMES.length = 0;
201
201
  PROMPT_NAMES.length = 0;
202
- const server = new McpServer({ name: "suppa-2.0", version: "1.1.0" }, { instructions: INSTRUCTIONS });
202
+ const server = new McpServer({ name: "suppa-2.0", version: "1.1.2" }, { instructions: INSTRUCTIONS });
203
203
  const reg = (name, cfg, handler) => {
204
204
  server.registerTool(name, {
205
205
  description: cfg.description,
package/dist/store.js CHANGED
@@ -17,9 +17,71 @@
17
17
  * `refresh_exp`). This matches the Python server's on-disk format exactly, so an
18
18
  * entry written by either server loads in the other. The camelCase `Credentials`
19
19
  * shape is a boundary-only convenience.
20
+ *
21
+ * WINDOWS BLOB LIMIT + CHUNKING: Windows Credential Manager caps a credential
22
+ * blob at 2560 bytes (`CRED_MAX_CREDENTIAL_BLOB_SIZE`; `@napi-rs/keyring` stores
23
+ * the secret as UTF-16, so ~1280 ASCII chars). Some tenants' Google tokens are
24
+ * far larger than that, so the single-blob write throws. When it does, we fall
25
+ * back to CHUNKED storage: the tokens are split across sibling keychain entries
26
+ * (`<host>#suppa-chunk#<i>`) and the main `<host>` entry holds a small manifest
27
+ * `{"__suppa_chunks__": N}`. Reads/deletes detect the manifest and reassemble.
28
+ * The single-blob format is still used whenever it fits (the common case), so
29
+ * normal-size tenants stay byte-compatible with the Python server. Chunked
30
+ * entries are Node-only (Python would hit the same Windows limit anyway).
20
31
  */
21
32
  import { Entry } from "@napi-rs/keyring";
22
33
  export const SERVICE = "suppa-mcp";
34
+ /**
35
+ * Conservative per-chunk size in characters. Windows' limit is 2560 bytes of
36
+ * UTF-16 (= 1280 BMP chars); 1000 chars → ~2000 bytes leaves comfortable margin
37
+ * for surrogate pairs and backend overhead.
38
+ */
39
+ const CHUNK_CHARS = 1000;
40
+ /** Keychain account name holding chunk `i` of `host`'s credential blob. */
41
+ function chunkAccount(host, i) {
42
+ return `${host}#suppa-chunk#${i}`;
43
+ }
44
+ /** True iff a thrown keychain error is the platform blob-size-limit rejection. */
45
+ function isBlobSizeError(err) {
46
+ const msg = err instanceof Error ? err.message : String(err);
47
+ return /platform limit|too long|longer than|blob|size/i.test(msg);
48
+ }
49
+ /** Split `s` into <=CHUNK_CHARS pieces. */
50
+ function splitChunks(s) {
51
+ const out = [];
52
+ for (let i = 0; i < s.length; i += CHUNK_CHARS) {
53
+ out.push(s.slice(i, i + CHUNK_CHARS));
54
+ }
55
+ return out;
56
+ }
57
+ /**
58
+ * Delete any chunk entries belonging to `host`. Best-effort: reads the manifest
59
+ * to learn the count, then falls back to probing until a chunk is absent (so
60
+ * orphans from an interrupted write are still cleaned up).
61
+ */
62
+ function clearChunks(host, knownCount) {
63
+ const upTo = knownCount ?? 256; // hard cap; a real token needs a handful
64
+ for (let i = 0; i < upTo; i++) {
65
+ const e = entryFor(chunkAccount(host, i));
66
+ if (e === null)
67
+ break;
68
+ let had = false;
69
+ try {
70
+ had = e.getPassword() !== null;
71
+ }
72
+ catch {
73
+ had = false;
74
+ }
75
+ if (!had && knownCount === undefined)
76
+ break; // no more chunks
77
+ try {
78
+ e.deletePassword();
79
+ }
80
+ catch {
81
+ /* ignore */
82
+ }
83
+ }
84
+ }
23
85
  /**
24
86
  * Return a keychain `Entry` for `host`, or `null` if the backend cannot load.
25
87
  *
@@ -61,7 +123,35 @@ export function load(host) {
61
123
  return null;
62
124
  }
63
125
  try {
64
- const data = JSON.parse(raw);
126
+ const parsed = JSON.parse(raw);
127
+ // Chunked entry: main blob is a manifest; reassemble from chunk entries.
128
+ const manifest = parsed;
129
+ if (typeof manifest.__suppa_chunks__ === "number") {
130
+ const n = manifest.__suppa_chunks__;
131
+ let assembled = "";
132
+ for (let i = 0; i < n; i++) {
133
+ const e = entryFor(chunkAccount(host, i));
134
+ let piece = null;
135
+ try {
136
+ piece = e ? e.getPassword() : null;
137
+ }
138
+ catch {
139
+ piece = null;
140
+ }
141
+ if (piece === null) {
142
+ return null; // a chunk is missing → corrupt, treat as absent
143
+ }
144
+ assembled += piece;
145
+ }
146
+ const data = JSON.parse(assembled);
147
+ return {
148
+ accessToken: typeof data.access_token === "string" ? data.access_token : "",
149
+ refreshToken: typeof data.refresh_token === "string" ? data.refresh_token : "",
150
+ accessExp: typeof data.access_exp === "number" ? data.access_exp : 0,
151
+ refreshExp: typeof data.refresh_exp === "number" ? data.refresh_exp : 0,
152
+ };
153
+ }
154
+ const data = parsed;
65
155
  // Keep only known keys, defaulting missing ones (tolerate a partial blob).
66
156
  return {
67
157
  accessToken: typeof data.access_token === "string" ? data.access_token : "",
@@ -87,7 +177,32 @@ export function save(host, creds) {
87
177
  access_exp: creds.accessExp,
88
178
  refresh_exp: creds.refreshExp,
89
179
  };
90
- entry.setPassword(JSON.stringify(stored));
180
+ const blob = JSON.stringify(stored);
181
+ // Fast path: single blob (byte-compatible with the Python server). Only when
182
+ // the backend rejects it for size do we fall back to chunked storage. This
183
+ // keeps normal-size tenants interoperable and unchanged on every platform.
184
+ try {
185
+ entry.setPassword(blob);
186
+ // Success — make sure no stale chunks linger from a prior chunked write.
187
+ clearChunks(host);
188
+ return;
189
+ }
190
+ catch (err) {
191
+ if (!isBlobSizeError(err)) {
192
+ throw err;
193
+ }
194
+ }
195
+ // Chunked path: split the blob across sibling entries, then write a manifest.
196
+ const chunks = splitChunks(blob);
197
+ clearChunks(host); // remove any previous chunk set first
198
+ for (let i = 0; i < chunks.length; i++) {
199
+ const e = entryFor(chunkAccount(host, i));
200
+ if (e === null) {
201
+ throw new Error("No OS keychain backend available for chunked write.");
202
+ }
203
+ e.setPassword(chunks[i]);
204
+ }
205
+ entry.setPassword(JSON.stringify({ __suppa_chunks__: chunks.length }));
91
206
  }
92
207
  /**
93
208
  * Delete stored credentials for `host`. Returns `true` iff something was
@@ -111,6 +226,16 @@ export function del(host) {
111
226
  if (raw === null) {
112
227
  return false;
113
228
  }
229
+ // If this is a chunked entry, remove its chunk siblings too.
230
+ try {
231
+ const manifest = JSON.parse(raw);
232
+ if (typeof manifest.__suppa_chunks__ === "number") {
233
+ clearChunks(host, manifest.__suppa_chunks__);
234
+ }
235
+ }
236
+ catch {
237
+ /* not a manifest — plain blob, nothing extra to clean */
238
+ }
114
239
  // deletePassword returns whether an entry was removed.
115
240
  return entry.deletePassword();
116
241
  }
package/package.json CHANGED
@@ -1,18 +1,42 @@
1
1
  {
2
2
  "name": "suppa-mcp-2",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "MCP server for the Suppa platform (modern.suppa.me) — Tasks, Docs/Pages, Entities & Schema, Forms, Automations, and file attachments, with multi-tenant Google auth. Node port of PyPI suppa-mcp.",
5
5
  "type": "module",
6
6
  "bin": { "suppa-mcp": "dist/bin.js" },
7
- "files": ["dist"],
7
+ "main": "dist/bin.js",
8
+ "files": ["dist", "README.md", "LICENSE"],
8
9
  "engines": { "node": ">=18" },
9
10
  "scripts": {
10
11
  "build": "tsc",
12
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
13
+ "rebuild": "npm run clean && npm run build",
14
+ "start": "node dist/bin.js",
15
+ "dev": "tsc --watch",
11
16
  "test": "vitest run",
12
- "prepublishOnly": "npm run build && npm test"
17
+ "test:watch": "vitest",
18
+ "prepublishOnly": "npm run build && npm test",
19
+ "inspect": "npx @modelcontextprotocol/inspector node dist/bin.js"
13
20
  },
14
- "keywords": ["mcp", "model-context-protocol", "suppa", "claude", "ai-tools"],
21
+ "keywords": [
22
+ "mcp",
23
+ "model-context-protocol",
24
+ "suppa",
25
+ "modern-expo",
26
+ "ai",
27
+ "llm",
28
+ "tools",
29
+ "claude",
30
+ "copilot",
31
+ "cursor"
32
+ ],
15
33
  "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://git.modern-expo.com/asu/me-development/skills.git",
37
+ "directory": "suppa-mcp-node"
38
+ },
39
+ "homepage": "https://modern.suppa.me",
16
40
  "dependencies": {
17
41
  "@modelcontextprotocol/sdk": "^1.18.0",
18
42
  "@napi-rs/keyring": "^1.1.0",