@growthbook/mcp 1.4.2 → 1.4.4
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@growthbook/mcp",
|
|
3
3
|
"mcpName": "io.github.growthbook/growthbook-mcp",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.4",
|
|
5
5
|
"description": "MCP Server for interacting with GrowthBook",
|
|
6
6
|
"access": "public",
|
|
7
7
|
"homepage": "https://github.com/growthbook/growthbook-mcp",
|
|
@@ -308,6 +308,7 @@ export function registerExperimentTools({ server, baseApiUrl, apiKey, appOrigin,
|
|
|
308
308
|
}
|
|
309
309
|
// Fetch experiment defaults first and surface to user
|
|
310
310
|
let experimentDefaults = await getDefaults(apiKey, baseApiUrl);
|
|
311
|
+
const stringifyValue = (value) => typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
311
312
|
const experimentPayload = {
|
|
312
313
|
name,
|
|
313
314
|
description,
|
|
@@ -338,12 +339,14 @@ export function registerExperimentTools({ server, baseApiUrl, apiKey, appOrigin,
|
|
|
338
339
|
const flagPayload = {
|
|
339
340
|
id: flagId,
|
|
340
341
|
owner: user,
|
|
341
|
-
defaultValue: variations[0].value,
|
|
342
|
+
defaultValue: stringifyValue(variations[0].value),
|
|
342
343
|
valueType: typeof variations[0].value === "string"
|
|
343
344
|
? "string"
|
|
344
345
|
: typeof variations[0].value === "number"
|
|
345
346
|
? "number"
|
|
346
|
-
: "boolean"
|
|
347
|
+
: typeof variations[0].value === "boolean"
|
|
348
|
+
? "boolean"
|
|
349
|
+
: "json",
|
|
347
350
|
description,
|
|
348
351
|
environments: {
|
|
349
352
|
...experimentDefaults.environments.reduce((acc, env) => {
|
|
@@ -354,7 +357,7 @@ export function registerExperimentTools({ server, baseApiUrl, apiKey, appOrigin,
|
|
|
354
357
|
type: "experiment-ref",
|
|
355
358
|
experimentId: experimentData.experiment.id,
|
|
356
359
|
variations: experimentData.experiment.variations.map((expVariation, idx) => ({
|
|
357
|
-
value: variations[idx].value,
|
|
360
|
+
value: stringifyValue(variations[idx].value),
|
|
358
361
|
variationId: expVariation.variationId,
|
|
359
362
|
})),
|
|
360
363
|
},
|