@cloudgrid-io/mcp 0.11.0 → 0.12.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.
Files changed (29) hide show
  1. package/package.json +3 -1
  2. package/src/corpus/capability-map.md +46 -28
  3. package/src/corpus/cloudgrid-yaml.md +569 -0
  4. package/src/corpus/examples/ai-app/index.md +237 -0
  5. package/src/corpus/examples/api-service/index.md +190 -0
  6. package/src/corpus/examples/app-with-data/index.md +24 -19
  7. package/src/corpus/templates/ai-app/README.md +95 -0
  8. package/src/corpus/templates/ai-app/cloudgrid.yaml +20 -0
  9. package/src/corpus/templates/ai-app/index.md +269 -0
  10. package/src/corpus/templates/ai-app/services/web/app/api/chat/route.js +51 -0
  11. package/src/corpus/templates/ai-app/services/web/app/chat.js +60 -0
  12. package/src/corpus/templates/ai-app/services/web/app/layout.js +36 -0
  13. package/src/corpus/templates/ai-app/services/web/app/page.js +25 -0
  14. package/src/corpus/templates/ai-app/services/web/lib/db.js +32 -0
  15. package/src/corpus/templates/ai-app/services/web/package.json +17 -0
  16. package/src/corpus/templates/api-service/README.md +87 -0
  17. package/src/corpus/templates/api-service/cloudgrid.yaml +18 -0
  18. package/src/corpus/templates/api-service/index.md +225 -0
  19. package/src/corpus/templates/api-service/services/api/package.json +13 -0
  20. package/src/corpus/templates/api-service/services/api/src/index.js +132 -0
  21. package/src/corpus/templates/app-with-data/README.md +22 -19
  22. package/src/corpus/templates/app-with-data/cloudgrid.yaml +9 -13
  23. package/src/corpus/templates/app-with-data/index.md +37 -38
  24. package/src/corpus/templates/app-with-data/services/web/lib/db.js +10 -9
  25. package/src/corpus/troubleshooting/persistent-apps.md +6 -6
  26. package/src/corpus/workflows/ai-app.md +136 -0
  27. package/src/corpus/workflows/api-service.md +118 -0
  28. package/src/corpus/workflows/app-with-data.md +21 -18
  29. package/src/tools.js +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudgrid-io/mcp",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "MCP server for CloudGrid. Three editions: a local stdio server (full toolset), a hosted web server (light, CLI-free toolset), and a public docs server (search_cloudgrid_documentation) over MCP Streamable HTTP.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,7 +20,9 @@
20
20
  "test:error-reporting": "node test/error-reporting.test.mjs",
21
21
  "test:source": "node test/source-fetch.test.mjs",
22
22
  "test:app-with-data": "node test/app-with-data.test.mjs",
23
+ "test:archetypes": "node test/archetypes.test.mjs",
23
24
  "test:self-describing": "node test/self-describing.test.mjs",
25
+ "test:canonical-yaml": "node test/canonical-yaml.test.mjs",
24
26
  "test:content": "node test/content-handling.test.mjs",
25
27
  "test:self-healing": "node test/self-healing.test.mjs",
26
28
  "test:grid-picker": "node test/grid-picker.test.mjs",
@@ -8,9 +8,12 @@ template by its `when:` triggers, adopt that template's `needs:`, then deploy:
8
8
  - **anything needing `needs:` → runtime** (async build, **local edition** only)
9
9
  via `gridctl_plug` on a linked folder.
10
10
 
11
- Fetch this doc any time with `gridctl_fetch("doc", "capability-map")`.
11
+ Fetch this doc any time with `gridctl_fetch("doc", "capability-map")`. For the full
12
+ cloudgrid.yaml schema (every field, the `needs:` injection table, the
13
+ requires-vs-needs caveat, validation rules), fetch the companion reference:
14
+ `gridctl_fetch("doc", "cloudgrid-yaml")`.
12
15
 
13
- ## The 6 templates
16
+ ## The 8 templates
14
17
 
15
18
  | Intent (match on `when:`) | Template | `needs:` | Deploy | Edition |
16
19
  |---|---|---|---|---|
@@ -20,50 +23,65 @@ Fetch this doc any time with `gridctl_fetch("doc", "capability-map")`.
20
23
  | report, one-pager, summary, brief, whitepaper, case study, formatted document | `report` | none | inspiration (instant) | all |
