statsig · Capability

Statsig Feature Management

Unified feature management workflow combining Statsig's HTTP API and Console API. Enables product teams to evaluate feature gates in real-time, manage gate configuration, run A/B experiments, track exposures, and log analytics events from a single integration. Supports the full feature management lifecycle from gate creation through experiment analysis.

Run with Naftiko Feature FlagsFeature ManagementA/B TestingExperimentationProduct AnalyticsDynamic Configuration

What You Can Do

POST
Check gate — Evaluate a feature gate for a user.
/v1/gates/check
POST
Get config — Get dynamic config values for a user.
/v1/configs/get
POST
Get experiment — Get experiment group assignment for a user.
/v1/experiments/evaluate
POST
Log events — Log analytics events and exposures.
/v1/events
GET
List gates — List all feature gates.
/v1/management/gates
POST
Create gate — Create a new feature gate.
/v1/management/gates
GET
List experiments — List all experiments.
/v1/management/experiments
POST
Create experiment — Create a new experiment.
/v1/management/experiments
GET
List audit logs — List configuration change audit logs.
/v1/management/audit-logs

MCP Tools

check-feature-gate

Evaluate whether a feature gate passes for a given user, including rule matching and group assignment.

read-only
check-multiple-gates

Evaluate multiple feature gates for a user in a single request.

read-only
get-dynamic-config

Fetch dynamic configuration key-value pairs for a user.

read-only
get-experiment-assignment

Get a user's experiment group assignment and parameter values.

read-only
initialize-sdk

Initialize all evaluated gates, configs, and experiments for a user (for client SDK use).

read-only
log-analytics-events

Log custom analytics events and experiment exposures to Statsig.

list-feature-gates

List all feature gates in the Statsig project.

read-only
create-feature-gate

Create a new feature gate with targeting rules.

get-feature-gate-config

Get the full configuration of a feature gate by name.

read-only
delete-feature-gate

Permanently delete a feature gate from the project.

idempotent
list-experiments

List all A/B test experiments in the project.

read-only
create-experiment

Create a new A/B test experiment with groups and parameter configuration.

start-experiment

Start an experiment to begin allocating users to test groups.

idempotent
list-metrics

List all metric definitions used in experiment analysis.

read-only
list-audit-logs

List audit log entries showing who changed what in the project configuration.

read-only

APIs Used

statsig-http statsig-console

Capability Spec

feature-management.yaml Raw ↑
naftiko: "1.0.0-alpha1"

info:
  label: "Statsig Feature Management"
  description: >-
    Unified feature management workflow combining Statsig's HTTP API and
    Console API. Enables product teams to evaluate feature gates in real-time,
    manage gate configuration, run A/B experiments, track exposures, and
    log analytics events from a single integration. Supports the full feature
    management lifecycle from gate creation through experiment analysis.
  tags:
    - Feature Flags
    - Feature Management
    - A/B Testing
    - Experimentation
    - Product Analytics
    - Dynamic Configuration
  created: "2026-05-02"
  modified: "2026-05-02"

binds:
  - namespace: env
    keys:
      STATSIG_SERVER_SECRET_KEY: STATSIG_SERVER_SECRET_KEY
      STATSIG_CONSOLE_API_KEY: STATSIG_CONSOLE_API_KEY

