@ductape/mcp 0.1.4 → 0.1.5
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 +53 -33
- package/package.json +1 -1
- package/src/index.ts +53 -33
package/dist/index.js
CHANGED
|
@@ -31,20 +31,39 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
31
31
|
These require an access key and CANNOT be done via ductape_execute (publishable key only).
|
|
32
32
|
→ Use ductape_cli instead. Examples:
|
|
33
33
|
ductape_cli("products list")
|
|
34
|
-
ductape_cli("
|
|
35
|
-
ductape_cli("environments list my-product")
|
|
34
|
+
ductape_cli("products create --name \\"My Product\\" --tag my-product")
|
|
36
35
|
ductape_cli("cloud connections list")
|
|
36
|
+
ductape_cli("link --product my-product --env dev")
|
|
37
37
|
If the CLI is not installed, ductape_cli will return install instructions automatically.
|
|
38
|
+
NOTE: Environments and app actions are configured in the Workbench UI — there are no CLI commands for them.
|
|
39
|
+
|
|
40
|
+
DECLARATIVE SYNC (apply sessions, notifications, events from code; run DB migrations)
|
|
41
|
+
→ Also use ductape_cli. The project must be linked first (ductape init --link).
|
|
42
|
+
ductape_cli("apply") # sync all: sessions + notifications + events
|
|
43
|
+
ductape_cli("apply sessions") # sessions only
|
|
44
|
+
ductape_cli("apply notifications") # notifications only
|
|
45
|
+
ductape_cli("apply events") # event brokers only
|
|
46
|
+
ductape_cli("apply --dry-run") # preview without changes
|
|
47
|
+
ductape_cli("db schema generate") # diff schema.json → write migration files
|
|
48
|
+
ductape_cli("db schema generate --destructive") # also generate drop operations
|
|
49
|
+
ductape_cli("db migrate") # apply pending migration files
|
|
50
|
+
ductape_cli("db migrate --dry-run") # preview without applying
|
|
51
|
+
ductape_cli("db migrate --env prd") # apply to a specific environment
|
|
52
|
+
ductape_cli("db migrate status") # show applied vs pending migrations
|
|
53
|
+
ductape_cli("db migrate status --json") # machine-readable status
|
|
54
|
+
ductape_cli("db migrate rollback") # roll back last migration
|
|
55
|
+
ductape_cli("db migrate rollback -n 3") # roll back last 3 migrations
|
|
38
56
|
|
|
39
57
|
1. ASSET CREATION / UPDATE (create, update, add, register… for ANY asset type)
|
|
40
58
|
ALL creation and update operations require an access key and CANNOT go through ductape_execute.
|
|
41
59
|
→ Use ductape_cli for every create/update operation. Examples:
|
|
42
|
-
ductape_cli("
|
|
60
|
+
ductape_cli("apps create --name \\"Email Service\\" --description \\"Transactional email\\"")
|
|
43
61
|
ductape_cli("apps list")
|
|
44
|
-
ductape_cli("
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
ductape_cli("resources storage list")
|
|
63
|
+
ductape_cli("resources database create -f db-config.json")
|
|
64
|
+
This applies to: products, apps, and resources (databases, storage, caches, etc.),
|
|
65
|
+
cloud connections, and secrets. Environments, app actions, auths, features, quotas,
|
|
66
|
+
fallbacks, jobs, and healthchecks are configured in the Workbench UI.
|
|
48
67
|
|
|
49
68
|
2. RUNTIME OPERATIONS (run, dispatch, execute, start, send, produce, query, insert, update, delete…)
|
|
50
69
|
The "input" field shape is product- and operation-specific — it is NOT derivable from Joi validators.
|
|
@@ -788,27 +807,18 @@ function buildSnippet(language, payload, operationFamily, method) {
|
|
|
788
807
|
}
|
|
789
808
|
// ─── CLI helpers ─────────────────────────────────────────────────────────────
|
|
790
809
|
const ADMIN_SUBCOMMANDS = [
|
|
791
|
-
'
|
|
792
|
-
'
|
|
793
|
-
'workspaces',
|
|
794
|
-
'
|
|
810
|
+
'login', 'logout', 'whoami',
|
|
811
|
+
'profiles',
|
|
812
|
+
'workspaces',
|
|
813
|
+
'link', 'unlink', 'init',
|
|
814
|
+
'products', 'apps',
|
|
815
|
+
'resources',
|
|
795
816
|
'cloud',
|
|
796
817
|
'secrets',
|
|
797
|
-
'databases',
|
|
798
|
-
'storage',
|
|
799
|
-
'graphs',
|
|
800
|
-
'vectors',
|
|
801
|
-
'brokers',
|
|
802
|
-
'notifications',
|
|
803
|
-
'sessions',
|
|
804
|
-
'caches',
|
|
805
|
-
'jobs',
|
|
806
818
|
'generate',
|
|
807
|
-
'
|
|
808
|
-
'
|
|
809
|
-
'
|
|
810
|
-
'logout',
|
|
811
|
-
'whoami',
|
|
819
|
+
'apply',
|
|
820
|
+
'db',
|
|
821
|
+
'graph',
|
|
812
822
|
];
|
|
813
823
|
function checkCli() {
|
|
814
824
|
try {
|
|
@@ -842,10 +852,14 @@ function runCli(command) {
|
|
|
842
852
|
}
|
|
843
853
|
const cliInputSchema = z.object({
|
|
844
854
|
command: z.string().describe('The ductape CLI command to run, without the leading "ductape" word. ' +
|
|
845
|
-
'Examples: "products list", "
|
|
846
|
-
'"
|
|
847
|
-
'
|
|
848
|
-
'
|
|
855
|
+
'Examples: "products list", "products create --name \\"My Product\\" --tag my-product", ' +
|
|
856
|
+
'"apps list", "apps create -f app.json", "resources storage list", ' +
|
|
857
|
+
'"cloud connections list", "link --product my-product --env dev".\n\n' +
|
|
858
|
+
'Use this tool for administrative operations: creating or updating products, apps, ' +
|
|
859
|
+
'resources (databases, storage, caches…), cloud connections, secrets, ' +
|
|
860
|
+
'and for apply/migrate workflows.\n\n' +
|
|
861
|
+
'Note: environments, app actions, features, quotas, fallbacks, and jobs are configured ' +
|
|
862
|
+
'in the Workbench UI — there are no CLI commands for them.\n\n' +
|
|
849
863
|
'The CLI uses the user\'s local logged-in session (ductape login) — no key is required.'),
|
|
850
864
|
});
|
|
851
865
|
async function loadMcpSdk() {
|
|
@@ -1035,11 +1049,17 @@ async function main() {
|
|
|
1035
1049
|
title: 'Ductape CLI',
|
|
1036
1050
|
description: 'Run a Ductape CLI command for administrative operations.\n\n' +
|
|
1037
1051
|
'USE THIS TOOL for any operation that creates or modifies platform configuration:\n' +
|
|
1038
|
-
' - Creating or updating products
|
|
1039
|
-
' -
|
|
1052
|
+
' - Creating or updating products (products create/update) and apps (apps create/update)\n' +
|
|
1053
|
+
' - Importing an app from a Postman v2.1 or OpenAPI 3.0 file: "apps import <file> -t postman|openapi"\n' +
|
|
1054
|
+
' - Managing resources via "resources <type> <verb>" (databases, storage, caches…)\n' +
|
|
1055
|
+
' - Managing cloud connections and cloud-linked resources\n' +
|
|
1040
1056
|
' - Listing workspaces, products, secrets\n' +
|
|
1041
|
-
' -
|
|
1042
|
-
'
|
|
1057
|
+
' - Linking a project folder: "link --product <tag> --env <slug>"\n' +
|
|
1058
|
+
' - Syncing sessions/notifications/events: "apply" or "apply sessions" etc.\n' +
|
|
1059
|
+
' - Running database migrations: "db migrate", "db schema generate"\n\n' +
|
|
1060
|
+
'NOTE: Environments, app actions, auths, features, quotas, fallbacks, and jobs are ' +
|
|
1061
|
+
'configured in the Workbench UI — the CLI does not have commands for them.\n\n' +
|
|
1062
|
+
'DO NOT use ductape_execute for admin operations — it uses a publishable key which only ' +
|
|
1043
1063
|
'covers runtime operations. Administrative operations will fail with "Authentication failed".\n\n' +
|
|
1044
1064
|
'The CLI uses the user\'s local logged-in session (ductape login). ' +
|
|
1045
1065
|
'If the CLI is not installed, this tool will return install instructions automatically.',
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -42,20 +42,39 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
42
42
|
These require an access key and CANNOT be done via ductape_execute (publishable key only).
|
|
43
43
|
→ Use ductape_cli instead. Examples:
|
|
44
44
|
ductape_cli("products list")
|
|
45
|
-
ductape_cli("
|
|
46
|
-
ductape_cli("environments list my-product")
|
|
45
|
+
ductape_cli("products create --name \\"My Product\\" --tag my-product")
|
|
47
46
|
ductape_cli("cloud connections list")
|
|
47
|
+
ductape_cli("link --product my-product --env dev")
|
|
48
48
|
If the CLI is not installed, ductape_cli will return install instructions automatically.
|
|
49
|
+
NOTE: Environments and app actions are configured in the Workbench UI — there are no CLI commands for them.
|
|
50
|
+
|
|
51
|
+
DECLARATIVE SYNC (apply sessions, notifications, events from code; run DB migrations)
|
|
52
|
+
→ Also use ductape_cli. The project must be linked first (ductape init --link).
|
|
53
|
+
ductape_cli("apply") # sync all: sessions + notifications + events
|
|
54
|
+
ductape_cli("apply sessions") # sessions only
|
|
55
|
+
ductape_cli("apply notifications") # notifications only
|
|
56
|
+
ductape_cli("apply events") # event brokers only
|
|
57
|
+
ductape_cli("apply --dry-run") # preview without changes
|
|
58
|
+
ductape_cli("db schema generate") # diff schema.json → write migration files
|
|
59
|
+
ductape_cli("db schema generate --destructive") # also generate drop operations
|
|
60
|
+
ductape_cli("db migrate") # apply pending migration files
|
|
61
|
+
ductape_cli("db migrate --dry-run") # preview without applying
|
|
62
|
+
ductape_cli("db migrate --env prd") # apply to a specific environment
|
|
63
|
+
ductape_cli("db migrate status") # show applied vs pending migrations
|
|
64
|
+
ductape_cli("db migrate status --json") # machine-readable status
|
|
65
|
+
ductape_cli("db migrate rollback") # roll back last migration
|
|
66
|
+
ductape_cli("db migrate rollback -n 3") # roll back last 3 migrations
|
|
49
67
|
|
|
50
68
|
1. ASSET CREATION / UPDATE (create, update, add, register… for ANY asset type)
|
|
51
69
|
ALL creation and update operations require an access key and CANNOT go through ductape_execute.
|
|
52
70
|
→ Use ductape_cli for every create/update operation. Examples:
|
|
53
|
-
ductape_cli("
|
|
71
|
+
ductape_cli("apps create --name \\"Email Service\\" --description \\"Transactional email\\"")
|
|
54
72
|
ductape_cli("apps list")
|
|
55
|
-
ductape_cli("
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
ductape_cli("resources storage list")
|
|
74
|
+
ductape_cli("resources database create -f db-config.json")
|
|
75
|
+
This applies to: products, apps, and resources (databases, storage, caches, etc.),
|
|
76
|
+
cloud connections, and secrets. Environments, app actions, auths, features, quotas,
|
|
77
|
+
fallbacks, jobs, and healthchecks are configured in the Workbench UI.
|
|
59
78
|
|
|
60
79
|
2. RUNTIME OPERATIONS (run, dispatch, execute, start, send, produce, query, insert, update, delete…)
|
|
61
80
|
The "input" field shape is product- and operation-specific — it is NOT derivable from Joi validators.
|
|
@@ -832,27 +851,18 @@ function buildSnippet(
|
|
|
832
851
|
// ─── CLI helpers ─────────────────────────────────────────────────────────────
|
|
833
852
|
|
|
834
853
|
const ADMIN_SUBCOMMANDS = [
|
|
835
|
-
'
|
|
836
|
-
'
|
|
837
|
-
'workspaces',
|
|
838
|
-
'
|
|
854
|
+
'login', 'logout', 'whoami',
|
|
855
|
+
'profiles',
|
|
856
|
+
'workspaces',
|
|
857
|
+
'link', 'unlink', 'init',
|
|
858
|
+
'products', 'apps',
|
|
859
|
+
'resources',
|
|
839
860
|
'cloud',
|
|
840
861
|
'secrets',
|
|
841
|
-
'databases',
|
|
842
|
-
'storage',
|
|
843
|
-
'graphs',
|
|
844
|
-
'vectors',
|
|
845
|
-
'brokers',
|
|
846
|
-
'notifications',
|
|
847
|
-
'sessions',
|
|
848
|
-
'caches',
|
|
849
|
-
'jobs',
|
|
850
862
|
'generate',
|
|
851
|
-
'
|
|
852
|
-
'
|
|
853
|
-
'
|
|
854
|
-
'logout',
|
|
855
|
-
'whoami',
|
|
863
|
+
'apply',
|
|
864
|
+
'db',
|
|
865
|
+
'graph',
|
|
856
866
|
];
|
|
857
867
|
|
|
858
868
|
function checkCli(): { available: boolean; version?: string } {
|
|
@@ -888,10 +898,14 @@ function runCli(command: string): { success: boolean; output: string } {
|
|
|
888
898
|
const cliInputSchema = z.object({
|
|
889
899
|
command: z.string().describe(
|
|
890
900
|
'The ductape CLI command to run, without the leading "ductape" word. ' +
|
|
891
|
-
'Examples: "products list", "
|
|
892
|
-
'"
|
|
893
|
-
'
|
|
894
|
-
'
|
|
901
|
+
'Examples: "products list", "products create --name \\"My Product\\" --tag my-product", ' +
|
|
902
|
+
'"apps list", "apps create -f app.json", "resources storage list", ' +
|
|
903
|
+
'"cloud connections list", "link --product my-product --env dev".\n\n' +
|
|
904
|
+
'Use this tool for administrative operations: creating or updating products, apps, ' +
|
|
905
|
+
'resources (databases, storage, caches…), cloud connections, secrets, ' +
|
|
906
|
+
'and for apply/migrate workflows.\n\n' +
|
|
907
|
+
'Note: environments, app actions, features, quotas, fallbacks, and jobs are configured ' +
|
|
908
|
+
'in the Workbench UI — there are no CLI commands for them.\n\n' +
|
|
895
909
|
'The CLI uses the user\'s local logged-in session (ductape login) — no key is required.',
|
|
896
910
|
),
|
|
897
911
|
});
|
|
@@ -1124,11 +1138,17 @@ async function main() {
|
|
|
1124
1138
|
description:
|
|
1125
1139
|
'Run a Ductape CLI command for administrative operations.\n\n' +
|
|
1126
1140
|
'USE THIS TOOL for any operation that creates or modifies platform configuration:\n' +
|
|
1127
|
-
' - Creating or updating products
|
|
1128
|
-
' -
|
|
1141
|
+
' - Creating or updating products (products create/update) and apps (apps create/update)\n' +
|
|
1142
|
+
' - Importing an app from a Postman v2.1 or OpenAPI 3.0 file: "apps import <file> -t postman|openapi"\n' +
|
|
1143
|
+
' - Managing resources via "resources <type> <verb>" (databases, storage, caches…)\n' +
|
|
1144
|
+
' - Managing cloud connections and cloud-linked resources\n' +
|
|
1129
1145
|
' - Listing workspaces, products, secrets\n' +
|
|
1130
|
-
' -
|
|
1131
|
-
'
|
|
1146
|
+
' - Linking a project folder: "link --product <tag> --env <slug>"\n' +
|
|
1147
|
+
' - Syncing sessions/notifications/events: "apply" or "apply sessions" etc.\n' +
|
|
1148
|
+
' - Running database migrations: "db migrate", "db schema generate"\n\n' +
|
|
1149
|
+
'NOTE: Environments, app actions, auths, features, quotas, fallbacks, and jobs are ' +
|
|
1150
|
+
'configured in the Workbench UI — the CLI does not have commands for them.\n\n' +
|
|
1151
|
+
'DO NOT use ductape_execute for admin operations — it uses a publishable key which only ' +
|
|
1132
1152
|
'covers runtime operations. Administrative operations will fail with "Authentication failed".\n\n' +
|
|
1133
1153
|
'The CLI uses the user\'s local logged-in session (ductape login). ' +
|
|
1134
1154
|
'If the CLI is not installed, this tool will return install instructions automatically.',
|