@carrierllc/mcp 0.2.17 → 0.2.19

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 (30) hide show
  1. package/README.md +21 -1
  2. package/dist/cli.js +893 -80
  3. package/dist/cli.js.map +1 -1
  4. package/dist/index.js +213 -36
  5. package/dist/index.js.map +1 -1
  6. package/package.json +10 -9
  7. package/plugin/.claude-plugin/marketplace.json +2 -2
  8. package/plugin/carrier/.claude-plugin/plugin.json +1 -1
  9. package/plugin/carrier/README.md +31 -4
  10. package/plugin/carrier/agents/carrier-billing-auditor.md +1 -1
  11. package/plugin/carrier/commands/billing.md +8 -1
  12. package/plugin/carrier/commands/provision.md +18 -8
  13. package/plugin/carrier/commands/wallet.md +31 -0
  14. package/plugin/carrier/skills/carrier-operations/SKILL.md +12 -5
  15. package/templates/storefront/package-lock.json +12722 -0
  16. package/templates/storefront/package.json +3 -3
  17. package/templates/storefront/src/app/activate/[orderId]/ActivateClient.tsx +125 -0
  18. package/templates/storefront/src/app/activate/[orderId]/page.tsx +16 -12
  19. package/templates/storefront/src/app/api/checkout/claim/route.ts +30 -0
  20. package/templates/storefront/src/app/api/checkout/guest/route.ts +91 -0
  21. package/templates/storefront/src/app/api/profile/phone/route.ts +40 -0
  22. package/templates/storefront/src/app/checkout/[templateId]/CheckoutClient.tsx +71 -13
  23. package/templates/storefront/src/app/checkout/success/CheckoutSuccessClient.tsx +415 -0
  24. package/templates/storefront/src/app/checkout/success/page.tsx +59 -0
  25. package/templates/storefront/src/app/sign-up/[[...sign-up]]/StorefrontSignUpClient.tsx +199 -0
  26. package/templates/storefront/src/app/sign-up/[[...sign-up]]/page.tsx +18 -3
  27. package/templates/storefront/src/lib/checkout-order-claim.ts +141 -0
  28. package/templates/storefront/src/lib/complete-email-sign-up.ts +50 -0
  29. package/templates/storefront/src/lib/verify-checkout-session.ts +70 -0
  30. package/templates/storefront/src/middleware.ts +6 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carrierllc/mcp",
3
- "version": "0.2.17",
4
- "description": "Carrier MCP natural-language control of MVNO/eSIM fleets via eSIMVault OCS. Stdio mode for direct integration with Claude Desktop, Cursor, Windsurf, and MCP-compatible clients. Ships the `carrier` CLI (plugin install + white-label eSIM storefront scaffold).",
3
+ "version": "0.2.19",
4
+ "description": "Carrier MCP \u2014 natural-language control of MVNO/eSIM fleets via eSIMVault OCS. Stdio mode for direct integration with Claude Desktop, Cursor, Windsurf, and MCP-compatible clients. Ships the `carrier` CLI (plugin install + white-label eSIM storefront scaffold).",
5
5
  "license": "MIT",
6
6
  "author": "Carrier (Lifecycle Innovations Limited)",
7
7
  "homepage": "https://mcp.carrier.llc",
@@ -21,25 +21,26 @@
21
21
  "build": "tsup",
22
22
  "type-check": "tsc --noEmit",
23
23
  "lint": "eslint src",
24
- "prepublishOnly": "pnpm run build"
24
+ "prepublishOnly": "pnpm run build",
25
+ "test": "pnpm run build && node --test test/*.test.js"
25
26
  },
