fleet-mcp

rossella/fleet-mcp

3.2

If you are the rightful owner of fleet-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Fleet MCP Server is a Model Context Protocol server that facilitates interaction between AI assistants and Fleet's GitOps capabilities.

Tools
23
Resources
0
Prompts
0

Fleet MCP Server

Model Context Protocol (MCP) server for Fleet that enables AI assistants to interact with Fleet's GitOps capabilities.

Prerequisites

  • Go 1.21 or later (required by MCP SDK)
  • Kubernetes cluster with Fleet installed
  • Access credentials (kubeconfig or Rancher token)

Overview

This MCP server exposes Fleet resources (GitRepos, Bundles, BundleDeployments, Clusters, ClusterGroups) and operations through MCP tools, allowing AI assistants to:

  • Query GitRepo status and deployments
  • List and inspect Bundles and BundleDeployments
  • Manage Fleet resources (create, update, delete)
  • Diagnose deployment issues
  • Monitor cluster health

Architecture

The server follows the architecture patterns from rancher-ai-mcp:

  • MCP Server: HTTP handler with SSE streaming support
  • Tools: Fleet-specific operations implemented as MCP tools
  • Client: Kubernetes dynamic client wrapper
  • Converter: Maps Fleet resource kinds to GroupVersionResources
  • Response: Formats responses for LLM and UI consumption

Authentication

The server uses Rancher token authentication:

  • R_token: Rancher bearer token (required)
  • R_url: Rancher server URL (required)

Tools

Read Operations

  • listGitRepos - List GitRepos in a namespace
  • getGitRepo - Get specific GitRepo details
  • getGitRepoStatus - Get GitRepo deployment status
  • listBundles - List Bundles
  • getBundle - Get Bundle details
  • getBundleDeployments - List BundleDeployments for a Bundle
  • listClusters - List managed clusters
  • getCluster - Get cluster details
  • listClusterGroups - List cluster groups
  • inspectGitRepo - Deep inspection with related resources

Write Operations

  • createGitRepo - Create new GitRepo
  • updateGitRepo - Update GitRepo spec
  • patchGitRepo - Patch GitRepo with JSON patch
  • deleteGitRepo - Delete GitRepo
  • pauseGitRepo - Pause/unpause GitRepo
  • forceSyncGitRepo - Force GitRepo redeployment
  • updateBundleTarget - Modify Bundle targets
  • pauseCluster - Pause/unpause cluster
  • createClusterGroup - Create cluster group
  • deleteClusterGroup - Delete cluster group

Diagnostic Operations

  • getGitRepoEvents - Get events for a GitRepo
  • getBundleDeploymentDetails - Detailed BundleDeployment troubleshooting
  • getFleetAgentStatus - Check Fleet agent health

Development

# Build
go build -o fleet-mcp

# Run locally
./fleet-mcp

# Run tests
go test ./...

Deployment

The server is designed to run in a Kubernetes cluster with proper RBAC:

kubectl apply -f package/fleet-mcp.yaml

TLS Configuration

The server expects TLS certificates from Kubernetes secrets:

  • cattle-mcp-tls - Server certificate
  • cattle-mcp-ca - CA certificate

Set INSECURE_SKIP_TLS=true for development environments.