@apex-inc/mcp-server 0.16.0 → 0.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apex-inc/mcp-server",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "MCP server for Apex — currently in private beta.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: apex-adoption
3
+ description: Help users set up and run Apex's Adoption Engine — per-feature adoption milestones defined over their own events/traits, automatic nudges to users who haven't adopted, and lift-vs-holdout measurement. Use whenever the user mentions product adoption, activation nudges, "users who haven't tried X", feature adoption, onboarding nudges, or wants to drive users to a feature. A milestone is NOT a goal.
4
+ ---
5
+
6
+ # Apex Adoption (MCP)
7
+
8
+ The Adoption Engine tracks whether each end-user has adopted each feature, nudges the ones who haven't (one next-best nudge per user), and measures the lift against a holdout.
9
+
10
+ ## Core idea
11
+
12
+ - A **milestone** = "has this end-user adopted feature X?" — defined by an event they fire (`report_run`) or a trait (`plan = pro`). It is per-user and per-feature. It is **not** a goal (goals are workspace/experiment/journey success).
13
+ - Apex ranks a user's unmet milestones by priority and sends the single top nudge per cadence — so nobody gets spammed.
14
+ - A ~10% deterministic holdout is kept automatically; the report shows lift vs that holdout, not last-touch attribution. Users in an active experiment are never nudged.
15
+
16
+ ## When to Activate
17
+
18
+ - "Nudge users who signed up but never ran their first report."
19
+ - "Which features are people not adopting?"
20
+ - "Set up an activation program / onboarding nudges."
21
+
22
+ ## Tool Map
23
+
24
+ | Tool | When to use |
25
+ |---|---|
26
+ | `list_adoption_milestones` | See the workspace's current milestones |
27
+ | `get_adoption_milestone` | Inspect one milestone |
28
+ | `create_adoption_milestone` | Define a new "adopted feature" milestone |
29
+ | `update_adoption_milestone` | Change priority / gap window / turn on/off |
30
+ | `delete_adoption_milestone` | Remove a milestone |
31
+ | `get_adoption_metrics` | Per-milestone funnel + lift-vs-holdout + workspace health |
32
+
33
+ Read-only summary resource: `apex://adoption`.
34
+
35
+ ## Tool Invocation Order
36
+
37
+ ### "Nudge users who haven't run their first report"
38
+ 1. `list_adoption_milestones` → check it doesn't already exist.
39
+ 2. `create_adoption_milestone` with `name: "Ran first report"`, `featureKey: "reporting"`, `adoptedWhenKind: "event"`, `eventName: "report_run"`, `gapDays: 3`. Leave `active` off first.
40
+ 3. Tell the user it's created as a draft, and that turning it on (`update_adoption_milestone` with `active: true`) starts nudging through their journeys (opt-out + caps respected).
41
+ 4. Later: `get_adoption_metrics` → report the lift-vs-holdout so they know whether it worked.
42
+
43
+ ## Guardrails
44
+
45
+ - Milestones start OFF. Only set `active: true` when the user confirms they want to start sending.
46
+ - Never call it a "goal" in user-facing text.
47
+ - The `eventName`/`traitPath` must be an event/trait the workspace actually sends — confirm with the user if unsure.
@@ -72,7 +72,7 @@ Interactive flows: MCP prompts `new-experiment` and `experiment-review` orchestr
72
72
  - **Screenshots are first-class.** For public web URLs, `create_experiment` auto-captures control + variant screenshots and shows them on the dashboard experiment card + detail gallery. For localhost / auth-gated / mobile screens, capture the image yourself and call `attach_experiment_asset({ experimentId, variantKey, imageBase64 })`.