capability:
  consumes:
    - import: statsig-http
      location: ./shared/http-api.yaml
    - import: statsig-console
      location: ./shared/console-api.yaml

  exposes:
    - type: rest
      port: 8080
      namespace: statsig-feature-management-api
      description: "Unified REST API for Statsig feature management across evaluation and administration."
      resources:
        - path: /v1/gates/check
          name: check-gate
          description: "Runtime gate evaluation."
          operations:
            - method: POST
              name: check-gate
              description: "Evaluate a feature gate for a user."
              call: "statsig-http.check-gate"
              with:
                user: "rest.user"
                gateName: "rest.gateName"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/configs/get
          name: get-config
          description: "Dynamic configuration retrieval."
          operations:
            - method: POST
              name: get-config
              description: "Get dynamic config values for a user."
              call: "statsig-http.get-config"
              with:
                user: "rest.user"
                configName: "rest.configName"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/experiments/evaluate
          name: evaluate-experiment
          description: "Runtime experiment evaluation."
          operations:
            - method: POST
              name: get-experiment
              description: "Get experiment group assignment for a user."
              call: "statsig-http.get-experiment"
              with:
                user: "rest.user"
                experimentName: "rest.experimentName"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/events
          name: events
          description: "Analytics event logging."
          operations:
            - method: POST
              name: log-events
              description: "Log analytics events and exposures."
              call: "statsig-http.log-events"
              with:
                events: "rest.events"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/management/gates
          name: manage-gates
          description: "Gate configuration management."
          operations:
            - method: GET
              name: list-gates
              description: "List all feature gates."
              call: "statsig-console.list-gates"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: POST
              name: create-gate
              description: "Create a new feature gate."
              call: "statsig-console.create-gate"
              with:
                name: "rest.name"
                rules: "rest.rules"
                tags: "rest.tags"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/management/experiments
          name: manage-experiments
          description: "Experiment management."
          operations:
            - method: GET
              name: list-experiments
              description: "List all experiments."
              call: "statsig-console.list-experiments"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: POST
              name: create-experiment
              description: "Create a new experiment."
              call: "statsig-console.create-experiment"
              with:
                name: "rest.name"
                groups: "rest.groups"
                allocation: "rest.allocation"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/management/audit-logs
          name: audit-logs
          description: "Project audit log."
          operations:
            - method: GET
              name: list-audit-logs
              description: "List configuration change audit logs."
              call: "statsig-console.list-audit-logs"
              outputParameters:
                - type: object
                  mapping: "$."

    - type: mcp
      port: 9090
      namespace: statsig-feature-management-mcp
      transport: http
      description: "MCP server for AI-assisted Statsig feature management, experimentation, and analytics."
      tools:
        - name: check-feature-gate
          description: "Evaluate whether a feature gate passes for a given user, including rule matching and group assignment."
          hints:
            readOnly: true
            openWorld: false
          call: "statsig-http.check-gate"
          with:
            user: "tools.user"
            gateName: "tools.gateName"
          outputParameters:
            - type: object
              mapping: "$."

        - name: check-multiple-gates
          description: "Evaluate multiple feature gates for a user in a single request."
          hints:
            readOnly: true
            openWorld: false
          call: "statsig-http.check-gate-multiple"
          with:
            user: "tools.user"
            gateNames: "tools.gateNames"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-dynamic-config
          description: "Fetch dynamic configuration key-value pairs for a user."
          hints:
            readOnly: true
            openWorld: false
          call: "statsig-http.get-config"
          with:
            user: "tools.user"
            configName: "tools.configName"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-experiment-assignment
          description: "Get a user's experiment group assignment and parameter values."
          hints:
            readOnly: true
            openWorld: false
          call: "statsig-http.get-experiment"
          with:
            user: "tools.user"
            experimentName: "tools.experimentName"
          outputParameters:
            - type: object
              mapping: "$."

        - name: initialize-sdk
          description: "Initialize all evaluated gates, configs, and experiments for a user (for client SDK use)."
          hints:
            readOnly: true
            openWorld: false
          call: "statsig-http.initialize"
          with:
            user: "tools.user"
          outputParameters:
            - type: object
              mapping: "$."

        - name: log-analytics-events
          description: "Log custom analytics events and experiment exposures to Statsig."
          hints:
            readOnly: false
            destructive: false
            idempotent: false
          call: "statsig-http.log-events"
          with:
            events: "tools.events"
          outputParameters:
            - type: object
              mapping: "$."

        - name: list-feature-gates
          description: "List all feature gates in the Statsig project."
          hints:
            readOnly: true
            openWorld: true
          call: "statsig-console.list-gates"
          with:
            limit: "tools.limit"
            page: "tools.page"
          outputParameters:
            - type: object
              mapping: "$."

        - name: create-feature-gate
          description: "Create a new feature gate with targeting rules."
          hints:
            readOnly: false
            destructive: false
            idempotent: false
          call: "statsig-console.create-gate"
          with:
            name: "tools.name"
            description: "tools.description"
            rules: "tools.rules"
            tags: "tools.tags"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-feature-gate-config
          description: "Get the full configuration of a feature gate by name."
          hints:
            readOnly: true
            openWorld: false
          call: "statsig-console.get-gate"
          with:
            id: "tools.id"
          outputParameters:
            - type: object
              mapping: "$."

        - name: delete-feature-gate
          description: "Permanently delete a feature gate from the project."
          hints:
            readOnly: false
            destructive: true
            idempotent: true
          call: "statsig-console.delete-gate"
          with:
            id: "tools.id"
          outputParameters:
            - type: object
              mapping: "$."

        - name: list-experiments
          description: "List all A/B test experiments in the project."
          hints:
            readOnly: true
            openWorld: true
          call: "statsig-console.list-experiments"
          outputParameters:
            - type: object
              mapping: "$."

        - name: create-experiment
          description: "Create a new A/B test experiment with groups and parameter configuration."
          hints:
            readOnly: false
            destructive: false
            idempotent: false
          call: "statsig-console.create-experiment"
          with:
            name: "tools.name"
            description: "tools.description"
            hypothesis: "tools.hypothesis"
            groups: "tools.groups"
            allocation: "tools.allocation"
          outputParameters:
            - type: object
              mapping: "$."

        - name: start-experiment
          description: "Start an experiment to begin allocating users to test groups."
          hints:
            readOnly: false
            destructive: false
            idempotent: true
          call: "statsig-console.start-experiment"
          with:
            id: "tools.id"
          outputParameters:
            - type: object
              mapping: "$."

        - name: list-metrics
          description: "List all metric definitions used in experiment analysis."
          hints:
            readOnly: true
            openWorld: true
          call: "statsig-console.list-metrics"
          outputParameters:
            - type: object
              mapping: "$."

        - name: list-audit-logs
          description: "List audit log entries showing who changed what in the project configuration."
          hints:
            readOnly: true
            openWorld: true
          call: "statsig-console.list-audit-logs"
          with:
            limit: "tools.limit"
            page: "tools.page"
          outputParameters:
            - type: object
              mapping: "$."