feat(mcp): Add built-in MCP server for AI agent flag management - #761
feat(mcp): Add built-in MCP server for AI agent flag management#761marceloboeira wants to merge 1 commit into
Conversation
|
Queued — the merge queue status continues in this comment ↓. |
AI coding assistants are becoming a primary interface for developers. Adding a built-in MCP server lets agents manage flags directly without leaving the editor or hand-crafting API calls. The server is embedded in the Flagr binary at /mcp on the same port as the REST API, using Streamable HTTP transport. Single binary, single port, no sidecars. Disabled by default. Set FLAGR_MCP_ENABLED=true to opt in. When off the route simply doesn't exist, so no extra attack surface. 27 tools covering the full flag lifecycle: CRUD for flags, segments, variants, and constraints, plus distributions, tags, and evaluation. Built with the official Go MCP SDK. Integration tests run across the full docker-compose matrix with a disabled-mode test verifying the route is absent when the flag is off.
Merge Queue Status
This pull request spent 13 seconds in the queue, including 3 seconds running CI. Required conditions to mergeReasonPull request #761 has been dequeued GitHub refused to merge the pull request. At least 1 approving review is required by reviewers with write access. You're not authorized to push to this branch. Visit https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected. This is usually enforced by a branch protection or ruleset rule. HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
|
@zhouzhuojie do you want to take a look? in theory there is nothing breaking as it's disabled by default. |
Description
AI coding assistants are becoming a primary interface for developers. Adding a built-in MCP server lets agents manage flags directly without leaving the editor or hand-crafting API calls.
The server is embedded in the Flagr binary at /mcp on the same port as the REST API, using Streamable HTTP transport. Single binary, single port, no sidecars.
Disabled by default. Set FLAGR_MCP_ENABLED=true to opt in. When off the route simply doesn't exist, so no extra attack surface.
27 tools covering the full flag lifecycle: CRUD for flags, segments, variants, and constraints, plus distributions, tags, and evaluation. Built with the official Go MCP SDK. Integration tests run across the full docker-compose matrix with a disabled-mode test verifying the route is absent when the flag is off.
How Has This Been Tested?
Besides all the unit/integration tests, I tested the e2e functionality by running opencode locally and pointing to the built MCP (see images).
Input
Result
Created Flag
Types of changes
Checklist: