@firstdistro/mcp 1.1.2 → 1.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 CHANGED
@@ -211,8 +211,7 @@ node bin/firstdistro-mcp.js init
211
211
 
212
212
  ## Support
213
213
 
214
- - Documentation: https://firstdistro.com/docs
215
- - Issues: https://github.com/firstdistro/mcp/issues
214
+ - Documentation: https://firstdistro.com/documentation
216
215
  - Email: support@firstdistro.com
217
216
 
218
217
  ## License
package/dist/server.js CHANGED
@@ -1053,6 +1053,99 @@ ${nextStepsOutput}`
1053
1053
  }
1054
1054
  }
1055
1055
  );
1056
+ server.tool(
1057
+ "create_experience",
1058
+ `Create a new customer journey/experience to track user progress through a flow.
1059
+
1060
+ You need three things from the user:
1061
+ 1. A name for the experience (e.g., "Team Onboarding", "Checkout Flow")
1062
+ 2. What triggers the START \u2014 when does a user enter this journey?
1063
+ 3. What counts as SUCCESS \u2014 when has the user completed it?
1064
+
1065
+ If the user hasn't provided all three, ask follow-up questions before calling this tool.
1066
+
1067
+ After creation, help the user add the returned tracking events to their code.`,
1068
+ {
1069
+ name: z.string().describe('Name of the experience (e.g., "Team Onboarding")'),
1070
+ description: z.string().optional().describe("What this journey tracks"),
1071
+ start_event_description: z.string().describe('What triggers the start (e.g., "User visits the team settings page")'),
1072
+ success_event_description: z.string().describe('What counts as completion (e.g., "User successfully invites a team member")')
1073
+ },
1074
+ async ({ name, description, start_event_description, success_event_description }) => {
1075
+ try {
1076
+ const response = await fetch(`${config.baseUrl}/api/vendor/experiences`, {
1077
+ method: "POST",
1078
+ headers: {
1079
+ ...getApiHeaders(config.apiKey),
1080
+ "Content-Type": "application/json"
1081
+ },
1082
+ body: JSON.stringify({
1083
+ name,
1084
+ description,
1085
+ start_event_description,
1086
+ success_event_description
1087
+ })
1088
+ });
1089
+ if (!response.ok) {
1090
+ const errorData = await response.json().catch(() => ({}));
1091
+ const errorMessage = errorData.error || response.statusText;
1092
+ if (response.status === 409) {
1093
+ return {
1094
+ content: [
1095
+ {
1096
+ type: "text",
1097
+ text: `Experience "${name}" already exists. Use list_experiences to see your existing journeys.`
1098
+ }
1099
+ ],
1100
+ isError: true
1101
+ };
1102
+ }
1103
+ return {
1104
+ content: [
1105
+ {
1106
+ type: "text",
1107
+ text: formatHttpError(response.status, errorMessage, `Create experience "${name}"`)
1108
+ }
1109
+ ],
1110
+ isError: true
1111
+ };
1112
+ }
1113
+ const rawData = await response.json();
1114
+ const data = unwrapApiResponse(rawData);
1115
+ const events = data.events || {};
1116
+ const integrationHint = data.integration_hint || "";
1117
+ return {
1118
+ content: [
1119
+ {
1120
+ type: "text",
1121
+ text: `Experience "${data.experience?.name || name}" created successfully!
1122
+
1123
+ **Event names to track:**
1124
+ - Start: \`${events.start}\`
1125
+ - Success: \`${events.success}\`
1126
+
1127
+ **Add to your code:**
1128
+ ${integrationHint}
1129
+
1130
+ The experience is now visible in the FirstDistro dashboard at /dashboard/experiences with status "pending" \u2014 it will become "active" once events start flowing.
1131
+
1132
+ Use \`check_events_flowing\` after deploying to verify events are arriving.`
1133
+ }
1134
+ ]
1135
+ };
1136
+ } catch (error) {
1137
+ return {
1138
+ content: [
1139
+ {
1140
+ type: "text",
1141
+ text: formatNetworkError(error)
1142
+ }
1143
+ ],
1144
+ isError: true
1145
+ };
1146
+ }
1147
+ }
1148
+ );
1056
1149
  }
1057
1150
  function registerUnconfiguredTools(server, configError = null) {
1058
1151
  const message = configError ? `FirstDistro configuration error:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firstdistro/mcp",
3
- "version": "1.1.2",
4
- "description": "MCP server that brings customer health scores, stuck users, and funnel analytics into Claude, Cursor, and other AI tools — catch churn risks early",
3
+ "version": "1.2.1",
4
+ "description": "MCP server for customer success — monitor health scores, detect churn risks, and manage customer journeys from Claude, Cursor, and other AI tools",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "firstdistro-mcp": "./bin/firstdistro-mcp.js"
@@ -31,6 +31,7 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^20.0.0",
34
+ "cac": "^6.7.14",
34
35
  "tsup": "^8.0.0",
35
36
  "typescript": "^5.0.0",
36
37
  "vitest": "^4.0.18"
@@ -40,14 +41,21 @@
40
41
  },
41
42
  "keywords": [
42
43
  "mcp",
44
+ "mcp-server",
43
45
  "model-context-protocol",
44
46
  "firstdistro",
45
47
  "customer-success",
48
+ "cs-tools",
49
+ "churn",
50
+ "health-score",
51
+ "customer-health",
52
+ "saas",
46
53
  "ai",
47
54
  "claude",
55
+ "cursor",
48
56
  "llm"
49
57
  ],
50
58
  "license": "MIT",
51
- "homepage": "https://firstdistro.com/documentation/mcp/overview",
59
+ "homepage": "https://firstdistro.com/documentation",
52
60
  "author": "FirstDistro <support@firstdistro.com>"
53
61
  }