npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mcp-statsig-server

v0.1.1

Published

Model Context Protocol (MCP) server for Statsig Console API

Downloads

6

Readme

MCP Statsig Server

Overview

  • Model Context Protocol (MCP) server exposing Statsig Console API tools.
  • Local stdio transport for AI tools; optional HTTP coming later.

Quick Start

  • Copy .env.example to .env and set STATSIG_CONSOLE_API_KEY (not required for the health_check tool). Optionally set STATSIG_CONSOLE_BASE_URL (defaults to https://api.statsig.com/console/v1).
  • Dev: cd agents/mcp-statsig-server && npm run dev
  • Build: cd agents/mcp-statsig-server && npm run build
  • Run (compiled): cd agents/mcp-statsig-server && npm start

Bring Your Own Key (Universal Use)

  • Goal: anyone can use the server without editing client configs. Two options:
    • Env var in client config: set STATSIG_CONSOLE_API_KEY in your MCP client (e.g., Claude Desktop claude_desktop_config.json).
    • In-session BYOK (recommended): call the auth tool to provide your key, optionally persisting it locally.

Auth Tools

  • statsig_auth_set_key — Set your Statsig Console API key for this session. Optional persist: "true" stores it in ~/.config/mcp-statsig-server/credentials.json.
    • Example: { "apiKey": "console-xxxxx", "persist": "true" }
  • statsig_auth_status — Reports whether a key is set and its source (env|memory|file|none).
  • statsig_auth_clear — Clears the in-memory key. Optional removePersisted: "true" deletes the saved file.

How it resolves your key

  • Precedence: in-memory (set via statsig_auth_set_key) → STATSIG_CONSOLE_API_KEY env → persisted file.
  • On startup, if no env var is present and a persisted key exists, it is loaded automatically.

Security Notes

  • The server never logs secrets and routes logs to stderr to protect MCP stdout.
  • Persisting to disk writes plaintext under ~/.config/mcp-statsig-server/credentials.json. Prefer in-memory if you do not want disk storage.
  • Avoid passing keys in shared transcripts. If your client logs tool arguments, use ephemeral (non-persisted) mode.

MCP Usage

  • Configure your MCP-enabled client to launch mcp-statsig-server (stdio). The server reads STATSIG_CONSOLE_API_KEY and handles the required Console API auth header automatically.
  • Tools (high level):
    • Health: health_check.
    • Gates: list/get/versions + create/update/delete + lifecycle (enable|disable|launch|archive|unarchive) + load_pulse.
    • Dynamic Configs: list/get + create/update/delete + enable|disable + versions.
    • Experiments: list/get + pulse/cumulative exposures + lifecycle + group enable/disable + restart-as-new.
    • Segments/Tags/Metrics/Events/Users/Teams/Layers: read and mutation coverage per Console API.

Distribute to Others

  • Publish to npm (recommended):
    • Bump version: npm version patch (or minor/major)
    • Publish: npm publish --access public (prepublish builds and ships dist/)
  • Consumers (Claude Desktop) can reference via npx:
    • Config snippet:
      • "mcp-statsig-server": { "command": "npx", "args": [ "-y", "mcp-statsig-server" ] }
    • Then run statsig_auth_set_key to provide their own key.
  • Alternatively, share the built folder:
    • Zip dist/ and this README; recipients run node dist/index.js.
    • Still universal: they set their own key via auth tools.

Smoke Test (read-only)

  • From repo root: npx tsx agents/mcp-statsig-server/scripts/full-smoke.ts
  • Outputs JSON results under agents/mcp-statsig-server/smoke-results/<timestamp>/.

Project Layout

  • src/index.ts — bootstrap, stdio transport, tool registration
  • src/config.ts — env parsing and validation (zod)
  • src/logger.ts — pino logger
  • src/tools/ — tool handlers

Notes

  • No nested git repo is created. If/when we extract this to a standalone repo, we can use git subtree split or git filter-repo.
  • By default we operate against your development project. There is no additional gating required from you for development use.