Why Use Feature Flags?
Declarative Gating
Annotate capabilities with
featureFlag metadata — no conditional logic in your tool codeMultiple Providers
Split.io, LaunchDarkly, Unleash, static flags, or your own custom adapter
Per-User Targeting
Evaluate flags per user or session via auth context for targeted rollouts
Execution Gate
Blocks direct
tool/call invocations that bypass the list filter — no sneaking past disabled flagsInstallation
How It Works
Hook Registration
The plugin registers hooks on list flows for tools, resources, prompts, and skills
Metadata Collection
When capabilities are listed, the plugin collects
featureFlag refs from each entry’s metadataQuick Start
Basic Setup
Annotating a Tool
Programmatic Flag Checks
The plugin extends all execution contexts withthis.featureFlags:
Adapters
Static
Best for: Development, testing, and demos with fixed flag values.Split.io
Requires the
@splitsoftware/splitio peer dependency:LaunchDarkly
Requires the
@launchdarkly/node-server-sdk peer dependency:Unleash
Requires the
unleash-client peer dependency:Custom
Provide your own adapter implementing theFeatureFlagAdapter interface:
FeatureFlagAdapter interface:
Annotating Capabilities
AddfeatureFlag to any tool, resource, prompt, or skill metadata. Capabilities with disabled flags are hidden from list responses and blocked from direct invocation.
String Shorthand
Object Form
Use the object form to specify adefaultValue — the fallback when the adapter throws or the flag is unknown:
FeatureFlagRef Fields
| Field | Type | Description |
|---|---|---|
key | string | The flag key to evaluate |
defaultValue | boolean | Fallback value when evaluation fails (default: false) |
featureFlag: 'key'), defaultValue is false.
Plugin Options
The feature flag provider to use
Static flag values (only used with
adapter: 'static')Provider-specific configuration (varies by adapter):
- Split.io:
{ apiKey: string } - LaunchDarkly:
{ sdkKey: string } - Unleash:
{ url: string, appName: string, apiKey?: string }
Custom adapter instance (only used with
adapter: 'custom')Global fallback when the adapter throws an error during evaluation
How to cache flag evaluation results:
session— cache per session, expires aftercacheTtlMsrequest— cache per request lifecyclenone— no caching, evaluate every time
Cache TTL in milliseconds (used with
cacheStrategy: 'session')Custom function to extract the user ID from the request context. By default, the plugin reads
authInfo.extra.sub, authInfo.extra.userId, or authInfo.clientId.Custom function to extract targeting attributes from the request context. Attributes are passed to the adapter for per-user targeting rules.
API Reference
FeatureFlagAccessor Methods
Access viathis.featureFlags in any execution context (ToolContext, AgentContext, etc.).
Check if a feature flag is enabled. Uses caching if configured.
Get the variant for a multi-variate flag
Batch evaluate multiple flags at once
Resolve a
FeatureFlagRef (string or object) to a booleanBest Practices
Use static adapter for development
Use static adapter for development
The static adapter requires no external dependencies and gives you instant, predictable flag values during development. Switch to a real adapter (Split.io, LaunchDarkly, Unleash) for staging and production.
Set defaultValue to control failure behavior
Set defaultValue to control failure behavior
When the adapter throws (network error, service down),
defaultValue controls whether the flag is treated as enabled or disabled. Set it globally or per-flag:Use caching with external adapters
Use caching with external adapters
External adapters involve network calls. Use
cacheStrategy: 'session' to avoid repeated evaluations:Use object-form for critical features
Use object-form for critical features
For features that should remain available even when the flag service is down, use the object form with This ensures the tool stays available if the adapter throws.
defaultValue: true:Complete Example
Links & Resources
Source Code
View the feature flags plugin source code
Plugin Guide
Learn more about FrontMCP plugins
Remember Plugin
For session memory storage
Approval Plugin
For tool authorization workflows