@carrierllc/mcp 0.0.1 → 0.2.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.
Files changed (131) hide show
  1. package/README.md +216 -3
  2. package/dist/apps/app-state.d.ts +19 -0
  3. package/dist/apps/app-state.d.ts.map +1 -0
  4. package/dist/apps/app-state.js +28 -0
  5. package/dist/apps/app-state.js.map +1 -0
  6. package/dist/apps/balance-topup.d.ts +19 -0
  7. package/dist/apps/balance-topup.d.ts.map +1 -0
  8. package/dist/apps/balance-topup.js +121 -0
  9. package/dist/apps/balance-topup.js.map +1 -0
  10. package/dist/apps/fleet-health-app.d.ts +29 -0
  11. package/dist/apps/fleet-health-app.d.ts.map +1 -0
  12. package/dist/apps/fleet-health-app.js +152 -0
  13. package/dist/apps/fleet-health-app.js.map +1 -0
  14. package/dist/apps/index.d.ts +37 -0
  15. package/dist/apps/index.d.ts.map +1 -0
  16. package/dist/apps/index.js +42 -0
  17. package/dist/apps/index.js.map +1 -0
  18. package/dist/apps/provisioning-wizard.d.ts +11 -0
  19. package/dist/apps/provisioning-wizard.d.ts.map +1 -0
  20. package/dist/apps/provisioning-wizard.js +345 -0
  21. package/dist/apps/provisioning-wizard.js.map +1 -0
  22. package/dist/audit.d.ts +31 -0
  23. package/dist/audit.d.ts.map +1 -0
  24. package/dist/audit.js +42 -0
  25. package/dist/audit.js.map +1 -0
  26. package/dist/billing-thresholds.d.ts +71 -0
  27. package/dist/billing-thresholds.d.ts.map +1 -0
  28. package/dist/billing-thresholds.js +238 -0
  29. package/dist/billing-thresholds.js.map +1 -0
  30. package/dist/billing.d.ts +95 -0
  31. package/dist/billing.d.ts.map +1 -0
  32. package/dist/billing.js +239 -0
  33. package/dist/billing.js.map +1 -0
  34. package/dist/clerk.d.ts +125 -0
  35. package/dist/clerk.d.ts.map +1 -0
  36. package/dist/clerk.js +389 -0
  37. package/dist/clerk.js.map +1 -0
  38. package/dist/client.d.ts +35 -0
  39. package/dist/client.d.ts.map +1 -0
  40. package/dist/client.js +75 -0
  41. package/dist/client.js.map +1 -0
  42. package/dist/credits.d.ts +165 -0
  43. package/dist/credits.d.ts.map +1 -0
  44. package/dist/credits.js +483 -0
  45. package/dist/credits.js.map +1 -0
  46. package/dist/index.d.ts +14 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +95 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/intelligence.d.ts +4 -0
  51. package/dist/intelligence.d.ts.map +1 -0
  52. package/dist/intelligence.js +899 -0
  53. package/dist/intelligence.js.map +1 -0
  54. package/dist/list-recent-ocs-events.d.ts +48 -0
  55. package/dist/list-recent-ocs-events.d.ts.map +1 -0
  56. package/dist/list-recent-ocs-events.js +160 -0
  57. package/dist/list-recent-ocs-events.js.map +1 -0
  58. package/dist/manus-client.d.ts +429 -0
  59. package/dist/manus-client.d.ts.map +1 -0
  60. package/dist/manus-client.js +401 -0
  61. package/dist/manus-client.js.map +1 -0
  62. package/dist/manus-common.d.ts +5 -0
  63. package/dist/manus-common.d.ts.map +1 -0
  64. package/dist/manus-common.js +5 -0
  65. package/dist/manus-common.js.map +1 -0
  66. package/dist/manus-schedule.d.ts +74 -0
  67. package/dist/manus-schedule.d.ts.map +1 -0
  68. package/dist/manus-schedule.js +213 -0
  69. package/dist/manus-schedule.js.map +1 -0
  70. package/dist/manus-usage.d.ts +32 -0
  71. package/dist/manus-usage.d.ts.map +1 -0
  72. package/dist/manus-usage.js +120 -0
  73. package/dist/manus-usage.js.map +1 -0
  74. package/dist/manus-webhook.d.ts +60 -0
  75. package/dist/manus-webhook.d.ts.map +1 -0
  76. package/dist/manus-webhook.js +361 -0
  77. package/dist/manus-webhook.js.map +1 -0
  78. package/dist/pricing-tools.d.ts +26 -0
  79. package/dist/pricing-tools.d.ts.map +1 -0
  80. package/dist/pricing-tools.js +428 -0
  81. package/dist/pricing-tools.js.map +1 -0
  82. package/dist/projects-tools.d.ts +39 -0
  83. package/dist/projects-tools.d.ts.map +1 -0
  84. package/dist/projects-tools.js +545 -0
  85. package/dist/projects-tools.js.map +1 -0
  86. package/dist/prompts.d.ts +7 -0
  87. package/dist/prompts.d.ts.map +1 -0
  88. package/dist/prompts.js +151 -0
  89. package/dist/prompts.js.map +1 -0
  90. package/dist/stripe-connect-tools.d.ts +33 -0
  91. package/dist/stripe-connect-tools.d.ts.map +1 -0
  92. package/dist/stripe-connect-tools.js +504 -0
  93. package/dist/stripe-connect-tools.js.map +1 -0
  94. package/dist/timing-safe-equal.d.ts +5 -0
  95. package/dist/timing-safe-equal.d.ts.map +1 -0
  96. package/dist/timing-safe-equal.js +13 -0
  97. package/dist/timing-safe-equal.js.map +1 -0
  98. package/dist/tools-backlog.d.ts +28 -0
  99. package/dist/tools-backlog.d.ts.map +1 -0
  100. package/dist/tools-backlog.js +315 -0
  101. package/dist/tools-backlog.js.map +1 -0
  102. package/dist/tools-carrier-ask.d.ts +138 -0
  103. package/dist/tools-carrier-ask.d.ts.map +1 -0
  104. package/dist/tools-carrier-ask.js +913 -0
  105. package/dist/tools-carrier-ask.js.map +1 -0
  106. package/dist/tools-pricing.d.ts +18 -0
  107. package/dist/tools-pricing.d.ts.map +1 -0
  108. package/dist/tools-pricing.js +172 -0
  109. package/dist/tools-pricing.js.map +1 -0
  110. package/dist/tools-ui-agent-ask.d.ts +29 -0
  111. package/dist/tools-ui-agent-ask.d.ts.map +1 -0
  112. package/dist/tools-ui-agent-ask.js +272 -0
  113. package/dist/tools-ui-agent-ask.js.map +1 -0
  114. package/dist/tools-ui-agent-schedule.d.ts +29 -0
  115. package/dist/tools-ui-agent-schedule.d.ts.map +1 -0
  116. package/dist/tools-ui-agent-schedule.js +517 -0
  117. package/dist/tools-ui-agent-schedule.js.map +1 -0
  118. package/dist/tools-ui-agent.d.ts +40 -0
  119. package/dist/tools-ui-agent.d.ts.map +1 -0
  120. package/dist/tools-ui-agent.js +508 -0
  121. package/dist/tools-ui-agent.js.map +1 -0
  122. package/dist/tools.d.ts +60 -0
  123. package/dist/tools.d.ts.map +1 -0
  124. package/dist/tools.js +1295 -0
  125. package/dist/tools.js.map +1 -0
  126. package/dist/types.d.ts +291 -0
  127. package/dist/types.d.ts.map +1 -0
  128. package/dist/types.js +5 -0
  129. package/dist/types.js.map +1 -0
  130. package/package.json +55 -7
  131. package/index.js +0 -1
