@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.
- package/README.md +216 -3
- package/dist/apps/app-state.d.ts +19 -0
- package/dist/apps/app-state.d.ts.map +1 -0
- package/dist/apps/app-state.js +28 -0
- package/dist/apps/app-state.js.map +1 -0
- package/dist/apps/balance-topup.d.ts +19 -0
- package/dist/apps/balance-topup.d.ts.map +1 -0
- package/dist/apps/balance-topup.js +121 -0
- package/dist/apps/balance-topup.js.map +1 -0
- package/dist/apps/fleet-health-app.d.ts +29 -0
- package/dist/apps/fleet-health-app.d.ts.map +1 -0
- package/dist/apps/fleet-health-app.js +152 -0
- package/dist/apps/fleet-health-app.js.map +1 -0
- package/dist/apps/index.d.ts +37 -0
- package/dist/apps/index.d.ts.map +1 -0
- package/dist/apps/index.js +42 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/apps/provisioning-wizard.d.ts +11 -0
- package/dist/apps/provisioning-wizard.d.ts.map +1 -0
- package/dist/apps/provisioning-wizard.js +345 -0
- package/dist/apps/provisioning-wizard.js.map +1 -0
- package/dist/audit.d.ts +31 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +42 -0
- package/dist/audit.js.map +1 -0
- package/dist/billing-thresholds.d.ts +71 -0
- package/dist/billing-thresholds.d.ts.map +1 -0
- package/dist/billing-thresholds.js +238 -0
- package/dist/billing-thresholds.js.map +1 -0
- package/dist/billing.d.ts +95 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +239 -0
- package/dist/billing.js.map +1 -0
- package/dist/clerk.d.ts +125 -0
- package/dist/clerk.d.ts.map +1 -0
- package/dist/clerk.js +389 -0
- package/dist/clerk.js.map +1 -0
- package/dist/client.d.ts +35 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +75 -0
- package/dist/client.js.map +1 -0
- package/dist/credits.d.ts +165 -0
- package/dist/credits.d.ts.map +1 -0
- package/dist/credits.js +483 -0
- package/dist/credits.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/intelligence.d.ts +4 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +899 -0
- package/dist/intelligence.js.map +1 -0
- package/dist/list-recent-ocs-events.d.ts +48 -0
- package/dist/list-recent-ocs-events.d.ts.map +1 -0
- package/dist/list-recent-ocs-events.js +160 -0
- package/dist/list-recent-ocs-events.js.map +1 -0
- package/dist/manus-client.d.ts +429 -0
- package/dist/manus-client.d.ts.map +1 -0
- package/dist/manus-client.js +401 -0
- package/dist/manus-client.js.map +1 -0
- package/dist/manus-common.d.ts +5 -0
- package/dist/manus-common.d.ts.map +1 -0
- package/dist/manus-common.js +5 -0
- package/dist/manus-common.js.map +1 -0
- package/dist/manus-schedule.d.ts +74 -0
- package/dist/manus-schedule.d.ts.map +1 -0
- package/dist/manus-schedule.js +213 -0
- package/dist/manus-schedule.js.map +1 -0
- package/dist/manus-usage.d.ts +32 -0
- package/dist/manus-usage.d.ts.map +1 -0
- package/dist/manus-usage.js +120 -0
- package/dist/manus-usage.js.map +1 -0
- package/dist/manus-webhook.d.ts +60 -0
- package/dist/manus-webhook.d.ts.map +1 -0
- package/dist/manus-webhook.js +361 -0
- package/dist/manus-webhook.js.map +1 -0
- package/dist/pricing-tools.d.ts +26 -0
- package/dist/pricing-tools.d.ts.map +1 -0
- package/dist/pricing-tools.js +428 -0
- package/dist/pricing-tools.js.map +1 -0
- package/dist/projects-tools.d.ts +39 -0
- package/dist/projects-tools.d.ts.map +1 -0
- package/dist/projects-tools.js +545 -0
- package/dist/projects-tools.js.map +1 -0
- package/dist/prompts.d.ts +7 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +151 -0
- package/dist/prompts.js.map +1 -0
- package/dist/stripe-connect-tools.d.ts +33 -0
- package/dist/stripe-connect-tools.d.ts.map +1 -0
- package/dist/stripe-connect-tools.js +504 -0
- package/dist/stripe-connect-tools.js.map +1 -0
- package/dist/timing-safe-equal.d.ts +5 -0
- package/dist/timing-safe-equal.d.ts.map +1 -0
- package/dist/timing-safe-equal.js +13 -0
- package/dist/timing-safe-equal.js.map +1 -0
- package/dist/tools-backlog.d.ts +28 -0
- package/dist/tools-backlog.d.ts.map +1 -0
- package/dist/tools-backlog.js +315 -0
- package/dist/tools-backlog.js.map +1 -0
- package/dist/tools-carrier-ask.d.ts +138 -0
- package/dist/tools-carrier-ask.d.ts.map +1 -0
- package/dist/tools-carrier-ask.js +913 -0
- package/dist/tools-carrier-ask.js.map +1 -0
- package/dist/tools-pricing.d.ts +18 -0
- package/dist/tools-pricing.d.ts.map +1 -0
- package/dist/tools-pricing.js +172 -0
- package/dist/tools-pricing.js.map +1 -0
- package/dist/tools-ui-agent-ask.d.ts +29 -0
- package/dist/tools-ui-agent-ask.d.ts.map +1 -0
- package/dist/tools-ui-agent-ask.js +272 -0
- package/dist/tools-ui-agent-ask.js.map +1 -0
- package/dist/tools-ui-agent-schedule.d.ts +29 -0
- package/dist/tools-ui-agent-schedule.d.ts.map +1 -0
- package/dist/tools-ui-agent-schedule.js +517 -0
- package/dist/tools-ui-agent-schedule.js.map +1 -0
- package/dist/tools-ui-agent.d.ts +40 -0
- package/dist/tools-ui-agent.d.ts.map +1 -0
- package/dist/tools-ui-agent.js +508 -0
- package/dist/tools-ui-agent.js.map +1 -0
- package/dist/tools.d.ts +60 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +1295 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +291 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +55 -7
- package/index.js +0 -1
package/dist/prompts.js
ADDED
|
@@ -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,qBAAqB;QAC5B,WAAW,EACT,mIAAmI;KACtI,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;qFAWmE;iBAC1E;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,cAAc,CACnB,sBAAsB,EACtB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACT,sHAAsH;QACxH,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC,EAAE;KAC9E,EACD,KAAK,EAAE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AAE;;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"}
|