@ductape/mcp 0.1.15 → 0.1.17
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 -24
- package/package.json +1 -1
- package/src/index.ts +44 -24
package/dist/index.js
CHANGED
|
@@ -155,9 +155,9 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
155
155
|
webhooks.events.list [app_tag, webhook_tag]
|
|
156
156
|
|
|
157
157
|
━━━ MODULE: sessions ━━━
|
|
158
|
-
sessions.create [product_tag, data: { tag: string, name: string, description?: string, expiry: number, period: "seconds"|"minutes"|"hours"|"days", selector: string, schema:
|
|
159
|
-
← selector
|
|
160
|
-
← schema
|
|
158
|
+
sessions.create [product_tag, data: { tag: string, name: string, description?: string, expiry: number, period: "seconds"|"minutes"|"hours"|"days", selector: string, schema: Record<string, unknown> }]
|
|
159
|
+
← selector MUST be in the format "$Session{fieldName}" (e.g. "$Session{playerId}"). Plain dot-paths are rejected.
|
|
160
|
+
← schema is SAMPLE DATA — actual example values, not type declarations. The value at the selector path must be a primitive (string|number|boolean), not an object.
|
|
161
161
|
sessions.update [product_tag, session_tag, data: { name?: string, description?: string, expiry?: number, period?: "seconds"|"minutes"|"hours"|"days", selector?: string, schema?: object }]
|
|
162
162
|
sessions.fetch [product_tag, session_tag]
|
|
163
163
|
sessions.list [product_tag]
|
|
@@ -587,7 +587,8 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
587
587
|
features.compare [executionId1: string, executionId2: string]
|
|
588
588
|
|
|
589
589
|
━━━ MODULE: caches ━━━
|
|
590
|
-
caches.create [{
|
|
590
|
+
caches.create [product_tag, data: { name: string, tag: string, description?: string, expiry: number }]
|
|
591
|
+
← expiry is in MILLISECONDS (e.g. 3600000 = 1 hour, 86400000 = 1 day). No type or envs — Ductape manages the store.
|
|
591
592
|
caches.update [product_tag, cache_tag, data: { name?: string, description?: string, expiry?: number }]
|
|
592
593
|
caches.fetch [product_tag, cache_tag]
|
|
593
594
|
caches.list [product_tag]
|
|
@@ -1630,17 +1631,22 @@ DUCTAPE SESSIONS
|
|
|
1630
1631
|
A session is a named JWT schema on a product. It defines:
|
|
1631
1632
|
- tag / name — unique identifier and display name
|
|
1632
1633
|
- expiry + period — how long each issued JWT is valid (duration, not an absolute date)
|
|
1633
|
-
- selector —
|
|
1634
|
-
user identifier (e.g. "playerId").
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
This is a
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1634
|
+
- selector — MUST be in the format "$Session{fieldName}" where fieldName is the key
|
|
1635
|
+
in the schema that is the PRIMARY user identifier (e.g. "$Session{playerId}").
|
|
1636
|
+
Plain dot-paths like "playerId" are REJECTED by the validator.
|
|
1637
|
+
This field becomes the lookup key for revoke, list, and analytics.
|
|
1638
|
+
- schema — SAMPLE DATA showing example values for each field embedded in the JWT.
|
|
1639
|
+
This is NOT a type declaration. Use actual example values.
|
|
1640
|
+
The value at the selector path must be a primitive (string/number/boolean),
|
|
1641
|
+
not an object or array.
|
|
1642
|
+
|
|
1643
|
+
IMPORTANT — schema is sample data, not type declarations:
|
|
1644
|
+
CORRECT: schema: { playerId: "player_abc123", username: "Alice", role: "player" }
|
|
1645
|
+
INCORRECT: schema: { playerId: { type: "string", required: true } } ← WILL FAIL
|
|
1646
|
+
|
|
1647
|
+
IMPORTANT — selector must be "$Session{fieldName}" format:
|
|
1648
|
+
CORRECT: selector: "$Session{playerId}"
|
|
1649
|
+
INCORRECT: selector: "playerId" ← WILL FAIL with "Selector should be in the format $Session{...}{key}"
|
|
1644
1650
|
|
|
1645
1651
|
Example (game product — player identity in JWT):
|
|
1646
1652
|
ductape_execute("sessions.create", [product_tag, {
|
|
@@ -1648,12 +1654,12 @@ Example (game product — player identity in JWT):
|
|
|
1648
1654
|
name: "Player Session",
|
|
1649
1655
|
expiry: 24,
|
|
1650
1656
|
period: "hours",
|
|
1651
|
-
selector: "playerId",
|
|
1657
|
+
selector: "$Session{playerId}", // $Session{} wrapper required
|
|
1652
1658
|
schema: {
|
|
1653
|
-
playerId:
|
|
1654
|
-
username:
|
|
1655
|
-
role:
|
|
1656
|
-
accountId:
|
|
1659
|
+
playerId: "player_abc123", // sample value — primitive required at selector path
|
|
1660
|
+
username: "ShadowBlade",
|
|
1661
|
+
role: "player",
|
|
1662
|
+
accountId: "acct_xyz",
|
|
1657
1663
|
},
|
|
1658
1664
|
}])
|
|
1659
1665
|
|
|
@@ -1662,7 +1668,7 @@ Runtime — create a session (sign a JWT):
|
|
|
1662
1668
|
to discover the exact data field names accepted for this session tag.
|
|
1663
1669
|
ductape_execute("sessions.start", [{ product, env, tag: "player-session",
|
|
1664
1670
|
data: {
|
|
1665
|
-
playerId: "player_abc123", // must match selector — used as the revocation/lookup key
|
|
1671
|
+
playerId: "player_abc123", // must match selector path — used as the revocation/lookup key
|
|
1666
1672
|
username: "ShadowBlade",
|
|
1667
1673
|
role: "player",
|
|
1668
1674
|
accountId: "acct_xyz",
|
|
@@ -1699,10 +1705,13 @@ DUCTAPE CACHES
|
|
|
1699
1705
|
|
|
1700
1706
|
Caches are product-level Redis (or in-memory) stores for temporary key-value data with optional TTL.
|
|
1701
1707
|
|
|
1702
|
-
Registration (admin — ductape_cli):
|
|
1708
|
+
Registration (admin — ductape_cli or SDK):
|
|
1703
1709
|
ductape_cli("resources caches create -f cache.json")
|
|
1704
|
-
File: { name, tag,
|
|
1705
|
-
|
|
1710
|
+
File: { name, tag, description?, expiry: <milliseconds> }
|
|
1711
|
+
No type or envs — Ductape manages the store infrastructure.
|
|
1712
|
+
expiry is in MILLISECONDS: 3600000 = 1 hour, 86400000 = 1 day, 604800000 = 1 week.
|
|
1713
|
+
|
|
1714
|
+
SDK: ductape_execute("caches.create", [product_tag, { name, tag, description?, expiry: 3600000 }])
|
|
1706
1715
|
|
|
1707
1716
|
Operations:
|
|
1708
1717
|
caches.set [{ product, cache, key, value: string, expiry?: string (ISO 8601), env }]
|
|
@@ -1960,6 +1969,9 @@ Provision (create a NEW resource in the cloud):
|
|
|
1960
1969
|
type field: "messageBrokers" (exact — not "messagebrokers" or "events")
|
|
1961
1970
|
|
|
1962
1971
|
GCP Pub/Sub — creates a new Pub/Sub topic in GCP, stores credentials in secrets:
|
|
1972
|
+
Cost: GCP Pub/Sub is usage-based — no upfront cost, no tier selection required.
|
|
1973
|
+
You pay per GB of data published/subscribed (first 10 GB/month free).
|
|
1974
|
+
It is safe to provision without user approval of a fixed monthly cost.
|
|
1963
1975
|
[{"cloud":"gcp-snd","service":"pubsub","type":"messageBrokers",
|
|
1964
1976
|
"product":"my-product","component":"notifications-broker","env":"snd",
|
|
1965
1977
|
"topicName":"my-product-notifications-snd"},
|
|
@@ -1969,6 +1981,9 @@ Provision (create a NEW resource in the cloud):
|
|
|
1969
1981
|
If topicName is omitted a timestamped name is generated — always supply it explicitly.
|
|
1970
1982
|
|
|
1971
1983
|
AWS SQS — creates a new SQS queue per env:
|
|
1984
|
+
Cost: SQS is usage-based — no upfront cost, no tier selection required.
|
|
1985
|
+
First 1 million requests/month free; $0.40 per million after that.
|
|
1986
|
+
It is safe to provision without user approval of a fixed monthly cost.
|
|
1972
1987
|
[{"cloud":"aws-snd","service":"sqs","type":"messageBrokers",
|
|
1973
1988
|
"product":"my-product","component":"notifications-broker","env":"snd",
|
|
1974
1989
|
"queueName":"my-product-notifications-snd"},
|
|
@@ -1977,6 +1992,11 @@ Provision (create a NEW resource in the cloud):
|
|
|
1977
1992
|
"queueName":"my-product-notifications-prd"}]
|
|
1978
1993
|
|
|
1979
1994
|
Azure Service Bus — creates a namespace + queue per env:
|
|
1995
|
+
Cost: Azure Service Bus has TIERED pricing — confirm the tier with the user before provisioning.
|
|
1996
|
+
Basic: queues only, ~$0.05/million operations. No topics/subscriptions.
|
|
1997
|
+
Standard: queues + topics, ~$10/month base + $0.10/million operations.
|
|
1998
|
+
Premium: dedicated capacity, starts ~$677/month. Not needed for standard workloads.
|
|
1999
|
+
DO NOT provision Azure Service Bus without confirming the tier with the user.
|
|
1980
2000
|
[{"cloud":"azure-snd","service":"servicebus","type":"messageBrokers",
|
|
1981
2001
|
"product":"my-product","component":"notifications-broker","env":"snd",
|
|
1982
2002
|
"namespaceName":"myproduct-snd","queueName":"notifications"},
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -166,9 +166,9 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
166
166
|
webhooks.events.list [app_tag, webhook_tag]
|
|
167
167
|
|
|
168
168
|
━━━ MODULE: sessions ━━━
|
|
169
|
-
sessions.create [product_tag, data: { tag: string, name: string, description?: string, expiry: number, period: "seconds"|"minutes"|"hours"|"days", selector: string, schema:
|
|
170
|
-
← selector
|
|
171
|
-
← schema
|
|
169
|
+
sessions.create [product_tag, data: { tag: string, name: string, description?: string, expiry: number, period: "seconds"|"minutes"|"hours"|"days", selector: string, schema: Record<string, unknown> }]
|
|
170
|
+
← selector MUST be in the format "$Session{fieldName}" (e.g. "$Session{playerId}"). Plain dot-paths are rejected.
|
|
171
|
+
← schema is SAMPLE DATA — actual example values, not type declarations. The value at the selector path must be a primitive (string|number|boolean), not an object.
|
|
172
172
|
sessions.update [product_tag, session_tag, data: { name?: string, description?: string, expiry?: number, period?: "seconds"|"minutes"|"hours"|"days", selector?: string, schema?: object }]
|
|
173
173
|
sessions.fetch [product_tag, session_tag]
|
|
174
174
|
sessions.list [product_tag]
|
|
@@ -598,7 +598,8 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
598
598
|
features.compare [executionId1: string, executionId2: string]
|
|
599
599
|
|
|
600
600
|
━━━ MODULE: caches ━━━
|
|
601
|
-
caches.create [{
|
|
601
|
+
caches.create [product_tag, data: { name: string, tag: string, description?: string, expiry: number }]
|
|
602
|
+
← expiry is in MILLISECONDS (e.g. 3600000 = 1 hour, 86400000 = 1 day). No type or envs — Ductape manages the store.
|
|
602
603
|
caches.update [product_tag, cache_tag, data: { name?: string, description?: string, expiry?: number }]
|
|
603
604
|
caches.fetch [product_tag, cache_tag]
|
|
604
605
|
caches.list [product_tag]
|
|
@@ -1694,17 +1695,22 @@ DUCTAPE SESSIONS
|
|
|
1694
1695
|
A session is a named JWT schema on a product. It defines:
|
|
1695
1696
|
- tag / name — unique identifier and display name
|
|
1696
1697
|
- expiry + period — how long each issued JWT is valid (duration, not an absolute date)
|
|
1697
|
-
- selector —
|
|
1698
|
-
user identifier (e.g. "playerId").
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
This is a
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1698
|
+
- selector — MUST be in the format "$Session{fieldName}" where fieldName is the key
|
|
1699
|
+
in the schema that is the PRIMARY user identifier (e.g. "$Session{playerId}").
|
|
1700
|
+
Plain dot-paths like "playerId" are REJECTED by the validator.
|
|
1701
|
+
This field becomes the lookup key for revoke, list, and analytics.
|
|
1702
|
+
- schema — SAMPLE DATA showing example values for each field embedded in the JWT.
|
|
1703
|
+
This is NOT a type declaration. Use actual example values.
|
|
1704
|
+
The value at the selector path must be a primitive (string/number/boolean),
|
|
1705
|
+
not an object or array.
|
|
1706
|
+
|
|
1707
|
+
IMPORTANT — schema is sample data, not type declarations:
|
|
1708
|
+
CORRECT: schema: { playerId: "player_abc123", username: "Alice", role: "player" }
|
|
1709
|
+
INCORRECT: schema: { playerId: { type: "string", required: true } } ← WILL FAIL
|
|
1710
|
+
|
|
1711
|
+
IMPORTANT — selector must be "$Session{fieldName}" format:
|
|
1712
|
+
CORRECT: selector: "$Session{playerId}"
|
|
1713
|
+
INCORRECT: selector: "playerId" ← WILL FAIL with "Selector should be in the format $Session{...}{key}"
|
|
1708
1714
|
|
|
1709
1715
|
Example (game product — player identity in JWT):
|
|
1710
1716
|
ductape_execute("sessions.create", [product_tag, {
|
|
@@ -1712,12 +1718,12 @@ Example (game product — player identity in JWT):
|
|
|
1712
1718
|
name: "Player Session",
|
|
1713
1719
|
expiry: 24,
|
|
1714
1720
|
period: "hours",
|
|
1715
|
-
selector: "playerId",
|
|
1721
|
+
selector: "$Session{playerId}", // $Session{} wrapper required
|
|
1716
1722
|
schema: {
|
|
1717
|
-
playerId:
|
|
1718
|
-
username:
|
|
1719
|
-
role:
|
|
1720
|
-
accountId:
|
|
1723
|
+
playerId: "player_abc123", // sample value — primitive required at selector path
|
|
1724
|
+
username: "ShadowBlade",
|
|
1725
|
+
role: "player",
|
|
1726
|
+
accountId: "acct_xyz",
|
|
1721
1727
|
},
|
|
1722
1728
|
}])
|
|
1723
1729
|
|
|
@@ -1726,7 +1732,7 @@ Runtime — create a session (sign a JWT):
|
|
|
1726
1732
|
to discover the exact data field names accepted for this session tag.
|
|
1727
1733
|
ductape_execute("sessions.start", [{ product, env, tag: "player-session",
|
|
1728
1734
|
data: {
|
|
1729
|
-
playerId: "player_abc123", // must match selector — used as the revocation/lookup key
|
|
1735
|
+
playerId: "player_abc123", // must match selector path — used as the revocation/lookup key
|
|
1730
1736
|
username: "ShadowBlade",
|
|
1731
1737
|
role: "player",
|
|
1732
1738
|
accountId: "acct_xyz",
|
|
@@ -1764,10 +1770,13 @@ DUCTAPE CACHES
|
|
|
1764
1770
|
|
|
1765
1771
|
Caches are product-level Redis (or in-memory) stores for temporary key-value data with optional TTL.
|
|
1766
1772
|
|
|
1767
|
-
Registration (admin — ductape_cli):
|
|
1773
|
+
Registration (admin — ductape_cli or SDK):
|
|
1768
1774
|
ductape_cli("resources caches create -f cache.json")
|
|
1769
|
-
File: { name, tag,
|
|
1770
|
-
|
|
1775
|
+
File: { name, tag, description?, expiry: <milliseconds> }
|
|
1776
|
+
No type or envs — Ductape manages the store infrastructure.
|
|
1777
|
+
expiry is in MILLISECONDS: 3600000 = 1 hour, 86400000 = 1 day, 604800000 = 1 week.
|
|
1778
|
+
|
|
1779
|
+
SDK: ductape_execute("caches.create", [product_tag, { name, tag, description?, expiry: 3600000 }])
|
|
1771
1780
|
|
|
1772
1781
|
Operations:
|
|
1773
1782
|
caches.set [{ product, cache, key, value: string, expiry?: string (ISO 8601), env }]
|
|
@@ -2029,6 +2038,9 @@ Provision (create a NEW resource in the cloud):
|
|
|
2029
2038
|
type field: "messageBrokers" (exact — not "messagebrokers" or "events")
|
|
2030
2039
|
|
|
2031
2040
|
GCP Pub/Sub — creates a new Pub/Sub topic in GCP, stores credentials in secrets:
|
|
2041
|
+
Cost: GCP Pub/Sub is usage-based — no upfront cost, no tier selection required.
|
|
2042
|
+
You pay per GB of data published/subscribed (first 10 GB/month free).
|
|
2043
|
+
It is safe to provision without user approval of a fixed monthly cost.
|
|
2032
2044
|
[{"cloud":"gcp-snd","service":"pubsub","type":"messageBrokers",
|
|
2033
2045
|
"product":"my-product","component":"notifications-broker","env":"snd",
|
|
2034
2046
|
"topicName":"my-product-notifications-snd"},
|
|
@@ -2038,6 +2050,9 @@ Provision (create a NEW resource in the cloud):
|
|
|
2038
2050
|
If topicName is omitted a timestamped name is generated — always supply it explicitly.
|
|
2039
2051
|
|
|
2040
2052
|
AWS SQS — creates a new SQS queue per env:
|
|
2053
|
+
Cost: SQS is usage-based — no upfront cost, no tier selection required.
|
|
2054
|
+
First 1 million requests/month free; $0.40 per million after that.
|
|
2055
|
+
It is safe to provision without user approval of a fixed monthly cost.
|
|
2041
2056
|
[{"cloud":"aws-snd","service":"sqs","type":"messageBrokers",
|
|
2042
2057
|
"product":"my-product","component":"notifications-broker","env":"snd",
|
|
2043
2058
|
"queueName":"my-product-notifications-snd"},
|
|
@@ -2046,6 +2061,11 @@ Provision (create a NEW resource in the cloud):
|
|
|
2046
2061
|
"queueName":"my-product-notifications-prd"}]
|
|
2047
2062
|
|
|
2048
2063
|
Azure Service Bus — creates a namespace + queue per env:
|
|
2064
|
+
Cost: Azure Service Bus has TIERED pricing — confirm the tier with the user before provisioning.
|
|
2065
|
+
Basic: queues only, ~$0.05/million operations. No topics/subscriptions.
|
|
2066
|
+
Standard: queues + topics, ~$10/month base + $0.10/million operations.
|
|
2067
|
+
Premium: dedicated capacity, starts ~$677/month. Not needed for standard workloads.
|
|
2068
|
+
DO NOT provision Azure Service Bus without confirming the tier with the user.
|
|
2049
2069
|
[{"cloud":"azure-snd","service":"servicebus","type":"messageBrokers",
|
|
2050
2070
|
"product":"my-product","component":"notifications-broker","env":"snd",
|
|
2051
2071
|
"namespaceName":"myproduct-snd","queueName":"notifications"},
|