26
27
  "dependencies": {
27
28
  "@clack/prompts": "^0.7.0",
28
- "@clerk/backend": "^3.4.12",
29
- "@modelcontextprotocol/ext-apps": "^1.7.2",
29
+ "@clerk/backend": "^3.14.0",
30
+ "@modelcontextprotocol/ext-apps": "^1.7.5",
30
31
  "@modelcontextprotocol/sdk": "^1.29.0",
31
32
  "@noble/hashes": "^1.8.0",
32
- "@sentry/cloudflare": "^10.53.1",
33
+ "@sentry/cloudflare": "^10.65.0",
33
34
  "aws4fetch": "^1.0.20",
34
- "commander": "^12.1.0",
35
+ "commander": "^15.0.0",
35
36
  "picocolors": "^1.1.1",
36
37
  "zod": "^4.4.3"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@cloudflare/workers-types": "^4.20260521.1",
40
- "@types/node": "^22.19.19",
41
+ "@types/node": "^26.1.2",
41
42
  "@typescript-eslint/eslint-plugin": "^8.59.4",
42
- "@typescript-eslint/parser": "^8.59.4",
43
+ "@typescript-eslint/parser": "^8.67.0",
43
44
  "eslint": "^9.39.4",
44
45
  "tsup": "^8.5.1",
45
46
  "typescript": "^5.9.3",
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Carrier — natural-language MVNO/eSIM fleet control + white-label storefront for Claude Code.",
9
- "version": "0.1.0"
9
+ "version": "0.1.1"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "carrier",
14
14
  "source": "./carrier",
15
15
  "description": "Provision eSIMs, manage subscribers/packages/billing/usage/SMS/churn/fleet, and roll out a white-labeled storefront — all in natural language via the Carrier MCP.",
16
- "version": "0.1.0",
16
+ "version": "0.1.1",
17
17
  "author": {
18
18
  "name": "Lifecycle Innovations Limited",
19
19
  "url": "https://carrier.llc"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carrier",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Natural-language control of your MVNO/eSIM fleet — the Stripe of telecom. Provision eSIMs, manage subscribers, packages, billing, usage, SMS, churn, and fleet health, and roll out a white-labeled storefront. Wraps the Carrier MCP (113 tools over OAuth 2.1).",
5
5
  "author": {
6
6
  "name": "Lifecycle Innovations Limited",
@@ -2,18 +2,44 @@
2
2
 
3
3
  Natural-language control of your MVNO/eSIM fleet, plus a white-labeled storefront — the Stripe of telecom, inside Claude Code.
4
4
 
5
- Installed automatically by [`@carrierllc/cli`](https://www.npmjs.com/package/@carrierllc/cli):
5
+ ## Install (recommended)
6
6
 
7
7
  ```bash
8
- npx @carrierllc/cli init
8
+ npx @carrierllc/mcp
9
+ # or, after global install:
10
+ carrier
11
+ carrier init
9
12
  ```
10
13
 
11
- …or manually:
14
+ The CLI opens a clear TUI: status (plugin / MCP / auth), sign-up & sign-in links, storefront scaffold, and “talk to fleet” examples.
12
15
 
13
16
  ```bash
14
- claude plugin marketplace add Lifecycle-Innovations-Limited/carrier.llc --path apps/cli/plugin
17
+ carrier plugin install
18
+ ```
19
+
20
+ ### Zero credentials · OAuth on first use (Entry A)
21
+
22
+ The MCP server is registered as a plain HTTPS URL — **no API token in config**:
23
+
24
+ ```text
25
+ https://mcp.carrier.llc/mcp
26
+ ```
27
+
28
+ When Claude first calls a Carrier tool, your browser opens Clerk sign-in / sign-up
29
+ (Google, GitHub, or email). Authorize once; tokens stay in the client.
30
+
31
+ Headless / CI only: create an org API key (`ak_…`) in the console
32
+ (https://app.carrier.llc → Settings → API Keys) and pass it as a Bearer token
33
+ or `CARRIER_API_KEY` for `carrier ask "…"`.
34
+
35
+ …or wire Claude Code manually:
36
+
37
+ ```bash
38
+ claude plugin marketplace add <path-to-bundled-plugin>
15
39
  claude plugin install carrier@carrier
16
40
  claude mcp add --transport http carrier https://mcp.carrier.llc/mcp
41
+ # stuck on auth?
42
+ claude mcp auth carrier
17
43
  ```
18
44
 
19
45
  ## Commands
@@ -26,6 +52,7 @@ claude mcp add --transport http carrier https://mcp.carrier.llc/mcp
26
52
  | `/carrier:usage` | Usage, projections, depletion, anomalies |
27
53
  | `/carrier:billing` | Balances, thresholds, Stripe Connect payouts |
28
54
  | `/carrier:credits` | Platform credit, top-ups, credential health |
55
+ | `/carrier:wallet` | Managed prepaid wallet balance / bulk top-up / auto-top-up |
29
56
  | `/carrier:sms` | Send an SMS to a subscriber |
30
57
  | `/carrier:esim-status` | eSIM activation / SIM state / provider health |
31
58
  | `/carrier:churn` | Churn risk + marketing intelligence |
@@ -10,7 +10,7 @@ Default to **read-only**. You investigate and recommend; you do not move money w
10
10
  Audit playbook:
11
11
  - **Revenue & events** — `billing_events`, `stripe_connect_status`, `stripe_connect_balance`, `stripe_connect_payouts`, `stripe_connect_dispute_list`.
12
12
  - **Cost outliers** — `high_cost_subscribers`, `detect_usage_anomalies`, `subscriber_depletion_events`. Flag SIMs whose cost exceeds their plan price.
13
- - **Balances & runway** — `credit_balance`, per-reseller `get_reseller_info`. Project when credit blocks provisioning.
13
+ - **Balances & runway** — `credit_balance` (platform), `wallet_balance` (managed prepaid Atlas wallet), per-reseller `get_reseller_info`. Project when credit or wallet blocks provisioning. Do not conflate wallet with Connect payouts.
14
14
  - **Leakage** — packages still billing on suspended subscribers, recurring packages that should have stopped (`list_subscriber_packages`, `stop_resume_recurring_package`).
15
15
 
16
16
  Deliver a findings report: top cost drivers, anomalies, reconciliation gaps, and a prioritized list of corrective actions with the exact tool call for each. Only execute a `modify_*_balance` / billing change after the user approves that specific line.
@@ -5,12 +5,19 @@ argument-hint: "[events|balance|topup|payouts|configure] [subscriber/account]"
5
5
 
6
6
  # Billing
7
7
 
8
- Manage money movement across the fleet.
8
+ Manage money movement across the fleet. Keep the three money domains distinct:
9
+
10
+ | Domain | Tools / command | Purpose |
11
+ |--------|-----------------|---------|
12
+ | Platform credit | `credit_balance`, `balance_topup_form` · also `/carrier:credits` | Carrier platform runway |
13
+ | Stripe Connect | `stripe_connect_status\|balance\|payouts\|dispute_list` | Operator payouts / disputes |
14
+ | Managed prepaid wallet | `wallet_*` · **`/carrier:wallet`** | Atlas prepaid drawdown (managed mode) |
9
15
 
10
16
  - **events** → `billing_events` (recent charges, renewals, adjustments).
11
17
  - **balances** → `credit_balance` (platform credit), `modify_subscriber_balance` / `modify_account_balance` for adjustments. Generate a customer-facing top-up with `balance_topup_form`.
12
18
  - **thresholds / config** → `configure_billing` to set low-balance alerts and auto-renew behavior.
13
19
  - **cost watch** → `high_cost_subscribers` to find the fleet's most expensive SIMs.
14
20
  - **payouts (Stripe Connect)** → `stripe_connect_status`, `stripe_connect_balance`, `stripe_connect_payouts`, `stripe_connect_dispute_list`.
21
+ - **managed wallet** → do not use Connect or platform credit tools; use `/carrier:wallet` (`wallet_balance`, `wallet_topup_checkout`, `wallet_auto_topup`).
15
22
 
16
23
  Any balance modification is money movement — state the exact amount, account, and direction, and confirm before executing. Never adjust a balance without explicit confirmation.
@@ -5,16 +5,26 @@ argument-hint: "[account/reseller] [country or package] [qty]"
5
5
 
6
6
  # Provision eSIM
7
7
 
8
- Provision one or more eSIMs on the Carrier MVNO and get them ready to activate.
8
+ Issue free eSIM stock and assign a starter package so SIMs are ready to activate.
9
9
 
10
10
  Inputs from `$ARGUMENTS` (ask for anything missing): target **account/reseller**, destination **country/region** or **package template**, and **quantity** (default 1).
11
11
 
12
- Steps:
13
- 1. Confirm the reseller account with `list_reseller_accounts` / `get_reseller_info` if not given.
12
+ ## Preferred path — issue from inventory (Console parity)
13
+
14
+ Matches Console / API `POST /v1/subscribers/issue-from-inventory`: OCS auto-picks a free eSIM on the account and assigns the package in one call.
15
+
16
+ 1. Confirm the account with `list_reseller_accounts` / `get_reseller_info` if not given (need numeric account id).
14
17
  2. Pick the package with `list_package_templates` (and `pricing_plans` / `service_catalog` for cost). If none fits, propose `create_package_template`.
15
- 3. Run `provision_esim_wizard` for the requested quantity.
16
- 4. Assign the package with `assign_package` (or `assign_recurring_package` for monthly plans).
17
- 5. Confirm readiness with `esim_status_per_account` and surface the **activation QR / LPA string** for each eSIM.
18
- 6. Report: ICCIDs, assigned package, expiry, and activation instructions in a copyable block.
18
+ 3. For each unit requested, call `assign_package` with **`account_for_subs` = account id** and **`packageTemplateId`** — **omit `iccid`**. Do not send both.
19
+ 4. Surface returned **ICCID**, packageId, and **activation QR / LPA / smdp** fields in a copyable block.
20
+ 5. Confirm stock with `esim_status_per_account` if the operator wants a fleet view.
21
+
22
+ If OCS reports no free inventory, stop and tell the operator to add stock SIMs (eSIMVault), then retry.
23
+
24
+ ## Alternate paths
25
+
26
+ - **Existing free ICCID known** → `assign_package` with `iccid` + `packageTemplateId` (no `account_for_subs`).
27
+ - **Pro+ guided UI** → `provision_esim_wizard` (selects an existing subscriber, not raw inventory stock).
28
+ - **Monthly auto-renew** → after issue, `assign_recurring_package` on the returned ICCID (or use recurring template at issue time only if the one-shot path is not appropriate).
19
29
 
20
- Never provision more than the requested quantity. If credit is low (`credit_balance`), warn before provisioning.
30
+ Never provision more than the requested quantity. If platform credit is low (`credit_balance`) or managed wallet is empty (`wallet_balance` via `/carrier:wallet`), warn before provisioning.
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: Managed prepaid wallet balance, bulk pack top-up, and auto-top-up
3
+ argument-hint: "[balance|topup|packs|auto]"
4
+ ---
5
+
6
+ # Managed prepaid wallet
7
+
8
+ Operate the **Atlas prepaid wallet** (managed-mode drawdown). This is **not** platform credit and **not** Stripe Connect.
9
+
10
+ Money domain map (do not mix them up):
11
+
12
+ | Domain | Tools | When |
13
+ |--------|-------|------|
14
+ | **Managed wallet** (this command) | `wallet_balance`, `wallet_topup_checkout`, `wallet_auto_topup` | Prepaid EUR balance that funds managed connectivity usage |
15
+ | Platform credit | `credit_balance`, `balance_topup_form` | Carrier platform call/credit runway — see `/carrier:credits` |
16
+ | Stripe Connect | `stripe_connect_*` | Operator payouts / disputes — see `/carrier:billing` |
17
+
18
+ Inputs from `$ARGUMENTS` (ask if missing): subcommand **balance** | **topup** | **packs** | **auto**, and optional pack id.
19
+
20
+ Steps:
21
+
22
+ 1. **balance** (default) → `wallet_balance` — EUR cents, auto-top-up enabled/threshold/pack.
23
+ 2. **packs** → `wallet_topup_checkout` with no `pack` — list pack_500 / pack_1000 / pack_2500 / pack_5000 (paid + bonus credit).
24
+ 3. **topup** → pick a pack with the operator, then `wallet_topup_checkout` with `pack` — return the hosted Checkout URL; wallet credits after payment completes.
25
+ 4. **auto** → only after explicit confirm: `wallet_auto_topup` (charges the saved payment method off-session). Prefer dry discussion of threshold first via `wallet_balance`.
26
+
27
+ Safety:
28
+
29
+ - Treat top-up and auto-top-up as money movement — confirm pack amount and org before executing.
30
+ - If the operator asks for "credit" or "Connect payouts", redirect to `/carrier:credits` or `/carrier:billing`.
31
+ - Never invent pack sizes outside the catalog returned by the tools.
@@ -8,7 +8,7 @@ description: Reference map of the Carrier MCP tool surface — domains, key tool
8
8
  Carrier is a programmable connectivity control plane (the "Stripe of telecom") exposed as an MCP server at `https://mcp.carrier.llc/mcp` (OAuth 2.1 + PKCE). Tools span these domains:
9
9
 
10
10
  ## Provisioning & SIM lifecycle
11
- `provision_esim_wizard` · `change_sim_status` · `esim_status_per_account` · `get_sim_provider_status` · `audit_network_coverage` · `hlr_get_bitrate` / `hlr_set_bitrate`
11
+ `assign_package` with `account_for_subs` (issue free eSIM from inventory — Console `issue-from-inventory` parity) · `provision_esim_wizard` (Pro+ UI on existing subscribers) · `change_sim_status` · `esim_status_per_account` · `get_sim_provider_status` · `audit_network_coverage` · `hlr_get_bitrate` / `hlr_set_bitrate`
12
12
 
13
13
  ## Subscribers
14
14
  `list_subscribers` · `get_subscriber` · `diagnose_subscriber` · `modify_subscriber_status` · `modify_subscriber_contact_info` · `modify_subscriber_mobile_plan` · `modify_subscriber_voip_plan` · `affect_subscriber_phone_number` · `move_subscriber_range_to_account` · `get_subscriber_location[_by_cell_id]`
@@ -19,8 +19,10 @@ Carrier is a programmable connectivity control plane (the "Stripe of telecom") e
19
19
  ## Usage & intelligence
20
20
  `subscriber_usage` · `usage_projection` · `subscriber_depletion_events` · `subscriber_network_events` · `subscriber_country_history` · `detect_usage_anomalies` · `churn_risk` · `marketing_intelligence` · `high_cost_subscribers`
21
21
 
22
- ## Billing & credit
23
- `billing_events` · `configure_billing` · `credit_balance` · `modify_subscriber_balance` · `modify_account_balance` · `balance_topup_form` · `stripe_connect_status|balance|payouts|dispute_list`
22
+ ## Billing, credit & wallet (three money domains)
23
+ - Platform credit: `credit_balance` · `balance_topup_form` · `billing_events` · `configure_billing` · `modify_subscriber_balance` · `modify_account_balance`
24
+ - Stripe Connect: `stripe_connect_status|balance|payouts|dispute_list` (Radar / `stripe_proxy_call` are Pro/ops-gated)
25
+ - Managed prepaid wallet: `wallet_balance` · `wallet_topup_checkout` · `wallet_auto_topup` (slash: `/carrier:wallet`)
24
26
 
25
27
  ## Green zone / steering
26
28
  `greenzone_whitelist_list|add|remove` · `reset_subscriber_gz_counter` · `list_steering_lists` · `list_destination_lists` · `list_destination_prefixes` · `modify_subscriber_steering_list` · `push_steering_to_subscriber` · `set_subscriber_traffic_restrictions`
@@ -28,9 +30,14 @@ Carrier is a programmable connectivity control plane (the "Stripe of telecom") e
28
30
  ## Fleet & platform
29
31
  `fleet_health` · `fleet_health_app` · `list_recent_ocs_events` · `rate_limit_status` · `carrier_ocs_calls_per_min` · `environment_info` · `credential_status` · `rotate_credentials` · `list_reseller_accounts` · `get_reseller_info` · `send_sms`
30
32
 
33
+ ## Gated surfaces (not free-tier defaults)
34
+ - **Steel ui_agent_*** — requires `STEEL_API_KEY` / ops config; UI-only OCS ops.
35
+ - **`stripe_proxy_call`** — Pro/Enterprise Stripe Agent Toolkit multiplexer.
36
+ - **`provision_esim_wizard`** — Pro+ MCP App; free tier uses `assign_package` inventory path.
37
+
31
38
  ## Safety rules (always)
32
39
  1. **Read before write.** Establish current state before any mutation.
33
- 2. **Confirm money & live-service changes** — status changes, balance/package mutations, `clean_all_packages`, `rotate_credentials`, outbound `send_sms`.
34
- 3. **Right quantity only** — never over-provision; check `credit_balance` first.
40
+ 2. **Confirm money & live-service changes** — status changes, balance/package mutations, wallet top-ups, `clean_all_packages`, `rotate_credentials`, outbound `send_sms`.
41
+ 3. **Right quantity only** — never over-provision; check `credit_balance` and (managed mode) `wallet_balance` first.
35
42
  4. **Diagnose, don't guess** — use `diagnose_subscriber` + event tools for faults.
36
43
  5. The storefront layer (white-label Mango template) is scaffolded/deployed via `@carrierllc/cli`; keep its plans synced with `pricing_plans`.