Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion config/_default/menus/main.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5481,11 +5481,16 @@ menu:
parent: software_delivery_heading
identifier: feature_flags
weight: 80000
- name: MCP Server
url: feature_flags/feature_flag_mcp_server
parent: feature_flags
identifier: feature_flags_mcp_server
weight: 8
- name: Guides
url: feature_flags/guide
parent: feature_flags
identifier: feature_flags_guide
weight: 1
weight: 9
- name: Observability Pipelines
url: observability_pipelines/
pre: pipelines
Expand Down
115 changes: 115 additions & 0 deletions content/en/feature_flags/feature_flag_mcp_server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
title: Feature Flags MCP Server
description: "Learn how to use the Feature Flags toolset in the Datadog MCP Server"
further_reading:
- link: "getting_started/feature_flags"
tag: "Documentation"
text: "Getting Started with Feature Flags"
- link: "bits_ai/mcp_server"
tag: "Documentation"
text: "Datadog MCP Server"
---

{{< callout url="http://datadoghq.com/product-preview/feature-flags/" >}}
Feature Flags are in Preview. Complete the form to request access.
{{< /callout >}}

## Overview

The Datadog MCP Server uses the Model Context Protocol (MCP) to provide AI agents with access to [Feature Flags][1] management capabilities, including flag creation, configuration, and React/JavaScript integration guidance.

## Setup

The following configurations give your AI agent access to the Feature Flags toolset in the Datadog MCP Server. You must restart your agent after performing this setup.

For all clients, install the MCP Server binary:

```bash
curl -sSL https://coterm.datadoghq.com/mcp-cli/install.sh | bash
```

Then follow the instructions below to add the MCP Server to your specific client.

### Claude Code

```bash
claude mcp add datadog -- ~/.local/bin/datadog_mcp_cli --endpoint-path /api/unstable/mcp-server/mcp?toolsets=feature-flags
```

### Cursor
Add this to `~/.cursor/mcp.json` (remember to save the file):

```json
{
"mcpServers": {
"datadog-ff": {
"type": "stdio",
"command": "~/.local/bin/datadog_mcp_cli --endpoint-path /api/unstable/mcp-server/mcp?toolsets=feature-flags",
"args": [],
"env": {}
}
}
}
```

## Use cases

The MCP Server includes tools to help you manage feature flags in your codebase. The following use cases provide sample prompts for using the tools.

<div class="alert alert-info">
The MCP Server only supports React applications.
</div>

### Create feature flags

Use the `create-feature-flag` tool to create feature flags. You do not need to specify the tool name in the prompt, but it can provide more consistent results.
The MCP Server has access to Datadog's documentation and uses it to implement the flag in your codebase.

If you do not yet have feature flags implemented, mention in the prompt that you want to implement Datadog feature flags.

Example prompts:
- Use the `create-feature-flag` tool to create a flag to control the title on the main page.
- I want to show a confirmation modal when `<SOME_EVENT>` happens. Use a Datadog feature flag to control whether the confirmation modal is shown.

### Check feature flag implementation

Use the `check-flag-implementation` tool to check if a feature flag is implemented correctly.

The tool checks that the flag is being referenced as the correct value type, is passing the correct subject attributes, and is providing the correct default value that agrees with the default in production environments.

Example prompts:
- Check if the `show-confirmation-modal` flag is implemented correctly.
- Check if all feature flags in `/some/directory` are implemented correctly.

**Note**: This may not find all issues. Checking flags individually is more reliable.

This tool can also be used to add feature flags created in the UI to your codebase. For example:

- Use the `show-confirmation-modal` flag to control whether the confirmation modal is shown when `<SOME_EVENT>` happens.

### List feature flags

Use the `list-feature-flags` tool to list all feature flags. For example:

- List all feature flags.

### List environments

Use the `list-environments` tool to list all environments. For example:

- List my flagging environments.

### Update feature flag environments
Use the `update-feature-flag-environment` tool to update a feature flag environment. This tool can control the default variants, and enable or disable the flag.
It cannot modify flags in production environments.

Example prompts:

- I want `show-confirmation-modal` to serve true in development.
- Disable `show-confirmation-modal` in staging.

## Further reading

{{< partial name="whats-next/whats-next.html" >}}

[1]: /feature_flags/
1 change: 1 addition & 0 deletions content/en/feature_flags/guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ Feature Flags are in Preview. Complete the form to request access.
{{< /callout >}}

{{< whatsnext desc="Feature Flags Guides:" >}}
{{< nextlink href="/getting_started/feature_flags" >}}Getting started with Feature Flags{{< /nextlink >}}
{{< nextlink href="/feature_flags/guide/migrate_from_statsig" >}}Migrate Your Feature Flags from Statsig{{< /nextlink >}}
{{< /whatsnext >}}
Loading