The Unleash Feature Flag MCP Server allows AI agents to manage feature flags through the Unleash API, implementing the Model Context Protocol (MCP) to enable programmatic feature flag management.
You can install the package globally from npm:
npm install -g @ylin6/unleash-ff-mcp-server
Alternatively, run it directly using npx without installation:
npx @ylin6/unleash-ff-mcp-server
Before using the server, you need to set the following environment variables:
UNLEASH_API_URL
: The URL of your Unleash API instanceUNLEASH_AUTH_TOKEN
: The authentication token for your Unleash instanceRetrieves a list of all projects in the Unleash instance.
Retrieves all feature flags within a specific project.
Parameters:
projectId
: The ID of the projectCreates a new feature flag within a project.
Parameters:
projectId
: The ID of the projectname
: The name of the feature flagdescription
: A description of the feature flagtype
: The type of the feature flag (e.g., "release", "experiment", "operational", "kill-switch")Updates an existing feature flag.
Parameters:
projectId
: The ID of the projectfeatureId
: The ID of the feature flagdescription
: A new description for the feature flagtype
: A new type for the feature flagRetrieves details about a specific feature flag.
Parameters:
projectId
: The ID of the projectfeatureId
: The ID of the feature flagTo use this MCP server with Cursor, add the following command in your Cursor settings:
env UNLEASH_API_URL=XXXX UNLEASH_AUTH_TOKEN=XXX npx -y @ylin6/unleash-ff-mcp-server
Replace XXXX
and XXX
with your actual Unleash API URL and authentication token.
Here's an example conversation with an AI assistant like Claude in Cursor:
You: Show me all the feature flags in the 'dashboard' project
Claude: I'll fetch all the feature flags in the 'dashboard' project for you.
[Claude uses the getFeatures tool with projectId='dashboard']
Claude: Here are all the feature flags in the 'website' project:
- new-homepage (type: release)
- dark-mode (type: experiment)
- beta-footer (type: operational)
...
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.