@sentientui/mcp 0.2.0 → 0.2.1

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 ADDED
@@ -0,0 +1,113 @@
1
+ # @sentientui/mcp
2
+
3
+ MCP server for [SentientUI](https://sentient-ui.com) — gives AI agents in Claude Code, Cursor, and Copilot direct access to your experiment data and management actions.
4
+
5
+ ## Quick start
6
+
7
+ **1. Get a server key**
8
+
9
+ Dashboard → **Settings → API Keys → Create server key** (`sk_live_...`).
10
+
11
+ **2. Add to your AI assistant**
12
+
13
+ **Claude Code** — `~/.claude/settings.json`:
14
+ ```json
15
+ {
16
+ "mcpServers": {
17
+ "sentientui": {
18
+ "command": "npx",
19
+ "args": ["-y", "@sentientui/mcp"],
20
+ "env": {
21
+ "SENTIENTUI_API_KEY": "sk_live_your_key_here"
22
+ }
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ **Cursor** — `~/.cursor/mcp.json`:
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "sentientui": {
33
+ "command": "npx",
34
+ "args": ["-y", "@sentientui/mcp"],
35
+ "env": {
36
+ "SENTIENTUI_API_KEY": "sk_live_your_key_here"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ **VS Code + Copilot** — `.vscode/mcp.json`:
44
+ ```json
45
+ {
46
+ "servers": {
47
+ "sentientui": {
48
+ "type": "stdio",
49
+ "command": "npx",
50
+ "args": ["-y", "@sentientui/mcp"],
51
+ "env": {
52
+ "SENTIENTUI_API_KEY": "sk_live_your_key_here"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ **3. Restart your IDE.** The server connects at startup.
60
+
61
+ ## Demo mode
62
+
63
+ No account? Run without an API key:
64
+
65
+ ```bash
66
+ npx @sentientui/mcp
67
+ ```
68
+
69
+ A sandboxed demo token is provisioned automatically — 10 calls/month, no sign-up required. The token is cached in `~/.config/sentientui/mcp-anon.json`.
70
+
71
+ ## Tools
72
+
73
+ | Tool | What it does |
74
+ |------|-------------|
75
+ | `list_projects` | List all projects in the account |
76
+ | `get_project_stats` | Events, sessions, agent calls, and health status |
77
+ | `list_components` | All adaptive components with variant counts |
78
+ | `get_variant_performance` | CVR, momentum, and impressions per variant (7d vs prior 7d) |
79
+ | `get_insights` | AI-generated narrator observations and advisor recommendations |
80
+ | `refresh_insights` | Trigger fresh AI insight generation |
81
+ | `get_persona_breakdown` | Visitor cluster distribution with reliability scores |
82
+ | `get_goal_funnel` | Goal hit counts and conversion rates per variant |
83
+ | `list_guardrail_events` | Variants auto-paused by the guardrail (last 24h) |
84
+ | `get_layout_stats` | Per-persona section layout rankings and reward weights |
85
+ | `create_variant` | Create a new draft variant (Starter+) |
86
+ | `pause_variant` | Pause a variant to stop traffic assignment |
87
+
88
+ ## Example prompts
89
+
90
+ - *"What projects do I have?"*
91
+ - *"Show me the CVR trends for the hero banner this week"*
92
+ - *"Are any variants paused by the guardrail right now?"*
93
+ - *"What do the AI insights say about what changed this week?"*
94
+ - *"Refresh insights for project X"*
95
+ - *"Create a new variant called 'short-copy' for the pricing CTA"*
96
+
97
+ ## Configuration
98
+
99
+ | Environment variable | Default | Description |
100
+ |----------------------|---------|-------------|
101
+ | `SENTIENTUI_API_KEY` | — | Your `sk_live_...` server key. Required (or demo mode activates). |
102
+ | `SENTIENTUI_API_URL` | `https://api.sentient-ui.com` | Override for self-hosted or staging deployments. |
103
+
104
+ ## Auth model
105
+
106
+ The server key you provide is passed as a `Bearer` token on every call to the SentientUI management API. It is scoped to your account — all projects you own are accessible. Keys are never logged or stored by the MCP package; they exist only in the process environment.
107
+
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
+
110
+ ## Requirements
111
+
112
+ - Node.js 18+
113
+ - A SentientUI account (or use demo mode)
package/dist/index.cjs CHANGED
@@ -379,7 +379,7 @@ async function main() {
379
379
  if (!apiKey) {
380
380
  apiKey = await resolveDemoToken();
381
381
  }
382
- const client = new ApiClient({ apiKey });
382
+ const client = new ApiClient({ apiKey, baseUrl: process.env.SENTIENTUI_API_URL });
383
383
  const server = createMcpServer(client);
384
384
  const transport = new import_stdio.StdioServerTransport();
385
385
  await server.connect(transport);
package/dist/index.js CHANGED
@@ -378,7 +378,7 @@ async function main() {
378
378
  if (!apiKey) {
379
379
  apiKey = await resolveDemoToken();
380
380
  }
381
- const client = new ApiClient({ apiKey });
381
+ const client = new ApiClient({ apiKey, baseUrl: process.env.SENTIENTUI_API_URL });
382
382
  const server = createMcpServer(client);
383
383
  const transport = new StdioServerTransport();
384
384
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentientui/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server for SentientUI — exposes project data and actions to AI agents",
5
5
  "type": "module",
6
6
  "bin": {