@sentientui/mcp 0.2.1 → 0.2.2

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 (3) hide show
  1. package/AGENTS.md +70 -0
  2. package/README.md +12 -1
  3. package/package.json +3 -2
package/AGENTS.md ADDED
@@ -0,0 +1,70 @@
1
+ # SentientUI — AI Agent Guide
2
+
3
+ SentientUI is a UI personalization platform that assigns visitors to variant components and reorders page sections per persona. The MCP gives agents read + limited write access to project data.
4
+
5
+ ## Key Concepts
6
+
7
+ **Persona / Cluster** — visitors are clustered by behavior into labeled groups. A `reliability_score` (0–1) measures confidence in the assignment. Low reliability means the engine won't personalize for that session even if a cluster is assigned.
8
+
9
+ **Variant** — a version of an adaptive component. Variants start as **draft** after `create_variant`; they must be activated from the dashboard before traffic is assigned. There is no MCP tool to activate or resume variants.
10
+
11
+ **Guardrail** — automatic safety circuit that pauses variants whose CVR drops below threshold. `list_guardrail_events` shows what's been paused. Pausing via `pause_variant` is irreversible via MCP (no resume tool).
12
+
13
+ **Shadow mode** — project-level flag (toggled in dashboard settings). When ON: personalization is computed and logged but visitors receive the default layout/variant. Use it to validate the algorithm before committing to live changes.
14
+
15
+ **Insights** — AI-generated. Two tiers: narrator observations (all plans) + advisor recommendations (Growth tier). Insights go stale after 6 hours. Always check `isStale` before presenting them.
16
+
17
+ **Layout stats** — per-persona section ordering driven by a bandit algorithm. `pulls` = times a layout was applied, `avgReward` = normalized conversion signal (not raw CVR).
18
+
19
+ ## Auth
20
+
21
+ Server keys start with `sk_` — required for the management API. Public keys (`pk_`) are for the React SDK only and will be rejected. Key is scoped to the account; all owned projects are accessible.
22
+
23
+ ## Tool Quick Reference
24
+
25
+ | Tool | Notes |
26
+ |------|-------|
27
+ | `list_projects` | Start here to get project IDs |
28
+ | `get_project_stats` | Health status + 24h event/session volume |
29
+ | `list_components` | Components + variant counts + impression totals |
30
+ | `get_variant_performance` | CVR 7d vs prior 7d + momentum direction |
31
+ | `get_persona_breakdown` | Cluster distribution + avg reliability per cluster |
32
+ | `get_goal_funnel` | Goal hit counts + per-variant completion rates |
33
+ | `list_guardrail_events` | Auto-paused variants (last 24h) |
34
+ | `get_layout_stats` | Per-persona layout order + bandit pulls/reward |
35
+ | `get_insights` | Narrator bullets + (Growth) advisor bullets |
36
+ | `refresh_insights` | Async trigger — wait ~15s then call `get_insights` |
37
+ | `create_variant` | Creates DRAFT — user must activate in dashboard |
38
+ | `pause_variant` | Stops traffic; no MCP resume |
39
+
40
+ ## Canonical Workflows
41
+
42
+ **Diagnose a conversion drop**
43
+ 1. `get_project_stats` — confirm events are flowing
44
+ 2. `get_goal_funnel` — find which goals/variants are down
45
+ 3. `get_variant_performance` — check CVR momentum
46
+ 4. `list_guardrail_events` — see if the guardrail fired
47
+ 5. `refresh_insights` → wait 15s → `get_insights` — read AI summary
48
+
49
+ **Add a new variant**
50
+ 1. `list_components` — confirm the component ID
51
+ 2. `create_variant` — creates draft
52
+ 3. Tell the user to activate it from the dashboard
53
+
54
+ **Understand the audience**
55
+ 1. `get_persona_breakdown` — cluster sizes + reliability
56
+ 2. `get_layout_stats` — what layout order each persona gets
57
+ 3. `get_insights` — AI narrative on what changed
58
+
59
+ **Validate before going live (shadow mode)**
60
+ - Shadow mode is enabled/disabled in the dashboard (Project Settings)
61
+ - When ON: personalization runs silently, no live impact
62
+ - When confident: turn OFF to start serving personalized experiences
63
+
64
+ ## Common Mistakes
65
+
66
+ - Presenting stale insights without checking `isStale` — always check, and offer to `refresh_insights`
67
+ - Assuming `create_variant` is live — it's always a draft
68
+ - Calling `pause_variant` without warning the user it's irreversible via MCP
69
+ - Using a `pk_` key instead of `sk_` — it will be rejected
70
+ - Interpreting `avgReward` in layout stats as a conversion rate — it's a bandit reward signal, not CVR
package/README.md CHANGED
@@ -6,7 +6,7 @@ MCP server for [SentientUI](https://sentient-ui.com) — gives AI agents in Clau
6
6
 
7
7
  **1. Get a server key**
8
8
 
9
- Dashboard → **Settings → API KeysCreate server key** (`sk_live_...`).
9
+ Dashboard → Project → **Settings → API keyServer key** → Generate (requires Starter or Growth plan).
10
10
 
11
11
  **2. Add to your AI assistant**
12
12
 
@@ -107,6 +107,17 @@ The server key you provide is passed as a `Bearer` token on every call to the Se
107
107
 
108
108
  Server keys start with `sk_` (not `pk_`). Public keys (`pk_`) are for the React SDK only and will be rejected by the management API.
109
109
 
110
+ ## AI agent context
111
+
112
+ `AGENTS.md` (included in this package) gives your AI assistant deeper context about SentientUI concepts, tool ordering, and common pitfalls. Wire it up once and it applies to every conversation.
113
+
114
+ | Assistant | How to use |
115
+ |-----------|-----------|
116
+ | **Claude Code** | Copy to `~/.claude/skills/sentientui/SKILL.md` |
117
+ | **Cursor** | Copy to `.cursor/rules/sentientui.mdc` |
118
+ | **GitHub Copilot** | Append to `.github/copilot-instructions.md` |
119
+ | **Other** | Paste into your assistant's system prompt |
120
+
110
121
  ## Requirements
111
122
 
112
123
  - Node.js 18+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentientui/mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for SentientUI — exposes project data and actions to AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,8 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
- "README.md"
21
+ "README.md",
22
+ "AGENTS.md"
22
23
  ],
23
24
  "scripts": {
24
25
  "build": "tsup",