@@ -0,0 +1,151 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Carrier MCP business prompts (5).
4
+ * Renamed from registerPrompts → registerAllPrompts for consistency.
5
+ */
6
+ export function registerAllPrompts(server) {
7
+ server.registerPrompt("fleet_health_report", {
8
+ title: "Fleet Health Report",
9
+ description: "Generate a comprehensive fleet health report: account balances, eSIM status breakdown, low-balance alerts, and utilization rates.",
10
+ }, async () => ({
11
+ messages: [
12
+ {
13
+ role: "user",
14
+ content: {
15
+ type: "text",
16
+ text: `You are a Carrier fleet analyst. Generate a health report by:
17
+
18
+ 1. Call list_reseller_accounts to get all accounts and their balances
19
+ 2. Call esim_status_per_account for each account to get SIM status breakdowns
20
+ 3. Analyze and present:
21
+ - Total eSIMs by status (active, suspended, inventory)
22
+ - Utilization rate (active / total provisioned)
23
+ - Accounts with low balance (< $50) — flag as urgent
24
+ - Accounts with high inactive SIM ratio — flag for cleanup
25
+ - Top accounts by active SIM count
26
+
27
+ Format as a structured report with sections, tables, and actionable recommendations.`,
28
+ },
29
+ },
30
+ ],
31
+ }));
32
+ server.registerPrompt("subscriber_deep_dive", {
33
+ title: "Subscriber Deep Dive",
34
+ description: "Comprehensive analysis of a single subscriber: profile, packages, usage patterns, location history, recommendations.",
35
+ argsSchema: { iccid: z.string().describe("The subscriber ICCID to analyse") },
36
+ }, async ({ iccid }) => ({
37
+ messages: [
38
+ {
39
+ role: "user",
40
+ content: {
41
+ type: "text",
42
+ text: `You are a Carrier customer success analyst. Deep-dive into subscriber ${iccid}:
43
+
44
+ 1. Call get_subscriber with ICCID "${iccid}" for profile details
45
+ 2. Call list_subscriber_packages for their active/expired packages
46
+ 3. Call subscriber_usage for the last 7 days to see usage patterns
47
+ 4. Call subscriber_network_events for the last 7 days for connectivity
48
+ 5. Call get_subscriber_location for current location
49
+
50
+ Analyze and present:
51
+ - Subscriber profile summary (status, account, balance, contact)
52
+ - Package utilization: % of data/voice/SMS used vs allowance
53
+ - Usage trends: increasing/decreasing/stable
54
+ - Roaming behavior: which countries/networks
55
+ - Connectivity quality: attach/detach frequency
56
+ - Actionable recommendations:
57
+ - If usage > 80% of allowance → suggest upgrade
58
+ - If usage < 20% → suggest downgrade to prevent churn
59
+ - If frequent network switches → check steering list
60
+ - If low balance → alert for top-up`,
61
+ },
62
+ },
63
+ ],
64
+ }));
65
+ server.registerPrompt("revenue_optimization", {
66
+ title: "Revenue Optimization Analysis",
67
+ description: "Analyse accounts and subscribers to find revenue optimization opportunities: underutilized packages, upgrade candidates, churn risks.",
68
+ }, async () => ({
69
+ messages: [
70
+ {
71
+ role: "user",
72
+ content: {
73
+ type: "text",
74
+ text: `You are a Carrier revenue optimization analyst. Find opportunities by:
75
+
76
+ 1. Call list_reseller_accounts for account overview
77
+ 2. Call list_package_templates to understand the product catalog
78
+ 3. Call get_tariff to understand the cost structure
79
+ 4. For top accounts, call list_subscribers and sample subscriber_usage
80
+
81
+ Analyze and present:
82
+ - Package template analysis: which templates are most/least popular
83
+ - Pricing gap analysis: cost vs retail price margins
84
+ - Upgrade candidates: subscribers consistently hitting limits
85
+ - Downgrade/churn risks: subscribers with declining usage
86
+ - Geographic opportunities: high-usage zones with limited coverage
87
+ - Recommendations ranked by estimated revenue impact`,
88
+ },
89
+ },
90
+ ],
91
+ }));
92
+ server.registerPrompt("coverage_analysis", {
93
+ title: "Coverage & Network Analysis",
94
+ description: "Analyse network coverage, steering lists, and subscriber roaming patterns to optimise connectivity and reduce costs.",
95
+ }, async () => ({
96
+ messages: [
97
+ {
98
+ role: "user",
99
+ content: {
100
+ type: "text",
101
+ text: `You are a Carrier network coverage analyst. Analyze the fleet's connectivity by:
102
+
103
+ 1. Call list_steering_lists to see network steering configurations
104
+ 2. Call list_detailed_location_zones for coverage zone definitions
105
+ 3. Call list_sponsors for available sponsor networks
106
+ 4. Call list_network_profiles for connectivity configs
107
+ 5. Sample subscriber_network_events for active subscribers
108
+
109
+ Analyze and present:
110
+ - Coverage map: which zones/countries are covered
111
+ - Steering list effectiveness: are subs connecting to preferred networks?
112
+ - Roaming cost hotspots: countries with high roaming fees
113
+ - Network quality: attach/detach patterns by network
114
+ - Recommendations for steering list optimization`,
115
+ },
116
+ },
117
+ ],
118
+ }));
119
+ server.registerPrompt("bulk_operations_planner", {
120
+ title: "Bulk Operations Planner",
121
+ description: "Plan bulk operations safely: mass package assignments, account migrations, balance adjustments, or status changes.",
122
+ argsSchema: { operation: z.string().describe("Describe the bulk operation you want to perform") },
123
+ }, async ({ operation }) => ({
124
+ messages: [
125
+ {
126
+ role: "user",
127
+ content: {
128
+ type: "text",
129
+ text: `You are a Carrier operations planner. The user wants to perform this bulk operation:
130
+
131
+ "${operation}"
132
+
133
+ Create a safe execution plan:
134
+ 1. First, use read-only tools to understand the current state
135
+ 2. Identify all affected subscribers/accounts
136
+ 3. Estimate the impact (cost, service disruption, reversibility)
137
+ 4. Generate a step-by-step plan with:
138
+ - Pre-flight checks
139
+ - Execution order (smallest batch first as canary)
140
+ - Rollback procedure for each step
141
+ - Post-execution verification
142
+ 5. List all destructive tool calls that will be needed
143
+ 6. Ask for explicit confirmation before any destructive action
144
+
145
+ NEVER execute destructive operations without confirmation.`,
146
+ },
147
+ },
148
+ ],
149
+ }));
150
+ }
151
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,CAAC,cAAc,CACnB,qBAAqB,EACrB;QACE,KAAK,EAAE,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IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;iDAa+B;iBACtC;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,cAAc,CACnB,yBAAyB,EACzB;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACT,oHAAoH;QACtH,UAAU,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC,EAAE;KAClG,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;QACxB,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;GAEf,SAAS;;;;;;;;;;;;;;2DAc+C;iBAChD;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Carrier MCP — Stripe Connect tools (Phase 16).
3
+ *
4
+ * Provides AI-agent access to the operator Stripe Connect layer.
5
+ * All tools call the Stripe API directly using STRIPE_SECRET_KEY from env.
6
+ * The connected account ID is looked up from CARRIER_USERS KV
7
+ * under key `stripe_account:<operatorId>`.
8
+ *
9
+ * Tools registered here:
10
+ * stripe_connect_status — read-only: account status + capabilities
11
+ * stripe_connect_payouts — read-only: list recent payouts
12
+ * stripe_connect_balance — read-only: available + pending balance
13
+ * stripe_connect_refund — write (HARD_BLOCK): refund a charge
14
+ * stripe_connect_dispute_list — read-only: list active disputes
15
+ * radar_review_list — read-only: list pending Radar reviews
16
+ * radar_review_approve — admin (HARD_BLOCK): approve a review
17
+ * radar_review_decline — admin (HARD_BLOCK): decline/close a review
18
+ * radar_value_list_add — admin (HARD_BLOCK): add to block/allow list
19
+ * radar_rule_toggle — admin: documented stub (Stripe API limitation)
20
+ *
21
+ * HARD_BLOCK pattern: destructive tools require a confirm_token stored in
22
+ * OAUTH_KV with a 5-min TTL (same pattern as pricing-tools.ts).
23
+ */
24
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
25
+ import type { Env, CarrierProps, ToolScope } from "./types.js";
26
+ export interface StripeConnectToolContext {
27
+ env: Env;
28
+ props: CarrierProps;
29
+ }
30
+ /** Doc + registry merge — mirrors the tool inventory in this file's header comment. */
31
+ export declare const STRIPE_CONNECT_TOOL_SCOPES: Record<string, ToolScope>;
32
+ export declare function registerStripeConnectTools(server: McpServer, ctx: StripeConnectToolContext): void;
33
+ //# sourceMappingURL=stripe-connect-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripe-connect-tools.d.ts","sourceRoot":"","sources":["../src/stripe-connect-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAO/D,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,YAAY,CAAC;CACrB;AAwED,uFAAuF;AACvF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAWhE,CAAC;AAMF,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,wBAAwB,GAC5B,IAAI,CAqjBN"}