73
73
  - **Mobile/Capacitor experiments capture on-device.** When the experiment runs on an authed in-app screen (servers can't reach it), tell the dev to call `Apex.captureVariantScreenshot({ experimentId, variantKey })` on the variant's screen, keyed to the resolved variant in a `useEffect`, in a debug build (`Apex.initialize({ ..., debug: true })`). It no-ops in production and lands the shot on the dashboard card + gallery like web/agent captures.
74
74
  - **Exposure auto-fires.** When a variant resolves via `useApexVariant` (web) or `Apex.getVariant()` (mobile), the SDK fires the canonical `experiment_exposure` event — the denominator for results. You don't fire it manually.
75
- - **Don't launch a dead experiment.** `activate_experiment` is gated on `verify_experiment_wiring`: both arms must be producing `experiment_exposure` events first, or it refuses (pass `force: true` to override). Run `verify_experiment_wiring({ experimentId })` after deploying the variant code to confirm both arms are live before launch.
75
+ - **Don't launch a dead experiment.** `activate_experiment` is gated on `verify_experiment_wiring`. Code-wired (SDK-hook) web experiments are safe to activate before their code ships: the server holds them in `pending_deployment` ("Waiting on deploy") and starts them automatically at the first `experiment_exposure`. Non-SDK experiments with unwired arms are refused (pass `force: true` to override). Run `verify_experiment_wiring({ experimentId })` after the deploy lands to confirm both arms are live.
76
76
 
77
77
  ### Journey-arm experiments (any surface)
78
78
 
@@ -160,8 +160,8 @@ just report the number.
160
160
  | Concentration: top 10% sellers > ~60% GMV | Long-tail seller enablement; the platform is one churn away from a revenue cliff |
161
161
  | NRR < 100% (`get_saas_recurring_revenue`) | Expansion journey + contraction interviews; churned-MRR column names the cohort |
162
162
  | Contraction MRR spike (`get_saas_expansion`) | Downgrade-reason capture (`subscription_event` action="downgrade" with reason) → pricing/packaging belief |
163
- | Rising return rate on one SKU (`get_dtc_returns` + `get_dtc_merchandising`) | Fix the PDP (size guide, photos) — reasons name the fix; returns are goods-back, refunds are money-back |
164
- | High views, low add-to-cart on a top SKU | Merchandising experiment (price anchor, social proof) on that product page |
163
+ | Rising return rate on one SKU (`get_ecommerce_returns` + `get_ecommerce_product_sales`) | Fix the PDP (size guide, photos) — reasons name the fix; returns are goods-back, refunds are money-back |
164
+ | High views, low add-to-cart on a top SKU | Product-page experiment (price anchor, social proof) on that product |
165
165
 
166
166
  Honesty rules baked into every tool: metrics with unwired inputs come
167
167
  back as unwired hints (never zeros), rates follow small-n rules, low-
@@ -256,6 +256,11 @@ Each launch vertical has a canonical event set that unlocks its
256
256
  industry-specific dashboard pack. Wire the vertical's set and the
257
257
  matching widgets + read APIs light up automatically.
258
258
 
259
+ Every pack read API accepts a relative window (`days` for event-based
260
+ reports, `months` for month-grain MRR reports) OR an explicit
261
+ `start` + `end` (YYYY-MM-DD, both together — explicit bounds win).
262
+ Month-grain reports map the range to the UTC calendar months it covers.
263
+
259
264
  ### B2B SaaS — recurring revenue
260
265
 
261
266
  ```typescript
@@ -278,7 +283,7 @@ Unlocks: MRR waterfall, NRR/GRR, expansion & seats
278
283
  `get_saas_recurring_revenue` / `get_saas_expansion` via MCP).
279
284
  Connecting Stripe replaces manual events per account (Stripe wins).
280
285
 
281
- ### E-commerce / DTC merchandising + returns
286
+ ### E-commerce product sales + returns
282
287
 
283
288
  ```typescript
284
289
  track("product_view", { product_id: "sku_a", product_name: "Trail Runner", category: "footwear", value: 129.99 });
@@ -292,7 +297,9 @@ track("purchase_refunded", { order_id: "o_1", value: 129.99, currency: "USD", re
292
297
  ```
293
298
 
294
299
  Unlocks: per-product funnel, returns & reasons, AOV/repeat
295
- (`GET /api/dtc/merchandising`, `/api/dtc/returns`).
300
+ (`GET /api/ecommerce/product-sales`, `/api/ecommerce/returns`
301
+ `getEcommerceProductSales()` / `getEcommerceReturns()` in the SDK,
302
+ `get_ecommerce_product_sales` / `get_ecommerce_returns` via MCP).
296
303
 
297
304
  ### Marketplace — two-sided lifecycle
298
305
 
@@ -105,7 +105,7 @@ Scan-first additions per vertical — wire where the truth lives:
105
105
  (monthly|annual|quarterly|weekly) — quarantined for MRR otherwise.
106
106
  `seat_count` unlocks seat growth. Account traits: `account_id`,
107
107
  `plan`, `mrr`, `arr`, `seat_count` (typed via ApexAccountTraits).
108
- - **DTC**: returns pipeline → `return_requested` / `return_completed`
108
+ - **E-commerce**: returns pipeline → `return_requested` / `return_completed`
109
109
  (goods back) alongside `purchase_refunded` (money back — now carries
110
110
  optional `product_id` for per-SKU attribution). Never conflate the two.
111
111
  - **Marketplace**: supply (`seller_signup`, `listing_created`,