21
24
  | slides, deck, pitch, presentation, slideshow | `presentation` (dir: `deck`) | none | inspiration (instant) | all |
22
25
  | to-do, task list, notes app, guestbook, CRUD app, a form that SAVES/STORES submissions, anything that PERSISTS data or shares state across users/sessions, sign-in/accounts | `app-with-data` | `database: true` | runtime (async, poll) | local |
26
+ | REST API, backend for X, API endpoint(s), CRUD API, JSON API, webhook receiver — a backend/service that stores data and isn't a full web UI | `api-service` | `database: true` | runtime (async, poll) | local |
27
+ | chatbot, AI assistant, Q&A bot, conversational app, support bot, ask-me-anything, an app that talks to an LLM / generates text with AI | `ai-app` | `ai: true, database: true` | runtime (async, poll) | local |
23
28
 
24
29
  **Rule of thumb:** if the app must SAVE/remember data, share state across
25
- users/sessions, log in, or store submissions → it is persistent → `app-with-data`
26
- (runtime, local edition). Otherwise a static template deploys instantly anywhere.
30
+ users/sessions, log in, or store submissions → it is persistent → runtime, local
31
+ edition. Pick by shape: a full web UI → `app-with-data`; a plain backend/JSON API
32
+ (no UI) → `api-service`; an app that talks to an LLM → `ai-app` (adds `ai:`).
33
+ Otherwise a static template deploys instantly anywhere.
34
+
35
+ ## Held / pending platform (not yet buildable)
36
+
37
+ Two more archetypes are designed but blocked on platform work — the LLM should
38
+ know they are coming but must NOT author them yet:
39
+
40
+ | Intent | Would need | Status |
41
+ |---|---|---|
42
+ | scheduled task, cron job, "run every day/hour", periodic worker | a `type: cron` service (`schedule`, `timezone`) | **HELD** — platform issue #1543 (cron entities crash the online-check). Do not build. |
43
+ | RAG chatbot, "answer over my own docs", semantic search, retrieval-augmented Q&A | `ai-app` + `needs: { vector: pgvector }` | **HELD** — platform issue #1545 (pgvector crashes the deploy). Ship the plain `ai-app` (no vector) for now. |
27
44
 
28
45
  ## The full `needs:` vocabulary (the whole menu)
29
46
 
30
47
  `needs:` is a MAP declaring infrastructure capabilities. Values are `true` or an
31
48
  engine hint. Cron is NOT a need — it is a **service type** (`type: cron` with
32
- `schedule` + `timezone`). See the cloudgrid.yaml reference §5, §12, §14.
49
+ `schedule` + `timezone`). See the full cloudgrid.yaml reference §5–§6 via
50
+ `gridctl_fetch("doc", "cloudgrid-yaml")`.
33
51
 
34
52
  | `needs:` key | Provides | Injected env var(s) | Status |
35
53
  |---|---|---|---|
