SuperAPIAI Directory

reflagcom/mcp

github.com · AI developer platforms

Reflag CLI is the command-line tool for the Reflag feature flags service, used to manage applications, flags, and authentication in the terminal, and to generate TypeScript types for the Node, React, and Vue v2 SDKs. It also provides a rules command to write AI rules for Cursor and GitHub Copilot, and an mcp command to help editors or AI clients connect to Reflag's hosted remote MCP server, enabling AI tools to understand the flags in a project and their states.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

Reflag CLI is the command-line interface for the Reflag service, used to manage applications, feature flags, and authentication in the terminal, and to generate TypeScript types, thereby simplifying feature flag workflows.

Key capabilities:

  • Initialize configuration: running reflag init creates reflag.config.json in the project directory, containing the settings required for Reflag integration; --overwrite can be used to overwrite an existing configuration.
  • All-in-one onboarding: reflag new [flagName] combines initialization, flag creation, and type generation into a single step, supporting options such as --key, --appId, --out, and --format.
  • Authentication management: provides login and logout commands, securely storing credentials for use in subsequent operations.
  • Flag management: flags create creates a new flag (with interactive guidance available), flags list lists the flags of the current application, and flags types generates TypeScript types.
  • Application listing: apps list lists available applications along with their organization names and IDs; a personal login can list across organizations, while an API key lists only the applications it is bound to.
  • Type generation: CLI v2 generates types for the Node, React, and Vue v2 SDKs; if using SDK v1, CLI 1.x should continue to be used for legacy type generation. reflag flags types reads the boolean flag headers and current multivariate variants in the application's production environment; the generated Flags entries are direct value types rather than .config.payload wrappers; during migration, legacy declarations need to be regenerated. Formats supported are node, react, and vue, and multiple outputs can be configured. Registered non-empty default values are validated against the generated value types, including required and nested fields; singular return types will still be widened from the provided default values. Bare reads/undefined reads remain boolean; an explicit null requests arbitrary JSON. The generated schema reflects the variants as currently written and does not add nested runtime validation; types need to be regenerated after values change. Unconfigured multivariate flags and empty shapes retain the JSON capability type and will not silently become boolean or any.
  • Migrating from the Bucket SDK: the command name changes from bucket to reflag; the type definition file changes from features.d.ts to flags.d.ts (ifSubmitted old files need to be manually deleted); the auth file changed from .bucket-auth to .reflag-auth; the config file changed from bucket.config.json to reflag.config.json; the features command changed to flags; environment variables use REFLAG_API_KEY instead of BUCKET_API_KEY. Scripts, build steps, and .gitignore need to be updated accordingly.
  • Global options: --debug enables debug output; --base-url sets the Reflag API base URL; --api-url directly sets the API URL (overrides base URL); --api-key is used for non-interactive authentication; --org-id restricts app discovery and commands to a single organization, overriding orgId in the config file; --help displays help.
  • AI-assisted development: the rules command adds AI-specific rules to a project, helping AI tools understand how to use Reflag flags. --format supports cursor (writes to .cursor/rules/reflag.mdc) and copilot (writes to a dedicated section of .github/copilot-instructions.md); --yes skips confirmation and overwrites existing files.
  • Model Context Protocol: MCP is an open protocol that connects AI models with data sources and tools. Reflag's MCP lets code editors understand the flags, states, and relationships in a project. The MCP server is hosted by Reflag. The mcp command configures an editor or AI client to connect to the Reflag remote MCP server; --editor supports cursor, vscode, claude, windsurf, and --scope selects global or project-local configuration; the command guides you through selecting an editor, a Reflag app, and a configuration scope, and writes to the corresponding config file. The setup uses mcp-remote as a compatibility layer so that the remotely hosted Reflag MCP server can work with editors/clients that support MCP STDIO servers; if the editor/client supports HTTP Streaming with OAuth, it can connect directly to the Reflag MCP server. Note: the legacy Reflag CLI's mcp command was previously used for a local server; the new version has changed to help connect to the remote MCP server.
  • CI/CD: the CLI can be used in CI/CD pipelines. Automated environments that cannot log in interactively can use the --api-key option or the REFLAG_API_KEY environment variable. When --api-key is used, the login and logout commands are disabled; the API key bypasses all interactive authentication flows; an API key is bound to only one app, and commands such as apps list return only that app; the API key should be stored securely using the CI/CD platform's secret management.

Usage: install the CLI as a development dependency in the project, and run reflag new in the project root to complete initialization, create a flag, and generate TypeScript types in one step; you can also run commands such as init, flags create, and flags types separately for finer control.

Use cases: teams that need to manage Reflag feature flags in TypeScript/JavaScript projects, generate types, get flag context in AI development tools such as Cursor/Copilot, or automate flag-related operations in CI/CD.

Limitations: requires Node.js >=18.0.0; when using SDK v1, CLI 1.x is required; an API key is bound to a single app only; the generated schema does not add nested runtime validation, so values must be regenerated after changes; the orgId setting does not apply to remote MCP connections. The license is MIT.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools