@inferevents/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.
Files changed (2) hide show
  1. package/README.md +118 -0
  2. package/package.json +4 -3
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # @inferevents/mcp
2
+
3
+ MCP server for [Infer](https://infer.events) — analytics designed for AI agents, not dashboards.
4
+
5
+ Connects to Claude Code (or any MCP client) and exposes 5 analytics tools. Includes auto-detected insights pushed hourly.
6
+
7
+ ## Install
8
+
9
+ Add to your Claude Code MCP config:
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "infer": {
15
+ "command": "npx",
16
+ "args": ["@inferevents/mcp"]
17
+ }
18
+ }
19
+ }
20
+ ```
21
+
22
+ The server reads credentials from `~/.infer/config.json`:
23
+
24
+ ```json
25
+ {
26
+ "apiKey": "pk_read_...",
27
+ "endpoint": "https://api.infer.events",
28
+ "projectId": "proj_..."
29
+ }
30
+ ```
31
+
32
+ ## Tools
33
+
34
+ ### `get_insights`
35
+
36
+ Returns auto-detected anomalies and notable patterns. Computed hourly by the Infer backend. Always call this first.
37
+
38
+ ```
39
+ "Any insights?" → get_insights()
40
+ "What's wrong?" → get_insights(severity: "critical")
41
+ ```
42
+
43
+ Returns pre-computed findings: volume drops, error spikes, new events, milestones, cohort trends.
44
+
45
+ ### `get_event_counts`
46
+
47
+ Count events over a time range, optionally grouped by a property.
48
+
49
+ ```
50
+ "How many signups this week?" → get_event_counts(event_name: "signup", time_range: "last_7d")
51
+ "Signups by country" → get_event_counts(event_name: "signup", time_range: "last_7d", group_by: "country")
52
+ "Compare this week vs last" → two calls with different time_range values
53
+ ```
54
+
55
+ Supports grouping by event properties, context fields (browser, os, country, city), and top-level columns (anonymous_id, user_id).
56
+
57
+ ### `get_retention`
58
+
59
+ Cohort-based retention analysis.
60
+
61
+ ```
62
+ "What's our retention?" → get_retention(start_event: "signup", return_event: "page_view", time_range: "last_30d", granularity: "week")
63
+ "Do users come back after onboarding?" → get_retention(start_event: "onboarding_done", return_event: "login", ...)
64
+ ```
65
+
66
+ Returns retention percentages per cohort with visual bar charts and benchmark indicators.
67
+
68
+ ### `get_user_journey`
69
+
70
+ Ordered event sequence for a specific user.
71
+
72
+ ```
73
+ "What did this user do?" → get_user_journey(user_id: "user_123")
74
+ "Trace a churned user" → get_user_journey(user_id: "<id from get_event_counts group_by anonymous_id>")
75
+ ```
76
+
77
+ Groups events into sessions (30-min gap), shows timestamps and properties.
78
+
79
+ ### `get_top_events`
80
+
81
+ Most frequent events with counts and unique users.
82
+
83
+ ```
84
+ "What events are being tracked?" → get_top_events(time_range: "last_30d")
85
+ "Top events this week" → get_top_events(time_range: "last_7d", limit: 10)
86
+ ```
87
+
88
+ Includes available fields for `group_by` so the agent knows what it can query.
89
+
90
+ ## Output format
91
+
92
+ All tools return pre-formatted text with Unicode bar charts inside code blocks:
93
+
94
+ ```
95
+ Top Events — last_7d
96
+ 84 total events across 8 types
97
+ ──────────────────────────────────────────────────
98
+
99
+ click ████████████████████ 26 (31%)
100
+
101
+ demo_tab_clicked ███████████████████░ 25 (30%)
102
+
103
+ page_view ████████████░░░░░░░░ 16 (19%)
104
+ ```
105
+
106
+ ## Skills
107
+
108
+ Install the agent skills for guided analytics workflows:
109
+
110
+ ```bash
111
+ npx skills add infer-events/skills
112
+ ```
113
+
114
+ Skills teach the agent how to interpret data, run health checks, build tracking plans, and keep everything updated.
115
+
116
+ ## License
117
+
118
+ MIT
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inferevents/mcp",
3
- "version": "0.2.0",
4
- "description": "MCP server for Infer analytics — lets AI agents query your event data",
3
+ "version": "0.2.1",
4
+ "description": "MCP server for Infer analytics — 5 tools including auto-detected insights pushed hourly",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "files": [
18
18
  "dist",
19
- "skill.md"
19
+ "skill.md",
20
+ "README.md"
20
21
  ],
21
22
  "scripts": {
22
23
  "build": "tsc",