Flux GitOps MCP server

Provides a bridge between Kubernetes GitOps operations and Flux CD ecosystem, enabling debugging, resource management, and workflow troubleshooting through specialized tools for log retrieval, reconciliation, and cluster context switching.
Back to servers
Setup instructions
Provider
Control Plane
Release date
May 15, 2025
Language
Python
Stats
323 stars

The Flux Operator is a Kubernetes controller that manages the lifecycle of CNCF Flux CD and the ControlPlane enterprise distribution. It extends Flux with self-service capabilities, deployment windows, and preview environments for testing pull requests from various Git platforms.

Features

Autopilot for Flux CD

The operator automates the installation, configuration, and upgrade of Flux controllers based on a declarative API, removing the operational burden of managing Flux across multiple clusters.

Advanced Configuration

Simplifies configuration of Flux multi-tenancy lockdown, sharding, scaling, persistent storage, and allows fine-tuning controllers with Kustomize patches. It streamlines the transition from Git to OCI artifacts and S3-compatible storage.

Deep Insights

Provides detailed reports and Prometheus metrics about Flux controllers' readiness status, reconcilers statistics, and cluster state synchronization.

Self-Service Environments

The ResourceSet API enables platform teams to define application standards as groups of resources that can be deployed as a single unit on self-service environments, with pull request integration for ephemeral testing environments.

AI-Assisted GitOps

The Flux MCP Server connects AI assistants to Kubernetes clusters, enabling natural language interaction for analyzing deployments, troubleshooting issues, and performing operations.

Installation Guide

Install the Flux Operator

Install the Flux Operator in the flux-system namespace using Helm:

helm install flux-operator oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator \
  --namespace flux-system

Install the Flux Controllers

Create a FluxInstance resource to install the latest Flux stable version:

apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
metadata:
  name: flux
  namespace: flux-system
  annotations:
    fluxcd.controlplane.io/reconcileEvery: "1h"
    fluxcd.controlplane.io/reconcileArtifactEvery: "10m"
    fluxcd.controlplane.io/reconcileTimeout: "5m"
spec:
  distribution:
    version: "2.x"
    registry: "ghcr.io/fluxcd"
    artifact: "oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests"
  components:
    - source-controller
    - kustomize-controller
    - helm-controller
    - notification-controller
    - image-reflector-controller
    - image-automation-controller
  cluster:
    type: kubernetes
    multitenant: false
    networkPolicy: true
    domain: "cluster.local"
  kustomize:
    patches:
      - target:
          kind: Deployment
          name: "(kustomize-controller|helm-controller)"
        patch: |
          - op: add
            path: /spec/template/spec/containers/0/args/-
            value: --concurrent=10
          - op: add
            path: /spec/template/spec/containers/0/args/-
            value: --requeue-dependency=5s

Usage Guide

Sync from a Git Repository

To sync your cluster state from a Git repository, add the following configuration to your FluxInstance:

apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
metadata:
  name: flux
  namespace: flux-system
spec:
  sync:
    kind: GitRepository
    url: "https://github.com/my-org/my-fleet.git"
    ref: "refs/heads/main"
    path: "clusters/my-cluster"
    pullSecret: "flux-system"
  # distribution omitted for brevity

For private repositories, create a Kubernetes secret with your credentials:

flux create secret git flux-system \
  --url=https://github.com/my-org/my-fleet.git \
  --username=git \
  --password=$GITHUB_TOKEN

Monitor the Flux Installation

Check the FluxReport resource to monitor the deployment status:

kubectl get fluxreport/flux -n flux-system -o yaml

The report is updated regularly and contains information about deployment readiness, distribution details, reconciler statistics, CRD versions, and sync status.

Working with ResourceSets

The ResourceSet APIs provide a high-level abstraction for managing Flux resources and Kubernetes objects as a single unit. They simplify GitOps workflows and enable self-service for developers and platform teams.

Key capabilities include:

  • Application definitions as templated resources
  • Time-based delivery with deployment windows
  • Ephemeral environments for testing GitHub pull requests
  • Ephemeral environments for testing GitLab merge requests

For detailed configuration examples and additional usage information, visit the ResourceSets documentation.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "flux-operator" '{"command":"npx","args":["-y","@controlplane/flux-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "flux-operator": {
            "command": "npx",
            "args": [
                "-y",
                "@controlplane/flux-mcp-server"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "flux-operator": {
            "command": "npx",
            "args": [
                "-y",
                "@controlplane/flux-mcp-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later