Manage Feature Flags with MCP
Contents
The PostHog MCP server lets your AI coding agent create, manage, and schedule Feature Flags directly from your code editor. Create flags, configure targeting rules, check rollout status, and schedule future changes – without switching to the PostHog app.
This works in any MCP client – Cursor, Windsurf, Claude Code, VS Code, and others.
How it works
With MCP, your coding agent can:
- Create flags while building features – "Create a flag called
new-searchrolled out to 10% of users" as part of your development workflow - Check flag status before deploying – "Which feature flags are active in production?" to verify your deploy won't conflict
- Clean up stale flags – "Find flags not evaluated in 90 days" and remove the dead code
- Update rollout rules – "Roll out
dark-modeto 50%" or "add the beta-testers cohort to thenew-dashboardflag" - Schedule future flag changes – "Schedule the
new-checkoutflag to enable at midnight" or "Set up a recurring weekly disable for maintenance windows"
Feature flag tools
The MCP server provides these tools for working with Feature Flags:
| Tool | Description |
|---|---|
create-feature-flag | Create a new feature flag with rollout percentage, targeting rules, and optional multivariate variants. |
feature-flag-get-definition | Get the full definition of a flag, including filters, groups, and payloads. |
feature-flag-get-all | List all feature flags in the current project. Filter by active/inactive status. |
update-feature-flag | Update a flag's rollout percentage, targeting rules, or variants. |
delete-feature-flag | Delete a feature flag. |
Scheduled change tools
Schedule future flag changes programmatically using these tools:
| Tool | Description |
|---|---|
scheduled-changes-list | List scheduled changes in the current project. Filter by flag ID to see pending, executed, and failed schedules. |
scheduled-changes-get | Get the full details of a specific scheduled change by ID, including payload, timing, and execution status. |
scheduled-changes-create | Schedule a future change to a feature flag – enable/disable, add release conditions, or update variants. Supports recurring schedules (daily, weekly, monthly, yearly). |
scheduled-changes-update | Update a pending scheduled change's timing, payload, or recurrence settings. |
scheduled-changes-delete | Delete a scheduled change by ID. The change is permanently removed and won't execute. |
Example prompts
Try these with your MCP-enabled agent:
Create a feature flag called new-checkout-flow rolled out to 20% of users on the pro plan.Show me all active feature flags.Which flags haven't been modified in the last 90 days?Update the dark-mode flag to roll out to 100% of users.Create a multivariate flag called button-color with three variants: red, blue, and green.Delete the old-pricing-test flag.
Scheduling prompts
Schedule the new-checkout-flow flag to enable at midnight tomorrow.List all pending scheduled changes for my feature flags.Create a recurring schedule to disable the maintenance-mode flag every Sunday at 2am.Cancel the scheduled rollout for the dark-mode flag.Update the scheduled change for beta-features to trigger at 9am instead of noon.
Install the MCP server
The recommended way to install is with the AI wizard:
The wizard supports Claude, Cursor, Windsurf, VS Code, and more. You can also configure it manually.
See the MCP server docs for full setup instructions.