Skip to content

A MCP server for operator-controller (OLM v1), providing AI assistants with the ability to interact with OLM v1 resources and migrate from OLM v0 to v1.

Notifications You must be signed in to change notification settings

anik120/olmv1-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OLM v1 MCP Server

A Model Context Protocol (MCP) server for Operator Lifecycle Manager (OLM) v1, providing AI assistants with the ability to interact with OLM v1 resources and migrate from OLM v0 to v1.

Overview

The OLM v1 MCP Server exposes OLM v1-specific resources and operations through the Model Context Protocol, allowing AI assistants to help users manage operators using the new OLM v1 architecture. This server provides tools for managing ClusterExtensions, ClusterCatalogs, and includes powerful migration capabilities to help users transition from OLM v0 to v1.

Features

  • ClusterExtension Operations: List, get, create, update, and delete ClusterExtensions
  • ClusterCatalog Operations: List and inspect ClusterCatalogs
  • Migration Tools: Plan, validate, and execute migrations from OLM v0 to v1
  • MCP Protocol Support: Standard stdio-based MCP communication
  • Read-only Mode: Safe operation with no write capabilities by default
  • Migration Validation: Pre-migration checks and dry-run capabilities

Available Tools

ClusterExtension Tools

  • list_cluster_extensions: List ClusterExtensions in the cluster
  • get_cluster_extension: Get detailed information about a specific ClusterExtension
  • create_cluster_extension: Create a new ClusterExtension
  • update_cluster_extension: Update an existing ClusterExtension (channel/version)
  • delete_cluster_extension: Delete a ClusterExtension

ClusterCatalog Tools

  • list_cluster_catalogs: List ClusterCatalogs in the cluster
  • get_cluster_catalog: Get detailed information about a specific ClusterCatalog

Migration Tools

  • plan_migration: Plan migration from OLM v0 Subscriptions to v1 ClusterExtensions
  • validate_migration: Validate migration readiness and cluster state
  • execute_migration: Execute the migration (with dry-run support)

Installation

From Source

git clone https://github.com/operator-framework/olmv1-mcp-server.git
cd olmv1-mcp-server
make build

Usage

Basic Usage

# Start the server (stdio mode for MCP clients)
./bin/olmv1-mcp-server

# Use a specific kubeconfig
./bin/olmv1-mcp-server --kubeconfig /path/to/kubeconfig

# Enable write operations (disabled by default for safety)
./bin/olmv1-mcp-server --read-only=false

# Enable only specific toolsets
./bin/olmv1-mcp-server --toolsets clusterextension,migration

Command Line Options

  • --kubeconfig: Path to kubeconfig file (default: $HOME/.kube/config)
  • --read-only: Prevent write operations (default: true)
  • --toolsets: Enable specific toolsets (default: clusterextension,clustercatalog,migration)

Migration from OLM v0 to v1

This server's key feature is helping users migrate from OLM v0 (Subscriptions) to OLM v1 (ClusterExtensions).

Migration Workflow

  1. Validate Migration Readiness

    validate_migration --namespace=<namespace>
    

    This checks that both OLM v0 and v1 are accessible, ClusterCatalogs are available, etc.

  2. Plan the Migration

    plan_migration --namespace=<namespace>
    

    This analyzes existing Subscriptions and shows what ClusterExtensions will be created.

  3. Execute Migration (Dry Run)

    execute_migration --namespace=<namespace> --dryRun=true
    

    This shows what would happen without making changes.

  4. Execute Migration

    execute_migration --namespace=<namespace>
    

    This creates ClusterExtensions based on existing Subscriptions.

Migration Process

The migration process:

  1. Discovers all Subscriptions in the specified namespace
  2. Maps OLM v0 CatalogSources to OLM v1 ClusterCatalogs
  3. Creates corresponding ClusterExtensions with appropriate settings
  4. Preserves package, channel, and version information
  5. Adds migration annotations for tracking

Important Notes

  • Backup First: Always backup your OLM v0 resources before migration
  • Test Environment: Test the migration in a non-production environment first
  • Service Accounts: Ensure appropriate ServiceAccounts exist with necessary RBAC permissions
  • Manual Cleanup: After successful migration and validation, manually remove old Subscriptions
  • Read-Only Mode: The server runs in read-only mode by default for safety

Claude Desktop Integration

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "olmv1": {
      "command": "/path/to/olmv1-mcp-server/bin/olmv1-mcp-server"
    }
  }
}

Security Considerations

  • Read-only by default: The server operates in read-only mode by default
  • Migration safety: Migration includes validation and dry-run capabilities
  • Cluster access: Requires valid Kubernetes credentials with appropriate RBAC permissions
  • No authentication: The stdio server does not implement authentication (intended for local use)

Development

Prerequisites

  • Go 1.24.4 or later
  • Access to a Kubernetes cluster with OLM v1 installed
  • kubectl configured for cluster access
  • For migration features: OLM v0 also installed

Building

# Download dependencies
make deps

# Build the binary
make build

# Run tests
make test

# Format code
make fmt

# Run linter
make lint

Examples

Creating a ClusterExtension

create_cluster_extension \
  --name=my-operator \
  --namespace=default \
  --packageName=my-package \
  --serviceAccount=my-service-account \
  --channel=stable \
  --catalog=operatorhub

Migration Example

# Check if migration is possible
validate_migration --namespace=operators

# See what will be migrated
plan_migration --namespace=operators

# Perform dry run
execute_migration --namespace=operators --dryRun=true

# Execute migration
execute_migration --namespace=operators

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Related Projects

About

A MCP server for operator-controller (OLM v1), providing AI assistants with the ability to interact with OLM v1 resources and migrate from OLM v0 to v1.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published