@ductape/mcp 0.2.24 → 0.2.26
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 +44 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5442,11 +5442,14 @@ const DUCTAPE_FIRST_INSTRUCTIONS = 'Ductape-first: before writing custom code fo
|
|
|
5442
5442
|
'(features.define + ctx.step) instead of an ad-hoc function chain — Features get durable ' +
|
|
5443
5443
|
'steps, retries, and compensation for free. Route any call to an unreliable or swappable ' +
|
|
5444
5444
|
'external provider (payment, email/SMS, any third-party API) through a Quota or Fallback with ' +
|
|
5445
|
-
'2+ providers instead of one hardcoded call. Gate risky dependencies with Healthchecks.
|
|
5446
|
-
'
|
|
5447
|
-
'
|
|
5448
|
-
'
|
|
5449
|
-
'
|
|
5445
|
+
'2+ providers instead of one hardcoded call. Gate risky dependencies with Healthchecks. Never ' +
|
|
5446
|
+
'hardcode credentials — store them with secrets.create and reference them as $Secret{KEY} in ' +
|
|
5447
|
+
'action, database, storage, and notification config. Apps, actions, and resources are meant ' +
|
|
5448
|
+
'to be defined once and reused across products and environments — check what already exists ' +
|
|
5449
|
+
'before creating something new. Treat the ductape/ folder (features/, database/schema.json, ' +
|
|
5450
|
+
'notifications.json, events/) as the source of truth: define there first, sync/apply, then ' +
|
|
5451
|
+
'write application code against it — never the reverse. Invoke the "ductape-first-approach" ' +
|
|
5452
|
+
'prompt for the full doctrine with concrete API shapes before scaffolding a new backend.';
|
|
5450
5453
|
// The detailed doctrine, invoked on demand via the "ductape-first-approach" prompt rather than
|
|
5451
5454
|
// forced onto every session. Grounded in the actual module contracts this server exposes
|
|
5452
5455
|
// (features, quotas, fallback, health, jobs) — keep it in sync with ductape_docs topics.
|
|
@@ -5467,12 +5470,25 @@ const DUCTAPE_FIRST_DOCTRINE = 'Follow this checklist before defaulting to plain
|
|
|
5467
5470
|
'ductape/notifications.json + "ductape apply notifications", ductape/events/*.topic.json + ' +
|
|
5468
5471
|
'"ductape apply events". Define the capability there first, then write application code that ' +
|
|
5469
5472
|
'calls into it — never duplicate the logic inline.\n\n' +
|
|
5470
|
-
'5.
|
|
5471
|
-
'and
|
|
5472
|
-
'
|
|
5473
|
+
'5. Secrets never live in code or plain config. Store every credential with secrets.create ' +
|
|
5474
|
+
'(scoped and env-aware), then reference it as $Secret{KEY} wherever a credential is needed — ' +
|
|
5475
|
+
'action auth headers, database/storage connection config, notification provider config. ' +
|
|
5476
|
+
'Ductape resolves the reference server-side at call time; the literal value should never ' +
|
|
5477
|
+
'appear in a file, a log, or a publishable-key/frontend context. Rotate with secrets.update, ' +
|
|
5478
|
+
'never by hardcoding a replacement.\n\n' +
|
|
5479
|
+
'6. Reuse before you rebuild. Apps, actions, database/storage/cache components, and cloud ' +
|
|
5480
|
+
'connections are meant to be defined once and shared across every product and environment ' +
|
|
5481
|
+
'that needs them, not recreated per project. Before scaffolding anything new, run ' +
|
|
5482
|
+
'ductape_cli("products components list --product-tag <tag> --json"), ductape_cli("apps ' +
|
|
5483
|
+
'list"), and ductape_cli("cloud connections list") to see what already covers the need, and ' +
|
|
5484
|
+
'link or extend it instead of duplicating. The same applies to Functions ' +
|
|
5485
|
+
'(ductape.functions.register/use) — register portable business logic once and reuse it across ' +
|
|
5486
|
+
'every Feature that needs it. Call ductape_schema before constructing any new resource file, ' +
|
|
5487
|
+
'so you match the exact required shape rather than guessing.\n\n' +
|
|
5473
5488
|
'Default assumption for any backend built through this MCP server: orchestration goes through ' +
|
|
5474
|
-
'Features, provider risk goes through Quotas/Fallback,
|
|
5475
|
-
'
|
|
5489
|
+
'Features, provider risk goes through Quotas/Fallback, credentials go through Secrets, shared ' +
|
|
5490
|
+
'capability goes through reuse, and the ductape/ folder is what ships — not a database table ' +
|
|
5491
|
+
'and a CRUD wrapper.';
|
|
5476
5492
|
async function main() {
|
|
5477
5493
|
const { McpServer, StdioServerTransport } = await loadMcpSdk();
|
|
5478
5494
|
const { version: mcpVersion } = createRequire(import.meta.url)('../package.json');
|
|
@@ -6130,24 +6146,33 @@ async function main() {
|
|
|
6130
6146
|
' - Atlas (MongoDB Atlas) import flow — service identifier is "atlas-cluster" (required, not optional):\n' +
|
|
6131
6147
|
' IMPORTANT: dbName is mandatory for every MongoDB env — see "MONGODB CLOUD CONNECTION RULE" in the\n' +
|
|
6132
6148
|
' databases module above. The SDK enforces this at create time; omitting it throws a validation error.\n' +
|
|
6149
|
+
' An existing Atlas cluster is NEVER a blocker. Atlas has no concept of provisioning a new cluster\n' +
|
|
6150
|
+
' per database — a MongoDB "database" is just a named namespace inside a cluster, created on first\n' +
|
|
6151
|
+
' write. Any number of database components may point at the SAME cluster (same cloud connection,\n' +
|
|
6152
|
+
' same resource/cluster name) as long as each uses a DIFFERENT dbName. Needing a new database on a\n' +
|
|
6153
|
+
' cluster that already has one imported is the normal path, not a conflict — do not stop or ask\n' +
|
|
6154
|
+
' the user to provision a new cluster; just import again with a different dbName.\n' +
|
|
6133
6155
|
' Step 1 — discover the cluster name:\n' +
|
|
6134
6156
|
' ductape_cli("cloud resources list -f /tmp/atlas-list.json --json")\n' +
|
|
6135
6157
|
' File: {"cloud": "<atlas-connection-tag>", "service": "atlas-cluster"}\n' +
|
|
6136
6158
|
' Returns a list of clusters; note the "name" field (this is your resource identifier).\n' +
|
|
6137
|
-
' Step 2 —
|
|
6159
|
+
' Step 2 — decide new database vs. repoint an existing one:\n' +
|
|
6138
6160
|
' ductape_cli("resources databases list <product_tag> --json")\n' +
|
|
6139
|
-
'
|
|
6140
|
-
'
|
|
6141
|
-
'
|
|
6142
|
-
'
|
|
6161
|
+
' Only skip importing when you want an EXISTING component (same product, env, and dbName) to\n' +
|
|
6162
|
+
' keep pointing at the same database — that is a repoint, not a new database, and should go\n' +
|
|
6163
|
+
' through ductape_cli resource update (or Workbench) instead of a fresh import.\n' +
|
|
6164
|
+
' Otherwise — including "same cluster, different database" — proceed to Step 3 with a new\n' +
|
|
6165
|
+
' component tag and a dbName distinct from every other component already on that cluster.\n' +
|
|
6166
|
+
' Step 3 — import (one entry per new database; reusing a cluster across components is expected):\n' +
|
|
6143
6167
|
' Use import-persist-all with one entry per product env. Required fields per entry:\n' +
|
|
6144
6168
|
' cloud (connection tag), service: "atlas-cluster", type: "databases",\n' +
|
|
6145
6169
|
' product, component (new tag), env, resource (cluster name from Step 1),\n' +
|
|
6146
|
-
' dbName (the MongoDB database name to connect to —
|
|
6147
|
-
' Example
|
|
6148
|
-
'
|
|
6170
|
+
' dbName (the MongoDB database name to connect to — must be unique per cluster, not per workspace).\n' +
|
|
6171
|
+
' Example — a second database ("billing-db") added to the same cluster as an existing "core-db":\n' +
|
|
6172
|
+
' [{"cloud":"atlas-tag","service":"atlas-cluster","type":"databases",\n' +
|
|
6173
|
+
' "product":"my-product","component":"billing-db","env":"snd","resource":"Cluster0","dbName":"billing_snd"},\n' +
|
|
6149
6174
|
' {"cloud":"atlas-tag","service":"atlas-cluster","type":"databases",\n' +
|
|
6150
|
-
' "product":"my-product","component":"
|
|
6175
|
+
' "product":"my-product","component":"billing-db","env":"prd","resource":"Cluster0","dbName":"billing_prd"}]\n' +
|
|
6151
6176
|
' - Message broker / event broker import:\n' +
|
|
6152
6177
|
' CLI accepts these aliases for the messageBrokers module: events, event, broker, brokers, message-brokers.\n' +
|
|
6153
6178
|
' List existing brokers: ductape_cli("resources events list --json")\n' +
|