36
- | `database: true` | MongoDB primary datastore | `DATABASE_MONGODB_URL` (+legacy `MONGODB_URL`) | **Today via `requires: [mongodb]`** — `needs:` pending #1527 |
37
- | `cache: true` | Redis, LRU eviction | `CACHE_REDIS_URL` (+legacy `REDIS_URL`) | **Today via `requires: [redis]`** — `needs:` pending #1527 |
38
- | `kv: true` | Redis, no eviction | `KV_REDIS_URL` | Pending #1527 |
39
- | `queue: true` | Redis durable job queue | `QUEUE_REDIS_URL` | Pending #1527 |
40
- | `pubsub: true` | Redis pub/sub broadcast | `PUBSUB_REDIS_URL` | Pending #1527 |
41
- | `vector: pgvector` | pgvector embeddings DB | `VECTOR_PGVECTOR_URL` (+legacy `PGVECTOR_URL`) | Pending #1527 |
42
- | `object_storage: true` | GCS bucket | `OBJECT_STORAGE_GCS_BUCKET`, `OBJECT_STORAGE_GCS_REGION` | Pending #1527 |
43
- | `disk: true` | Persistent filesystem at `/data` | `DISK_PATH` | Pending #1527 |
44
- | `ai: true` | AI Gateway access | `AI_GATEWAY_URL` | **Today** (AI Gateway) |
54
+ | `database: true` | MongoDB primary datastore | `DATABASE_MONGODB_URL` (+legacy `MONGODB_URL`) | **Injects via `needs:`** |
55
+ | `cache: true` | Redis, LRU eviction | `CACHE_REDIS_URL` (+legacy `REDIS_URL`) | **Injects via `needs:`** |
56
+ | `kv: true` | Redis, no eviction | `KV_REDIS_URL` | Injects via `needs:` |
57
+ | `queue: true` | Redis durable job queue | `QUEUE_REDIS_URL` | Injects via `needs:` |
58
+ | `pubsub: true` | Redis pub/sub broadcast | `PUBSUB_REDIS_URL` | Injects via `needs:` |
59
+ | `vector: pgvector` | pgvector embeddings DB | `VECTOR_PGVECTOR_URL` (+legacy `PGVECTOR_URL`) | **Injects via `needs:`** |
60
+ | `object_storage: true` | GCS bucket | `OBJECT_STORAGE_GCS_BUCKET`, `OBJECT_STORAGE_GCS_REGION` | Injects via `needs:` |
61
+ | `disk: true` | Persistent filesystem at `/data` | `DISK_PATH` | Injects via `needs:` |
62
+ | `ai: true` | AI Gateway access | `AI_GATEWAY_URL` | Injects via `needs:` |
45
63
  | `type: cron` (service) | Scheduled job (`schedule`, `timezone`) | — | Service type, not a need |
46
64
 
47
- ### Injection status — today vs pending #1527
65
+ ### Injection status
48
66
 
49
- - **Injects TODAY:** `database` and `cache` — but ONLY via the deprecated
50
- `requires:` field (`requires: [mongodb]` → `MONGODB_URL`; `requires: [redis]`
51
- → `REDIS_URL`). `needs:`-based provisioning does NOT inject anything on the
52
- live deployer yet (bug #1527). `ai` (AI Gateway) is available today.
53
- - **Pending #1527:** `needs:`-based provisioning for everything — `vector`,
54
- `queue`, `pubsub`, `kv`, `object_storage`, `disk`, and `needs: database` /
55
- `needs: cache` once the deployer honors `needs:`.
67
+ - **`needs:` injects the connection env vars today.** `needs: { database: true }`
68
+ → `DATABASE_MONGODB_URL` (+legacy `MONGODB_URL`); `needs: { cache: true }` →
69
+ `CACHE_REDIS_URL` (+legacy `REDIS_URL`); `needs: { vector: pgvector }` →
70
+ `VECTOR_PGVECTOR_URL`; and so on across the nine needs. Author `needs:`.
71
+ (*Historical note: the deployer once did not inject from `needs:` — platform
72
+ bug #1527, now fixed and verified live.*)
73
+ - **`requires:` is the deprecated v1 alias.** Don't author new yaml with it.
56
74
  - **`needs:` and `requires:` cannot both be active** in one yaml — the validator
57
- rejects the combination ("use one or the other"). So a DB template ships
58
- `requires: [mongodb]` active with the canonical `needs: { database: true }`
59
- shown only as a **comment** (and declared in the workflow frontmatter as
60
- metadata), flipping to `needs:` when #1527 lands.
75
+ rejects the combination ("use one or the other"). So a DB template ships the
76
+ canonical `needs: { database: true }` active, with NO `requires:` (and declares
77
+ `needs: database` in the workflow frontmatter as metadata).
61
78
 
62
79
  ## How to choose
63
80
 
64
81
  1. Read the request; match it against the workflow `when:` triggers above.
65
- 2. Adopt that template's `needs:`. Persistence → `database`. (Future: scheduled →
66
- `cron` service; semantic search / RAG → `vector` + `ai`.)
82
+ 2. Adopt that template's `needs:`. Persistence → `database` (`app-with-data` or
83
+ `api-service`); talks to an LLM → `ai: true` + `database` (`ai-app`). (Held for
84
+ now: scheduled → a `cron` service, #1543; RAG → `vector: pgvector`, #1545.)
67
85
  3. Static (`needs: none`) → publish as an inspiration with `gridctl_drop`
68
86
  (instant, any edition). Anything with a `needs:` → runtime, local edition,
69
87
  `gridctl_plug` a linked folder, then poll to a live URL.