@featureflip/mcp 0.1.0 → 0.1.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/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, r, t as i } from "./org-yZkTaCl5.js";
1
+ import { a as e, i as t, n, r, t as i } from "./org-BrpyzAh9.js";
2
2
  import { serveStdio as a } from "@modelcontextprotocol/server/stdio";
3
3
  //#region src/cli.ts
4
4
  async function o() {
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./org-yZkTaCl5.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./org-BrpyzAh9.js";
2
2
  export { t as ApiError, e as FeatureflipApi, r as PKG_VERSION, i as createServer, n as loadConfig, a as resolveOrg };
@@ -4,7 +4,7 @@ import * as t from "zod/v4";
4
4
  //#region src/version.ts
5
5
  var n = {
6
6
  name: "@featureflip/mcp",
7
- version: "0.1.0",
7
+ version: "0.1.1",
8
8
  description: "MCP server for managing Featureflip feature flags from AI agents and editors",
9
9
  license: "Apache-2.0",
10
10
  repository: {
@@ -491,8 +491,16 @@ var C = [
491
491
  "php",
492
492
  "ruby",
493
493
  "swift"
494
- ], w = "Uses a SERVER-side SDK key (Featureflip dashboard → environment → SDK keys).", T = "Uses a CLIENT-side SDK key (safe to ship to browsers/apps).";
495
- function E(e, t) {
494
+ ], w = [
495
+ "browser",
496
+ "react",
497
+ "swift"
498
+ ];
499
+ function T(e) {
500
+ return w.includes(e);
501
+ }
502
+ var E = "Uses a SERVER-side SDK key (Featureflip dashboard → environment → SDK keys).", D = "Uses a CLIENT-side SDK key (safe to ship to browsers/apps).";
503
+ function O(e, t) {
496
504
  switch (e) {
497
505
  case "js": return {
498
506
  install: "npm install @featureflip/js",
@@ -507,7 +515,7 @@ const enabled = client.boolVariation('${t}', { user_id: userId }, false);
507
515
  if (enabled) {
508
516
  // new code path
509
517
  }`,
510
- notes: w
518
+ notes: E
511
519
  };
512
520
  case "node": return {
513
521
  install: "npm install @featureflip/node",
@@ -518,7 +526,7 @@ const enabled = client.boolVariation('${t}', { user_id: userId }, false);
518
526
  if (enabled) {
519
527
  // new code path
520
528
  }`,
521
- notes: w
529
+ notes: E
522
530
  };
523
531
  case "browser": return {
524
532
  install: "npm install @featureflip/browser",
@@ -530,7 +538,7 @@ const enabled = client.boolVariation('${t}', false);
530
538
  if (enabled) {
531
539
  // new code path
532
540
  }`,
533
- notes: T
541
+ notes: D
534
542
  };
535
543
  case "react": return {
536
544
  install: "npm install @featureflip/react @featureflip/browser",
@@ -543,7 +551,7 @@ function MyComponent() {
543
551
  const enabled = useFeatureFlag('${t}', false);
544
552
  return enabled ? <NewExperience /> : <CurrentExperience />;
545
553
  }`,
546
- notes: T
554
+ notes: D
547
555
  };
548
556
  case "python": return {
549
557
  install: "pip install featureflip",
@@ -554,7 +562,7 @@ enabled = client.variation("${t}", {"user_id": user_id}, default=False)
554
562
  if enabled:
555
563
  # new code path
556
564
  ...`,
557
- notes: w
565
+ notes: E
558
566
  };
559
567
  case "csharp": return {
560
568
  install: "dotnet add package Featureflip.Client",
@@ -567,7 +575,7 @@ if (enabled)
567
575
  {
568
576
  // new code path
569
577
  }`,
570
- notes: w
578
+ notes: E
571
579
  };
572
580
  case "java": return {
573
581
  install: "implementation 'io.featureflip:featureflip-java:2.0.0'",
@@ -581,7 +589,7 @@ boolean enabled = client.boolVariation("${t}",
581
589
  if (enabled) {
582
590
  // new code path
583
591
  }`,
584
- notes: w
592
+ notes: E
585
593
  };
586
594
  case "go": return {
587
595
  install: "go get github.com/canopy-labs/featureflip-go",
@@ -597,7 +605,7 @@ ctx := featureflip.EvaluationContext{UserID: userID}
597
605
  if client.BoolVariation("${t}", ctx, false) {
598
606
  // new code path
599
607
  }`,
600
- notes: w
608
+ notes: E
601
609
  };
602
610
  case "php": return {
603
611
  install: "composer require featureflip/featureflip-php",
@@ -623,7 +631,7 @@ enabled = client.bool_variation("${t}", { "user_id" => user_id }, false)
623
631
  if enabled
624
632
  # new code path
625
633
  end`,
626
- notes: w
634
+ notes: E
627
635
  };
628
636
  case "swift": return {
629
637
  install: ".package(url: \"https://github.com/canopy-labs/featureflip-swift\", from: \"2.0.0\")",
@@ -636,13 +644,13 @@ let enabled = client.boolVariation("${t}", default: false)
636
644
  if enabled {
637
645
  // new code path
638
646
  }`,
639
- notes: T
647
+ notes: D
640
648
  };
641
649
  }
642
650
  }
643
651
  //#endregion
644
652
  //#region src/tools/workflows/wrap-feature.ts
645
- function D(e, n) {
653
+ function k(e, n) {
646
654
  e.registerTool("wrap_feature", {
647
655
  title: "Wrap a feature in a new flag",
648
656
  description: "Create a Boolean feature flag and get back the SDK code snippet to guard the new code path with it. Returns the snippet only — apply the edit yourself. The flag starts DISABLED in every environment; enable it with toggle_flag when ready.",
@@ -663,10 +671,11 @@ function D(e, n) {
663
671
  name: r ?? t,
664
672
  type: "Boolean",
665
673
  description: a,
666
- tags: s
674
+ tags: s,
675
+ ...T(l) ? { clientSideVisible: !0 } : {}
667
676
  },
668
677
  idempotencyKey: u
669
- }), d = E(l, t);
678
+ }), d = O(l, t);
670
679
  return o({
671
680
  flag: c,
672
681
  integration: {
@@ -685,16 +694,16 @@ function D(e, n) {
685
694
  }
686
695
  //#endregion
687
696
  //#region src/server.ts
688
- function O(t) {
697
+ function A(t) {
689
698
  let r = new e({
690
699
  name: "featureflip",
691
700
  version: n
692
701
  });
693
- return u(r, t), d(r, t), f(r, t), m(r, t), g(r, t), y(r, t), b(r, t), S(r, t), D(r, t), r;
702
+ return u(r, t), d(r, t), f(r, t), m(r, t), g(r, t), y(r, t), b(r, t), S(r, t), k(r, t), r;
694
703
  }
695
704
  //#endregion
696
705
  //#region src/config.ts
697
- function k(e = process.env) {
706
+ function j(e = process.env) {
698
707
  let t = e.FEATUREFLIP_TOKEN?.trim();
699
708
  if (!t) throw Error("FEATUREFLIP_TOKEN is required. Create one in the Featureflip dashboard — Settings → API Tokens (personal token, ffp_...) or Organization Settings → Service Tokens (ffs_...) — and set it in your MCP client config.");
700
709
  return {
@@ -705,7 +714,7 @@ function k(e = process.env) {
705
714
  }
706
715
  //#endregion
707
716
  //#region src/org.ts
708
- async function A(e, t) {
717
+ async function M(e, t) {
709
718
  if (t) return t;
710
719
  let n = (await e.request("GET", "/api/v1/orgs", { query: { limit: 100 } })).items ?? [];
711
720
  if (n.length === 1) {
@@ -716,4 +725,4 @@ async function A(e, t) {
716
725
  throw n.length === 0 ? Error("The token can see no organizations. Check the token in the Featureflip dashboard.") : Error(`The token can see ${n.length} organizations — set FEATUREFLIP_ORG to one of: ` + n.map((e) => e.slug ?? "?").join(", "));
717
726
  }
718
727
  //#endregion
719
- export { a, r as i, k as n, n as o, O as r, A as t };
728
+ export { a, r as i, j as n, n as o, A as r, M as t };
@@ -1,5 +1,7 @@
1
1
  export declare const LANGUAGES: readonly ["js", "node", "browser", "react", "python", "csharp", "java", "go", "php", "ruby", "swift"];
2
2
  export type SnippetLanguage = (typeof LANGUAGES)[number];
3
+ export declare const CLIENT_SIDE_LANGUAGES: readonly SnippetLanguage[];
4
+ export declare function isClientSideLanguage(language: SnippetLanguage): boolean;
3
5
  export interface Snippet {
4
6
  install: string;
5
7
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../../../src/tools/workflows/snippets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,uGAEZ,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAKD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CA8J9E"}
1
+ {"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../../../src/tools/workflows/snippets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,uGAEZ,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAKzD,eAAO,MAAM,qBAAqB,EAAE,SAAS,eAAe,EAAkC,CAAC;AAE/F,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAEvE;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAKD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CA8J9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-feature.d.ts","sourceRoot":"","sources":["../../../src/tools/workflows/wrap-feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CA+CjF"}
1
+ {"version":3,"file":"wrap-feature.d.ts","sourceRoot":"","sources":["../../../src/tools/workflows/wrap-feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAwDjF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featureflip/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for managing Featureflip feature flags from AI agents and editors",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -19,8 +19,13 @@
19
19
  }
20
20
  },
21
21
  "types": "./dist/index.d.ts",
22
- "files": ["dist", "bin"],
23
- "publishConfig": { "access": "public" },
22
+ "files": [
23
+ "dist",
24
+ "bin"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
24
29
  "scripts": {
25
30
  "build": "vite build",
26
31
  "typecheck": "tsc --noEmit -p tsconfig.json",
@@ -40,5 +45,7 @@
40
45
  "vite-plugin-dts": "^5.0.0",
41
46
  "vitest": "^4.1.2"
42
47
  },
43
- "engines": { "node": ">=20.19.0" }
48
+ "engines": {
49
+ "node": ">=20.19.0"
50
+ }
44
51
  }