@apex-inc/mcp-server 0.20.0 → 0.22.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.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "MCP server for Apex — currently in private beta.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,6 +12,10 @@ The Adoption Engine tracks whether each end-user has adopted each feature, nudge
12
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
13
  - Apex ranks a user's unmet milestones by priority and sends the single top nudge per cadence — so nobody gets spammed.
14
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
+ - A milestone has **two possible journeys**, and they are opposites:
16
+ - **Nudge** (audience-entry): fires when a user *hasn't* adopted within the gap window. Drives them toward the feature.
17
+ - **Celebration** (fires once on adoption): congratulates the user the moment they *do* reach the milestone, and tells them what's next. Scaffold both legs in one call with `compose_adoption_milestone` + `scaffold: "both"` (this mirrors the dashboard sentence on-ramp).
18
+ - Milestones can be given a sequence **order** (which one accounts reach first). Ordering the full set unlocks the account-view "Path" funnel (a step-by-step drop-off chart). Unordered milestones are treated as independent (order-agnostic coverage).
15
19
 
16
20
  ## When to Activate
17
21
 
@@ -26,7 +30,9 @@ The Adoption Engine tracks whether each end-user has adopted each feature, nudge
26
30
  | `list_adoption_milestones` | See the workspace's current milestones |
27
31
  | `get_adoption_milestone` | Inspect one milestone |
28
32
  | `create_adoption_milestone` | Define a new "adopted feature" milestone |
29
- | `update_adoption_milestone` | Change priority / gap window / turn on/off |
33
+ | `compose_adoption_milestone` | Create a milestone AND scaffold its journey legs (`scaffold: "both" \| "celebration" \| "nudge" \| "none"`) in one call |
34
+ | `update_adoption_milestone` | Change priority / order / gap window / turn on/off |
35
+ | `reorder_adoption_milestones` | Set the sequence order of the whole set (unlocks the Path funnel) |
30
36
  | `delete_adoption_milestone` | Remove a milestone |
31
37
  | `get_adoption_metrics` | Per-milestone funnel + lift-vs-holdout + workspace health |
32
38
  | `list_adoption_features` / `create_adoption_feature` | Tenant-owned feature groupings (group your own events) |
@@ -75,6 +81,21 @@ raw `predicate`:
75
81
  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).
76
82
  4. Later: `get_adoption_metrics` → report the lift-vs-holdout so they know whether it worked.
77
83
 
84
+ ### "Congratulate users when they start their first experiment"
85
+ 1. `compose_adoption_milestone` with `name: "Started first experiment"`, `featureKey: "experiments"`, `adoptedWhenKind: "event"`, `eventName: "experiment_started"`, `scaffold: "celebration"`. This creates the milestone AND a draft celebration journey wired to fire once, the moment the user reaches it.
86
+ 2. Tell the user the celebration journey is a **draft** — they edit the congratulatory message in the canvas (Communications composer), then publish it.
87
+ 3. Turning the milestone on is separate from publishing the journey; both must be live for the celebration to send.
88
+
89
+ ### "Set up a full milestone — nudge the ones who don't, celebrate the ones who do"
90
+ 1. `compose_adoption_milestone` with `scaffold: "both"` (e.g. `name: "Started first experiment"`, `featureKey: "experiments"`, `adoptedWhenKind: "event"`, `eventName: "experiment_started"`, `gapDays: 7`). One call creates the milestone plus BOTH draft journeys: the nudge (for users who haven't started an experiment within 7 days) and the celebration (for the moment they do). This is exactly what the dashboard sentence on-ramp produces.
91
+ 2. The response carries `nudgeJourneyId` and `celebrationJourneyId` — both are **drafts**. Edit copy in the canvas and publish each.
92
+ 3. Turn the milestone on (`update_adoption_milestone` `active: true`) once its nudge is published, so it can measure lift vs the holdout.
93
+
94
+ ### "Put my milestones in the order accounts should hit them"
95
+ 1. `list_adoption_milestones` → get the ids.
96
+ 2. `reorder_adoption_milestones` with `orderedIds` in the intended sequence (activation before depth).
97
+ 3. Tell the user the account view's "Path" funnel is now unlocked — it shows drop-off between consecutive milestones. Without a full order it stays on the order-agnostic "Coverage" view.
98
+
78
99
  ## Guardrails
79
100
 
80
101
  - Milestones start OFF. Only set `active: true` when the user confirms they want to start sending.
@@ -62,6 +62,24 @@ Read these resources before suggesting communications-related actions to underst
62
62
 
63
63
  ## Common Patterns
64
64
 
65
+ ### "Which template should I attach to this journey send step / broadcast?"
66
+
67
+ `list_communications` IS the picker — use its filters instead of dumping every comm and eyeballing it:
68
+
69
+ ```
70
+ 1. list_communications(pipeline="transactional", channel="email")
71
+ → narrow to the pipeline + channel the step needs. 'transactional'
72
+ bypasses opt-out and is ONLY valid after a recipient-initiated trigger
73
+ (user_signup, password_reset_requested). 'marketing' is consent-gated.
74
+ 2. Read each row's subject + one-line body preview to disambiguate similar
75
+ titles — you do NOT need to preview_communication every candidate.
76
+ 3. Pick by `id` (+ its version) and attach it to the send step.
77
+ ```
78
+
79
+ Pipeline is load-bearing: attaching a `transactional` comm to a passive-trigger
80
+ journey (schedule / audience-entry / passive event) is a **publish-time
81
+ hard-block**. For those journeys, filter to `pipeline="marketing"`.
82
+
65
83
  ### "I need to send a welcome email"
66
84
  ```
67
85
  1. recommend_communications → look for "welcome" in results