suppa-mcp-2 1.1.3 → 1.2.0

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,342 +1,379 @@
1
- # suppa-mcp-2
2
-
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.
5
-
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`**.
7
-
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)
10
-
11
- ---
12
-
13
- ## Quick start
14
-
15
- ### Run directly with npx
16
-
17
- ```bash
18
- npx suppa-mcp-2
19
- ```
20
-
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
40
-
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`:
60
-
61
- ```json
62
- {
63
- "mcpServers": {
64
- "suppa-2.0": {
65
- "command": "npx",
66
- "args": ["-y", "suppa-mcp-2"]
67
- }
68
- }
69
- }
70
- ```
71
-
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
- ```
86
-
87
- ## Use with VS Code (Copilot)
88
-
89
- Add to `.vscode/mcp.json`:
90
-
91
- ```json
92
- {
93
- "servers": {
94
- "suppa-2.0": {
95
- "command": "npx",
96
- "args": ["-y", "suppa-mcp-2"]
97
- }
98
- }
99
- }
100
- ```
101
-
102
- Then run **`suppa_login`** once per tenant to authenticate.
103
-
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
- ---
339
-
340
- ## License
341
-
342
- MIT — see [LICENSE](LICENSE).
1
+ # suppa-mcp-2
2
+
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.
5
+
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`**.
7
+
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)
10
+
11
+ ---
12
+
13
+ ## Quick start
14
+
15
+ ### Run directly with npx
16
+
17
+ ```bash
18
+ npx suppa-mcp-2
19
+ ```
20
+
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
40
+
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_LANGS` | (auto) | Languages a multi-language title/Name is written into. When unset, resolved from the platform (the languages already used by existing entity titles), falling back to `en,uk`. Set e.g. `en,uk` to force it. |
50
+ | `SUPPA_TZ` | `Europe/Kyiv` | Timezone |
51
+ | `SUPPA_MCP_LOGIN_PORT` | `8080` | Local loopback port for the browser login callback |
52
+ | `SUPPA_MCP_HOME` | `~/.suppa-mcp` | Directory for the tenant registry |
53
+ | `SUPPA_HTTP_TIMEOUT` | `60` | Per-request timeout, seconds |
54
+ | `SUPPA_MCP_DEBUG` | (off) | `1` logs each request line to stderr |
55
+
56
+ ---
57
+
58
+ ## Use with Claude Desktop
59
+
60
+ Add to your `claude_desktop_config.json`:
61
+
62
+ ```json
63
+ {
64
+ "mcpServers": {
65
+ "suppa-2.0": {
66
+ "command": "npx",
67
+ "args": ["-y", "suppa-mcp-2"]
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ## Use with Cursor
74
+
75
+ Add to `.cursor/mcp.json` in your project:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "suppa-2.0": {
81
+ "command": "npx",
82
+ "args": ["-y", "suppa-mcp-2"]
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ## Use with VS Code (Copilot)
89
+
90
+ Add to `.vscode/mcp.json`:
91
+
92
+ ```json
93
+ {
94
+ "servers": {
95
+ "suppa-2.0": {
96
+ "command": "npx",
97
+ "args": ["-y", "suppa-mcp-2"]
98
+ }
99
+ }
100
+ }
101
+ ```
102
+
103
+ Then run **`suppa_login`** once per tenant to authenticate.
104
+
105
+ ---
106
+
107
+ ## Agent workflow
108
+
109
+ 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:
110
+
111
+ ```
112
+ ┌─────────────────────────────────────────────────────────┐
113
+ │ 0. AUTHENTICATE (once per tenant) │
114
+ │ suppa_login — Google browser sign-in │
115
+ │ suppa_use_tenant — switch active tenant │
116
+ ├─────────────────────────────────────────────────────────┤
117
+ │ 1. DISCOVER ENTITIES │
118
+ │ suppa_list_entities(search?: "task") │
119
+ │ suppa_search_entities — fuzzy-find + record count │
120
+ ├─────────────────────────────────────────────────────────┤
121
+ │ 2. DISCOVER FIELDS │
122
+ │ suppa_describe_entity(entity_name) │
123
+ │ suppa_list_field_types / suppa_list_tabular_parts │
124
+ ├─────────────────────────────────────────────────────────┤
125
+ │ 3. READ DATA │
126
+ │ suppa_search_records / suppa_get_record │
127
+ │ suppa_search_tasks / suppa_get_task / … │
128
+ │ suppa_list_docs / suppa_read_page / suppa_get_blocks │
129
+ │ suppa_list_automations / suppa_get_automation │
130
+ ├─────────────────────────────────────────────────────────┤
131
+ │ 4. WRITE DATA (destructive/edit tools are confirm-gated)│
132
+ │ suppa_create_record / suppa_update_record │
133
+ │ suppa_create_entity / suppa_add_field │
134
+ │ suppa_create_automation / suppa_publish_automation │
135
+ └─────────────────────────────────────────────────────────┘
136
+ ```
137
+
138
+ > **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`.
139
+
140
+ ---
141
+
142
+ ## Available tools
143
+
144
+ 79 tools across the areas below.
145
+
146
+ ### Session & identity
147
+
148
+ | Tool | Description |
149
+ |---|---|
150
+ | `suppa_get_me` | Current authenticated user's profile |
151
+ | `suppa_login` | Google browser sign-in for a tenant (stores tokens in OS keychain) |
152
+ | `suppa_use_tenant` | Switch the active tenant (alias / host / URL) |
153
+ | `suppa_list_tenants` | List known tenants + which is active / authenticated |
154
+ | `suppa_logout` | Remove stored credentials for a tenant |
155
+ | `suppa_diagnostics` | Validate the whole multi-tenant setup |
156
+ | `suppa_health_check` | Config + upstream connectivity check |
157
+
158
+ ### Tasks
159
+
160
+ | Tool | Description |
161
+ |---|---|
162
+ | `suppa_search_tasks` | Search tasks (my / active / overdue / due-today filters, paginated) |
163
+ | `suppa_count_tasks` | Count tasks matching filters |
164
+ | `suppa_get_task` | Get a single task |
165
+ | `suppa_create_task` | Create a task |
166
+ | `suppa_update_task` | Update a task (confirm-gated) |
167
+ | `suppa_delete_task` | Delete a task (confirm-gated) |
168
+ | `suppa_move_task` | Move a task to another stage (confirm-gated) |
169
+ | `suppa_close_task` | Close a task (confirm-gated) |
170
+ | `suppa_add_comment` | Add a comment (supports @mentions) |
171
+ | `suppa_get_comments` | Get comments on a task |
172
+ | `suppa_attach_file` | Attach a local file to a task |
173
+ | `suppa_list_workflows` | List Task workflows |
174
+ | `suppa_list_stages` | List stages of a workflow |
175
+ | `suppa_list_task_types` | List task types |
176
+ | `suppa_search_users` | Search users (feeds assignee / mentions) |
177
+
178
+ ### Docs & pages
179
+
180
+ | Tool | Description |
181
+ |---|---|
182
+ | `suppa_list_docs` | List docs |
183
+ | `suppa_get_doc` | Get a doc |
184
+ | `suppa_create_doc` | Create a doc |
185
+ | `suppa_update_doc` | Update a doc (confirm-gated) |
186
+ | `suppa_delete_doc` | Delete a doc (confirm-gated) |
187
+ | `suppa_list_pages` | List pages of a doc |
188
+ | `suppa_get_page` | Get a page |
189
+ | `suppa_create_page` | Create a page |
190
+ | `suppa_update_page` | Update a page (confirm-gated) |
191
+ | `suppa_delete_page` | Delete a page (confirm-gated) |
192
+ | `suppa_get_blocks` | Get raw blocks of a page |
193
+ | `suppa_read_page` | Read a page rendered to text |
194
+ | `suppa_create_blocks` | Create blocks from a JSON array (11 block types) |
195
+ | `suppa_insert_block` | Insert a block at a position |
196
+ | `suppa_update_block` | Update a block (confirm-gated) |
197
+ | `suppa_delete_block` | Delete a block (confirm-gated) |
198
+ | `suppa_reorder_blocks` | Reorder blocks on a page |
199
+
200
+ ### Entities & records
201
+
202
+ | Tool | Description |
203
+ |---|---|
204
+ | `suppa_list_entities` | List entities (tables) |
205
+ | `suppa_describe_entity` | Field definitions + types for an entity |
206
+ | `suppa_list_tabular_parts` | List tabular parts (ТЧ) of an entity |
207
+ | `suppa_search_records` | Search / filter records in any entity |
208
+ | `suppa_get_record` | Get a single record |
209
+ | `suppa_create_entity` | Create a new entity |
210
+ | `suppa_create_tabular_part` | Create a tabular part (owned rows) of a parent |
211
+ | `suppa_add_field` | Add a field to an entity |
212
+ | `suppa_add_enum_values` | Add values to an enum field |
213
+ | `suppa_set_title_field` | Set the representative/title field |
214
+ | `suppa_list_field_types` | List supported field types |
215
+ | `suppa_create_record` | Create a record |
216
+ | `suppa_update_record` | Update a record (confirm-gated) |
217
+ | `suppa_delete_record` | Delete a record (confirm-gated) |
218
+ | `suppa_attach_file_to_record` | Attach a local file to any record |
219
+
220
+ ### Automations
221
+
222
+ | Tool | Description |
223
+ |---|---|
224
+ | `suppa_list_automations` | List automation workflows |
225
+ | `suppa_get_automation` | Get one automation as a normalized graph (nodes + edges) |
226
+ | `suppa_list_automation_runs` | List runs (executions) of an automation |
227
+ | `suppa_get_automation_run` | Get one run with per-node steps + trigger payload |
228
+ | `suppa_list_automation_node_types` | Node-type catalog (authoritative + fallback) |
229
+ | `suppa_get_automation_node_schema` | Parameter schema for one node type |
230
+ | `suppa_search_entities` | Fuzzy-find an entity by name/title (+ record count) |
231
+ | `suppa_create_automation` | Create an automation (pre-flight validated; draft) |
232
+ | `suppa_update_automation` | Update an automation (read-modify-write; confirm-gated) |
233
+ | `suppa_delete_automation` | Delete an automation (confirm-gated) |
234
+ | `suppa_publish_automation` | Publish the draft snapshot (confirm-gated) |
235
+ | `suppa_unpublish_automation` | Deactivate an automation (confirm-gated) |
236
+
237
+ ### Forms
238
+
239
+ | Tool | Description |
240
+ |---|---|
241
+ | `suppa_list_forms` | List forms |
242
+ | `suppa_get_form` | Get a form |
243
+ | `suppa_create_form` | Create a form (optionally generated from an entity) |
244
+ | `suppa_update_form` | Update a form (confirm-gated) |
245
+ | `suppa_generate_form_schema` | Generate a grid form schema from an entity |
246
+ | `suppa_add_field_to_form` | Add a field element to a form (confirm-gated) |
247
+ | `suppa_list_form_field_types` | List form element types |
248
+
249
+ ### Migration (Suppa 1.0 → 2.0) & workspace
250
+
251
+ | Tool | Description |
252
+ |---|---|
253
+ | `suppa_migrate_entities_from_v1` | Migrate 1.0 entities → 2.0 (dry-run / create / gap-fill / reconcile) |
254
+ | `suppa_read_v1_entities` | Read entity list from a Suppa 1.0 tenant |
255
+ | `suppa_read_v1_entity_props` | Read 1.0 entity field definitions |
256
+ | `suppa_read_v1_enum` | Read 1.0 enum values |
257
+ | `suppa_create_workspace` | Create a workspace + nav item |
258
+ | `suppa_add_menu_item` | Add a navigation-menu item |
259
+
260
+ ---
261
+
262
+ ## Prompts
263
+
264
+ Guided workflows clients can expose as slash commands:
265
+
266
+ | Prompt | Arguments | Description |
267
+ |---|---|---|
268
+ | `plan_my_day` | — | Triage my Suppa tasks into a prioritized day plan |
269
+ | `build_entity` | `entity_purpose` | Guided design + creation of a new entity, fields, enums, and a form |
270
+ | `migrate_from_v1` | `entity_names?` | Guided Suppa 1.0 → 2.0 schema migration (dry-run, review, execute) |
271
+ | `write_entity_code` | `entity_purpose` | Guided: write v2 application schema code (entities, seeds, registration) instead of API calls |
272
+
273
+ ---
274
+
275
+ ## Bundled agent skill: suppa-entity-code
276
+
277
+ The package ships an agent skill at `skills/suppa-entity-code/` (also installed
278
+ via npm) that writes **Suppa v2 application schema code** — `*.entity.ts`
279
+ classes, `*.seed.ts` seeds, and the `EntityModule.forFeature()` registration —
280
+ following the platform's declarative-migration rules, where the entity class
281
+ *is* the migration.
282
+
283
+ Two flows:
284
+
285
+ - **Flow A** — design a new entity/seed in an application repo.
286
+ - **Flow B** — port a Suppa 1.0 entity to v2 code, using the same
287
+ type-mapping authority as `suppa_migrate_entities_from_v1`.
288
+
289
+ It includes a static validator that catches everything `tsc` cannot:
290
+
291
+ ```bash
292
+ node <this-skill-dir>/scripts/validate-suppa-schema.mjs <app-root>
293
+ # (installed via npm: node_modules/suppa-mcp-2/skills/suppa-entity-code/scripts/validate-suppa-schema.mjs)
294
+ ```
295
+
296
+ Checks: SQL-string defaults, decorator misuse, thunk-less relations, seed
297
+ idempotency (importKeyFields / `$key`), forbidden seed keys, numeric relation
298
+ ids, reverse `@OneToMany` references, `forFeature` membership, seed dependency
299
+ order, `dist/` autoload paths, tsconfig decorator flags, and unknown
300
+ `@Entity()`/`@Column()` options or field types — validated against the
301
+ installed `@suppa/sdk` typings when resolvable, falling back to the doc
302
+ tables otherwise (E101/E102/E107/E501/E502). Options/records/registration
303
+ arrays delivered via spread or by reference can't be statically checked and
304
+ fire a W606 warning instead. Exit code 1 on any error. Use the
305
+ `write_entity_code` MCP prompt to drive it from any client.
306
+
307
+ ---
308
+
309
+ ## Development
310
+
311
+ ```bash
312
+ # Install dependencies
313
+ npm install
314
+
315
+ # Build
316
+ npm run build
317
+
318
+ # Run locally (stdio)
319
+ node dist/bin.js
320
+
321
+ # Test with MCP Inspector
322
+ npm run inspect
323
+
324
+ # Tests
325
+ npm test
326
+
327
+ # Watch mode
328
+ npm run dev
329
+ ```
330
+
331
+ ---
332
+
333
+ ## Publish to npm
334
+
335
+ ```bash
336
+ # 1. Make sure you're logged in
337
+ npm login
338
+
339
+ # 2. Build & publish
340
+ npm publish
341
+ ```
342
+
343
+ The `prepublishOnly` script automatically runs `tsc` + the full test suite before publishing.
344
+
345
+ ---
346
+
347
+ ## Project structure
348
+
349
+ ```
350
+ suppa-mcp-node/
351
+ ├── src/
352
+ │ ├── bin.ts # Entry point — stdio transport
353
+ │ ├── server.ts # McpServer + all 79 tool + 4 prompt registrations
354
+ │ ├── config.ts # Env / .env config surface
355
+ │ ├── store.ts # Credentials in the OS keychain (@napi-rs/keyring)
356
+ │ ├── registry.ts # Non-secret tenant registry (~/.suppa-mcp/tenants.json)
357
+ │ ├── tenants.ts # Tenant context, active tenant, resolve, diagnostics
358
+ │ ├── auth.ts # JWT refresh (single-flight) + browser Google login
359
+ │ ├── httpClient.ts # fetch client: retry, envelope unwrap, 401→refresh→retry
360
+ │ ├── utils.ts # filters, dates, JSON params, multipart, confirm gate
361
+ │ └── tools/
362
+ │ ├── tasks.ts docs.ts entity.ts forms.ts
363
+ │ ├── automation.ts # read + write automation tools
364
+ │ ├── migrate.ts nameMap.ts v1Fields.ts
365
+ │ └── workspace.ts
366
+ ├── skills/suppa-entity-code/ # bundled agent skill: write v2 schema code + validator
367
+ ├── test/ # vitest suite (ports the Python test suite)
368
+ ├── scripts/ # live read-only / write verify scripts
369
+ ├── package.json
370
+ ├── tsconfig.json
371
+ ├── vitest.config.ts
372
+ └── README.md
373
+ ```
374
+
375
+ ---
376
+
377
+ ## License
378
+
379
+ MIT — see [LICENSE](LICENSE).