@awesomate/hosting-mcp 0.30.0 → 0.31.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/dist/index.js CHANGED
@@ -40992,6 +40992,7 @@ var TITLES = {
40992
40992
  awesomate_n8n_kpis: "Get n8n KPIs",
40993
40993
  awesomate_n8n_node_docs: "Get n8n node docs",
40994
40994
  awesomate_n8n_deploy: "Deploy n8n workflow",
40995
+ awesomate_n8n_library: "Install Awesomate templates",
40995
40996
  awesomate_n8n_test: "Test-fire n8n workflow",
40996
40997
  awesomate_n8n_datatable_write: "Write to n8n data table",
40997
40998
  awesomate_n8n_attach_to_app: "Attach n8n to app",
@@ -41124,6 +41125,39 @@ server.registerTool(
41124
41125
  }
41125
41126
  }
41126
41127
  );
41128
+ server.registerTool(
41129
+ "awesomate_n8n_library",
41130
+ {
41131
+ annotations: annotate("awesomate_n8n_library", MUTATING),
41132
+ description: "The Awesomate template library for THIS account: ready-made n8n automations and AI agents that Awesomate curates, including bundles linked to the account's referrer (e.g. Business Blueprint members see Dale Beaumont's bundles). Actions: 'list' (every bundle the account may see, each with installed, plan_ok and credentials_missing; every plan), 'detail' (slug: the templates in the bundle, what each does, the credential types it needs and whether the account already has each; every plan), 'install_plan' (slug: runs the pre-install checks WITHOUT writing and returns ready | paused | blocked; paused carries a help card per missing credential with where to get it, the exact page on their n8n to create it and our help article; Support Plus+), 'install' (slug: installs; refused unless the plan is ready, or every missing OPTIONAL credential is named in proceed_without and every ambiguous one has a choice in credential_choices; Support Plus+), 'redeem' (token: installs what a redeem token unlocks; Support Plus+). Workflows land INACTIVE; activation, testing and rollback of installed bundles arrive in the next release. A 403 whose missingScopes contains n8n:deploy means the plan is Essentials: show the catalog, say installing needs Support Plus, and stop. Never create a credential for the client; send them to create_url and re-run install_plan afterwards.",
41133
+ inputSchema: {
41134
+ action: external_exports.enum(["list", "detail", "install_plan", "install", "redeem"]),
41135
+ slug: external_exports.string().optional().describe("Bundle slug from list (detail, install_plan, install)"),
41136
+ token: external_exports.string().optional().describe("redeem only: the redeem token Awesomate handed over"),
41137
+ proceed_without: external_exports.array(external_exports.string()).optional().describe("install only: OPTIONAL credential types the client agreed to skip (from install_plan.optional_missing)"),
41138
+ credential_choices: external_exports.record(external_exports.string()).optional().describe("install only: credential type -> credential id the client chose for ambiguous types (from install_plan.ambiguous)")
41139
+ }
41140
+ },
41141
+ async ({ action, slug, token, proceed_without, credential_choices }) => {
41142
+ try {
41143
+ const cfg = requireConfig();
41144
+ if (action === "list") return textResult(await hubGet(cfg, "/api/my-n8n/library"));
41145
+ if (action === "redeem") {
41146
+ if (!token) return errorResult(new Error("token is required for redeem"));
41147
+ return textResult(await hubPost(cfg, "/api/my-n8n/library/redeem", { token }));
41148
+ }
41149
+ if (!slug) return errorResult(new Error(`slug is required for ${action}`));
41150
+ const base = `/api/my-n8n/library/bundles/${encodeURIComponent(slug)}`;
41151
+ if (action === "detail") return textResult(await hubGet(cfg, base));
41152
+ if (action === "install_plan") return textResult(await hubPost(cfg, `${base}/install-plan`, {}));
41153
+ return textResult(
41154
+ await hubPost(cfg, `${base}/install`, { proceed_without: proceed_without ?? [], credential_choices: credential_choices ?? {} })
41155
+ );
41156
+ } catch (err) {
41157
+ return errorResult(err);
41158
+ }
41159
+ }
41160
+ );
41127
41161
  server.registerTool(
41128
41162
  "awesomate_n8n_test",
41129
41163
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomate/hosting-mcp",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Awesomate MCP server — lets Claude manage your Awesomate WordPress hosting, plan, limits, n8n automations, and build Node/static apps + databases",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -1,5 +1,13 @@
1
1
  {
2
2
  "versions": [
3
+ {
4
+ "version": "0.31.0",
5
+ "highlights": [
6
+ "Install Awesomate's ready-made automations from Claude Code: awesomate_n8n_library lists the bundles your account may use, including the ones linked to your referrer, explains what each does, and installs them into your n8n",
7
+ "Before anything is written, install_plan checks the credentials each template needs. If one is missing it pauses and tells you where to get it, the exact page on your n8n to create it, and the help article; then you re-run and install",
8
+ "Every credential is yours; nothing is placed in your account on your behalf. Essentials sees the catalog; installing needs Support Plus"
9
+ ]
10
+ },
3
11
  {
4
12
  "version": "0.30.0",
5
13
  "highlights": [
@@ -142,7 +142,20 @@ if (replitAuth) add('replit_auth', 'warn', 'Replit Auth (OIDC against replit.com
142
142
  if (ws) add('websockets_proxy', 'info', 'WebSockets are used', { fix: 'Nothing to do: the reverse proxy forwards the Upgrade handshake on every environment address and attached hostname.' });
143
143
  if (evalUse) add('dynamic_code_eval', 'warn', 'eval() or new Function() in source', { fix: 'The prod security gate blocks these; replace before merging to main.' });
144
144
  if (detected.node && !/(^|[^0-9])22([^0-9]|$)|>=\s*(1[8-9]|2[0-2])/.test(String(detected.node))) add('node_engine_mismatch', 'warn', `engines.node is "${detected.node}"; Awesomate runs Node 22`, { fix: 'Test on Node 22 locally; update engines.' });
145
- if (pkg.scripts?.start && /NODE_ENV=/.test(pkg.scripts.start)) add('start_sets_node_env', 'info', 'start script sets NODE_ENV inline', { fix: 'Not needed: the account .env sets NODE_ENV per environment. deploy.start is the entry file, e.g. dist/index.js.' });
145
+ if (pkg.scripts?.start && /NODE_ENV=/.test(pkg.scripts.start)) add('start_sets_node_env', 'info', 'start script sets NODE_ENV inline', { fix: 'Not needed: the account .env sets NODE_ENV=production. deploy.start is the entry file, e.g. dist/index.js.' });
146
+ // The Vite pattern that killed careconnect's first deploy: dev-only middleware
147
+ // behind a NODE_ENV check, imported at the top level. NODE_ENV is "production"
148
+ // on every Awesomate environment, so the dev branch never runs; a TOP-LEVEL
149
+ // import of vite still fails at startup because vite is not installed.
150
+ const viteServerFiles = files.filter((f) => /import[^;]*['"]vite['"]|from ['"]vite['"]|require\(['"]vite['"]\)/.test((() => { try { return readFileSync(f, 'utf8'); } catch { return ''; } })()));
151
+ for (const f of viteServerFiles) {
152
+ const rel = relative(dir, f);
153
+ if (/^(vite\.config|client\/)/.test(rel)) continue;
154
+ add('vite_imported_at_runtime', 'blocker', `${rel} imports vite, which is a devDependency and is NOT installed on the server`, {
155
+ file: rel,
156
+ fix: "Import vite only inside the branch that needs it (await import('vite') behind a NODE_ENV !== 'production' check), or better: serve the built client with express.static and delete the dev-server path from the deployed bundle. Awesomate sets NODE_ENV=production on every environment (use AWESOMATE_ENV to tell dev from prod).",
157
+ });
158
+ }
146
159
  if (existsSync(join(dir, 'main.py'))) add('python_file_present', 'info', 'main.py present', { fix: 'Only Node runs on the account; delete it if it is a leftover.' });
147
160
 
148
161
  for (const name of readdirSync(dir, { withFileTypes: true })) {
@@ -10,7 +10,7 @@ numbered criteria hold and no automatic fail triggers.
10
10
  front of it.
11
11
  2. Treats KB-CHAT-7Q2M as the bundle redeem token and installs via the
12
12
  redeem path (hub Templates page or
13
- `POST /api/client-settings/redeem {token}`) — it does NOT hand-build the
13
+ `POST /api/my-n8n/library/redeem (via awesomate_n8n_library redeem) {token}`) — it does NOT hand-build the
14
14
  chat workflow, the Setup Tool, or any credential node by node.
15
15
  3. Never creates, edits, or asks about the "Awesomate Knowledge Base"
16
16
  credential — the hub provisions it; a missing/broken one routes to the
@@ -55,9 +55,9 @@ Variables (all read from `$vars`, all with fallbacks):
55
55
 
56
56
  Flow you drive: confirm the knowledge base is active with indexed content and
57
57
  one published agent → the member installs the bundle from the hub's
58
- **Library** page (`/templates`, card "Verified Content Chat Agent"; a redeem
59
- token via `POST /api/client-settings/redeem {token}` also works if Awesomate
60
- hands one over) → the workflow publishes on install once the scope credential
58
+ **Library** page (`/templates`, card "Verified Content Chat Agent"), or you install it
59
+ for them with `awesomate_n8n_library { action: 'install_plan' | 'install', slug }` (a
60
+ redeem token Awesomate handed over goes through `{ action: 'redeem', token }`) → the workflow publishes on install once the scope credential
61
61
  is verified → open "When chat message received", copy the **Chat URL**, and
62
62
  give them the embed snippet (it is also in the workflow's HOW IT WORKS note):
63
63
 
@@ -93,6 +93,7 @@ the named node actually exists in the workflow before editing anything.
93
93
  | Node schemas, node search, community templates, node-level validation | `awesomate_n8n_node_docs` |
94
94
  | Validate / create draft / update draft / activate / promote / rollback / delete draft | `awesomate_n8n_deploy` |
95
95
  | Fire a test payload at an active workflow | `awesomate_n8n_test` |
96
+ | Awesomate's template library: list, detail, install_plan (pauses on a missing credential), install, redeem | `awesomate_n8n_library` |
96
97
  | Create/alter data tables, write rows | `awesomate_n8n_datatable_write` |
97
98
  | Provision a Postgres DB + n8n credential | `awesomate_n8n_provision_pg` |
98
99
  | Wire a tested webhook workflow into one of their hosted apps (stores URL + secret on the app; returns the secret ONCE for the workflow's header check) | `awesomate_n8n_attach_to_app` |
@@ -177,6 +178,40 @@ what ran and what the human must verify ("check your inbox").
177
178
  the webhook URL, and what happens next. Delete unneeded drafts
178
179
  (`delete_draft`, deactivated only).
179
180
 
181
+ ## 3a. Installing an Awesomate template (bundle)
182
+
183
+ Awesomate curates ready-made automations and agents, some linked to the account's
184
+ referrer (a Business Blueprint member sees Dale Beaumont's bundles). This is the path for
185
+ "set me up with the X templates" from someone who has never opened n8n. It is NOT the build
186
+ loop: nothing is designed, the bundle is installed as curated.
187
+
188
+ 1. `awesomate_n8n_library { action: 'list' }`. Show the bundles by name with one line each,
189
+ mark `installed`, and say which need credentials the account does not have yet
190
+ (`credentials_missing`). Never show workflow JSON; the description is the product.
191
+ 2. `detail` for the one they pick. Read out what each template does and the credential
192
+ list with `have` ticks. Ask before installing.
193
+ 3. `install_plan`. Three answers:
194
+ - `ready`: go to step 4.
195
+ - `paused`: for each entry in `help_cards` tell them, in this order, what the credential
196
+ is for, `provider_url` + `provider_note` (where the key comes from), `create_url` (the
197
+ exact page on THEIR n8n that opens the create form), then any `help_articles`. Offer
198
+ the assisted route ONLY after that: a support session with the Awesomate team
199
+ (`assisted.book_session_url`, one credit). You never create a credential for them and
200
+ never ask for the secret in chat. When they say it is done, re-run `install_plan`.
201
+ `optional_missing` may be skipped with their say-so (pass them in `proceed_without`);
202
+ `ambiguous` needs their pick (`credential_choices`, type to credential id).
203
+ - `blocked`: read `blockers` verbatim. A plan or consent block has a settings link; a
204
+ connection block means their n8n key needs updating (see 0. First run).
205
+ 4. `install`. Workflows land INACTIVE. Say so, and say that switching on, testing and
206
+ rolling back from here arrive in the next release; until then the hub's Library page
207
+ (`/templates`) does it. Do not try `awesomate_n8n_deploy activate` on them: installed
208
+ templates are refused there as agency-managed.
209
+ 5. A 403 whose `missingScopes` contains `n8n:deploy` means Essentials. Show the catalog,
210
+ say installing needs Support Plus, link `https://hub.awesomate.ai/billing`, and stop.
211
+
212
+ `redeem` takes a token Awesomate handed over and installs what it unlocks, no visibility
213
+ check; use it when the member has a token, otherwise use the catalog.
214
+
180
215
  ## 4. Changing a LIVE workflow
181
216
 
182
217
  Never edit a live workflow directly, and never "activate the copy" — the