@ductape/mcp 0.2.19 → 0.2.21
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 +35 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -876,7 +876,8 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
876
876
|
// ctx.input – typed runtime input; always compiles to $Input{} operators
|
|
877
877
|
// ctx.sampleInput – compile-time sample for loop/branch discovery only
|
|
878
878
|
// ctx.step(tag, fn, rollback?, opts?) – define a durable step
|
|
879
|
-
// ctx.api.run({ app,
|
|
879
|
+
// ctx.api.run({ app, action, input }) – call an app action (NOT 'event' -- that field name
|
|
880
|
+
// only applies to ctx.database/ctx.notification/ctx.storage below, never ctx.api/ctx.action)
|
|
880
881
|
// ctx.database.query/insert/update/delete({ database, event, ... })
|
|
881
882
|
// ctx.graph.execute({ graph, action, input })
|
|
882
883
|
// ctx.notification.send/email/push/sms({ notification, event, ... })
|
|
@@ -2501,7 +2502,8 @@ Import an existing resource and register it on the product:
|
|
|
2501
2502
|
File is a JSON ARRAY — one entry per env, same product + component tag across all entries.
|
|
2502
2503
|
Each entry: { cloud, service, type, product, component, env, resource, region?, dbName? }
|
|
2503
2504
|
Supported service identifiers: s3, gcs, blob, rds, postgresql, cloudsql, sqs, pubsub,
|
|
2504
|
-
servicebus, neptune, cosmos-gremlin, opensearch, azure-search, atlas-cluster, aura-instance
|
|
2505
|
+
servicebus, neptune, cosmos-gremlin, opensearch, azure-search, atlas-cluster, aura-instance,
|
|
2506
|
+
vertex-vector-search, spanner-graph, dynamodb, keyspaces, mysql
|
|
2505
2507
|
|
|
2506
2508
|
Provision a brand-new resource and register it:
|
|
2507
2509
|
ductape_cli("cloud resources provision-persist-all -f all-envs.json --json")
|
|
@@ -2509,6 +2511,20 @@ Provision a brand-new resource and register it:
|
|
|
2509
2511
|
List available tiers first: ductape_cli("cloud tiers --provider aws --type database --db-type postgresql --json")
|
|
2510
2512
|
NEVER infer region, tier, or cost — always list and confirm with the user first.
|
|
2511
2513
|
Atlas and Neo4j Aura are IMPORT-ONLY — provision is not supported for these providers.
|
|
2514
|
+
Per-provider provisionable services: aws → s3, sqs, rds, neptune, opensearch, dynamodb, keyspaces.
|
|
2515
|
+
gcp → gcs, cloudsql, pubsub, spanner-graph, vertex-vector-search.
|
|
2516
|
+
azure → blob, servicebus, postgresql, mysql, cosmos-gremlin, azure-search.
|
|
2517
|
+
|
|
2518
|
+
vertex-vector-search (GCP): additional per-entry params: dimensions (default 1536), metric
|
|
2519
|
+
("cosine"|"euclidean"|"dotproduct", default cosine), algorithm ("tree-ah"|"brute-force",
|
|
2520
|
+
default tree-ah), deployIndex (default true — set false to create the Index and Index
|
|
2521
|
+
Endpoint without deploying, avoiding ongoing compute cost until you deploy manually),
|
|
2522
|
+
machineType (default "e2-standard-2"), minReplicaCount/maxReplicaCount (default 1).
|
|
2523
|
+
Provisioning creates the Index Endpoint, the actual Index (STREAM_UPDATE method, required
|
|
2524
|
+
for runtime vector.upsert/upsertOne), and deploys the Index to the Endpoint — all three are
|
|
2525
|
+
needed for the result to be queryable. A DEPLOYED index runs dedicated compute continuously
|
|
2526
|
+
(real ongoing cost, not free-tier) — always confirm machine type/replica count with the user
|
|
2527
|
+
before provisioning, the same as any other tier/cost decision.
|
|
2512
2528
|
|
|
2513
2529
|
VPC connector (private networking):
|
|
2514
2530
|
ductape_cli("cloud connections vpc update <tag> --vpc-id vpc-xxx --subnet-ids subnet-1,subnet-2")
|
|
@@ -2680,7 +2696,7 @@ CONNECT A DISCOVERED APP THROUGH MCP:
|
|
|
2680
2696
|
obtain user approval when the user has not already requested the connection.
|
|
2681
2697
|
|
|
2682
2698
|
ONLY after all five steps can any code call:
|
|
2683
|
-
ctx.api.run({ app: '<app_tag>',
|
|
2699
|
+
ctx.api.run({ app: '<app_tag>', action: '<action_tag>', input: { ... } }) ← in a feature handler
|
|
2684
2700
|
actions.run([{ product, env, app: '<app_tag>', action: '<action_tag>', input }]) ← at runtime
|
|
2685
2701
|
|
|
2686
2702
|
ctx.api (alias for ctx.action) is NOT a generic HTTP call. It ONLY invokes a pre-registered
|
|
@@ -2745,8 +2761,11 @@ Run an action at runtime:
|
|
|
2745
2761
|
ductape_execute("actions.dispatch", [{ product, env, app, action, input, schedule? }])
|
|
2746
2762
|
|
|
2747
2763
|
In a Ductape feature handler, call the registered action through:
|
|
2748
|
-
await ctx.api.run({ app: "<app_tag>",
|
|
2764
|
+
await ctx.api.run({ app: "<app_tag>", action: "<action_tag>", input: { ... } })
|
|
2749
2765
|
ctx.api is the supported feature-context surface (also described as ctx.action in older code).
|
|
2766
|
+
NEVER use 'event' as the field name here -- that is only correct for ctx.database/ctx.notification/
|
|
2767
|
+
ctx.storage steps. ctx.api.run's real field is 'action'; passing 'event' instead silently produces
|
|
2768
|
+
an unset step and fails feature compilation with "did not record a portable operation".
|
|
2750
2769
|
There is no ctx.apps, ctx.integrations, or generic external-HTTP feature surface.
|
|
2751
2770
|
|
|
2752
2771
|
PAYSTACK CONFIGURATION:
|
|
@@ -3657,8 +3676,8 @@ STEP 8 — SET rollbacks for reversible steps
|
|
|
3657
3676
|
ctx.api.run requires a pre-registered Ductape App — 'stripe' below is the tag of a registered App:
|
|
3658
3677
|
const charge = await ctx.step(
|
|
3659
3678
|
'charge',
|
|
3660
|
-
async () => ctx.api.run({ app: 'stripe',
|
|
3661
|
-
async (result) => ctx.api.run({ app: 'stripe',
|
|
3679
|
+
async () => ctx.api.run({ app: 'stripe', action: 'create-charge', input: { amount: ctx.input.amount } }),
|
|
3680
|
+
async (result) => ctx.api.run({ app: 'stripe', action: 'refund', input: { chargeId: result.id } })
|
|
3662
3681
|
);
|
|
3663
3682
|
|
|
3664
3683
|
Code-first ctx step types currently record: function | action | database | graph | vector | session |
|
|
@@ -5135,7 +5154,8 @@ function handleCliFlags() {
|
|
|
5135
5154
|
}
|
|
5136
5155
|
async function main() {
|
|
5137
5156
|
const { McpServer, StdioServerTransport } = await loadMcpSdk();
|
|
5138
|
-
const
|
|
5157
|
+
const { version: mcpVersion } = createRequire(import.meta.url)('../package.json');
|
|
5158
|
+
const server = new McpServer({ name: 'ductape-mcp', version: mcpVersion });
|
|
5139
5159
|
const transport = new StdioServerTransport();
|
|
5140
5160
|
const cliHandler = async (args) => {
|
|
5141
5161
|
const cli = checkCli();
|
|
@@ -5162,7 +5182,8 @@ async function main() {
|
|
|
5162
5182
|
const isAuthCommand = firstWord === 'login' || firstWord === 'logout';
|
|
5163
5183
|
const isLocalMigrationGuidance = (firstWord === 'migrate-codebase' && !args.command.includes('--ensure-product')) ||
|
|
5164
5184
|
firstWord.startsWith('migration-');
|
|
5165
|
-
|
|
5185
|
+
const isDiagnostic = firstWord === 'doctor';
|
|
5186
|
+
if (!isAuthCommand && !isLocalMigrationGuidance && !isDiagnostic) {
|
|
5166
5187
|
// Cache successful authentication, but re-check a missing/expired session on every call.
|
|
5167
5188
|
// The user may complete `ductape login` in another terminal while this MCP process remains
|
|
5168
5189
|
// alive; caching "none" would otherwise make the MCP blind to the newly written session.
|
|
@@ -5524,6 +5545,11 @@ async function main() {
|
|
|
5524
5545
|
}
|
|
5525
5546
|
};
|
|
5526
5547
|
if (typeof server.registerTool === 'function') {
|
|
5548
|
+
server.registerTool('ductape_doctor', {
|
|
5549
|
+
title: 'Ductape Compatibility Doctor',
|
|
5550
|
+
description: 'Report CLI, SDK, NestJS, MCP, API/schema revision, authentication, workspace, and project linkage facts without exposing credentials.',
|
|
5551
|
+
inputSchema: z.object({}).shape,
|
|
5552
|
+
}, async () => cliHandler({ command: 'doctor --json' }));
|
|
5527
5553
|
server.registerTool('ductape_execute', {
|
|
5528
5554
|
title: 'Ductape SDK Execute',
|
|
5529
5555
|
description: 'Execute a Ductape SDK RUNTIME operation via the backend proxy (publishable key).\n\n' +
|
|
@@ -5767,6 +5793,7 @@ async function main() {
|
|
|
5767
5793
|
}, cliHandler);
|
|
5768
5794
|
}
|
|
5769
5795
|
else if (typeof server.tool === 'function') {
|
|
5796
|
+
server.tool('ductape_doctor', z.object({}).shape, async () => cliHandler({ command: 'doctor --json' }));
|
|
5770
5797
|
server.tool('ductape_execute', executeInputSchema.shape, executeHandler);
|
|
5771
5798
|
server.tool('ductape_generate_payload', payloadGenerateInputSchema.shape, payloadGenerateHandler);
|
|
5772
5799
|
server.tool('ductape_generate_snippet', snippetGenerateInputSchema.shape, snippetGenerateHandler);
|