@toggletown/mcp-server
v0.1.0
Published
ToggleTown MCP server — manage feature flags, rollouts, targeting rules, and A/B experiments from any AI assistant
Maintainers
Readme
@toggletown/mcp-server
MCP server for ToggleTown — manage feature flags, rollouts, targeting rules, and A/B experiments from any AI assistant that supports the Model Context Protocol.
Quick Start
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"toggletown": {
"command": "npx",
"args": ["-y", "@toggletown/mcp-server"],
"env": {
"TOGGLETOWN_API_KEY": "your-api-key"
}
}
}
}Claude Code
claude mcp add toggletown -- npx -y @toggletown/mcp-serverThen set your API key in the environment:
export TOGGLETOWN_API_KEY=your-api-keyConfiguration
| Variable | Required | Description |
|----------|----------|-------------|
| TOGGLETOWN_API_KEY | Yes | Your account API key from the ToggleTown dashboard |
| TOGGLETOWN_API_URL | No | API base URL (defaults to https://api.toggletown.com) |
Tools
The server exposes 12 tools:
| Tool | Description |
|------|-------------|
| toggletown_list_projects | List all projects with IDs, names, and flag counts |
| toggletown_list_flags | List feature flags in a project with per-environment status |
| toggletown_get_flag | Get full flag details including rules and rollout config |
| toggletown_create_flag | Create a new feature flag (boolean, string, number, or JSON) |
| toggletown_toggle_flag | Enable or disable a flag in a specific environment |
| toggletown_evaluate_flag | Test flag evaluation with a user context |
| toggletown_update_rules | Set targeting rules for a flag (first match wins) |
| toggletown_set_rollout | Set percentage rollout (deterministic user bucketing) |
| toggletown_list_environments | List environments in a project |
| toggletown_get_audit_logs | Get recent flag change activity |
| toggletown_list_experiments | List A/B experiments in a project |
| toggletown_create_experiment | Create a new A/B experiment on a string flag |
Resources
The server also provides MCP resources for reading flag data:
toggletown://projects— All projects overviewtoggletown://projects/{projectId}/flags— Flags for a projecttoggletown://projects/{projectId}/environments— Environments for a projecttoggletown://projects/{projectId}/flags/{flagKey}— Single flag detail
Examples
Once connected, you can ask your AI assistant things like:
- "List all my feature flags"
- "Create a flag called
new-checkoutand roll it out to 10% in production" - "Who changed the
dark-modeflag recently?" - "Set up a targeting rule so users with plan=enterprise get the new dashboard"
- "Create an A/B experiment on the hero-text flag with control and treatment variants"
License
MIT
