Skip to main content
Glama
IPI Provisioner MCP Server

IPI Provisioner MCP Server

Official

IPI Provisioner MCP Server

An MCP (Model Context Protocol) server for OpenShift Baremetal IPI (Installer-Provisioned Infrastructure) cluster provisioning. This tool helps you generate, validate, and manage install-config.yaml files, test BMC connectivity, validate network configurations, and guide you through the cluster installation process.

Features

  • Install Config Management: Generate and validate install-config.yaml files

  • BMC Testing: Test Redfish/IPMI BMC connectivity

  • Network Validation: Validate CIDR ranges, VIPs, and DNS configuration

  • Cluster Lifecycle: Extract installer, create manifests, and manage installations

  • Templates: Pre-built templates for Compact and HA deployments

Related MCP server: ocp-mcp

Architecture

ipi-provisioner-mcp/
├── mcp_server/
│   ├── config.py              # Configuration and environment variables
│   ├── main.py                # FastMCP server setup
│   ├── models/                # Pydantic data models
│   │   ├── install_config.py  # InstallConfig models
│   │   ├── baremetal.py       # Baremetal host models
│   │   └── network.py         # Network configuration models
│   ├── services/              # Business logic
│   │   ├── validation_service.py   # Config validation
│   │   ├── bmc_service.py          # BMC operations
│   │   ├── network_service.py      # Network validation
│   │   └── openshift_service.py    # Installer operations
│   ├── tools/                 # MCP tool implementations
│   │   ├── config_tools.py    # Config generation/validation
│   │   ├── bmc_tools.py       # BMC testing
│   │   ├── network_tools.py   # Network validation
│   │   └── cluster_tools.py   # Cluster lifecycle
│   └── utils/                 # Utilities
│       ├── yaml_handler.py    # YAML operations
│       └── templates.py       # Template management
├── templates/                 # Install-config templates
│   ├── baremetal-ipi-compact.yaml
│   └── baremetal-ipi-ha.yaml
└── tests/                     # Unit tests

Available MCP Tools

Config Generation & Validation (6 tools)

  1. validate_install_config - Validate install-config.yaml content

  2. generate_install_config - Generate install-config.yaml from parameters

  3. get_config_template - Get a pre-built template

  4. list_config_templates - List all available templates

  5. create_baremetal_host_entry - Create a host entry for install-config

BMC Operations (4 tools)

  1. test_bmc_connection - Test single BMC connectivity (Redfish)

  2. validate_bmc_addresses - Validate multiple BMC addresses

  3. parse_bmc_address - Parse and validate BMC address format

  4. generate_bmc_test_script - Generate bash script for BMC testing

Network Validation (8 tools)

  1. validate_network_cidr - Validate CIDR notation

  2. check_ip_in_network - Check if IP is in CIDR range

  3. check_network_overlap - Check if two networks overlap

  4. validate_vip_configuration - Validate VIP configuration

  5. generate_dns_config - Generate DNS records for cluster

  6. calculate_cluster_network_capacity - Calculate pod network capacity

  7. generate_network_diagram - Generate network diagram

  8. validate_complete_network_config - Comprehensive network validation

Cluster Lifecycle (6 tools)

  1. check_installer_binary - Check if openshift-install exists

  2. extract_openshift_installer - Extract installer from release image

  3. create_installation_manifests - Create Kubernetes manifests

  4. prepare_cluster_installation - Prepare installation command

  5. prepare_cluster_destroy - Prepare cluster destroy command

  6. get_installation_status - Get installation status

  7. get_installation_logs - Get installation logs

Installation

cd /Users/jhajyahy/mcp/ipi-provisioner-mcp
uv sync  # Creates venv and installs dependencies
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

Configuration

Environment Variables (Optional)

# OpenShift Configuration
export OPENSHIFT_RELEASE_IMAGE="quay.io/openshift-release-dev/ocp-release:4.17.0-x86_64"
export PULL_SECRET_PATH="$HOME/pull-secret.json"
export SSH_KEY_PATH="$HOME/.ssh/id_rsa.pub"

# MCP Transport (default: stdio)
export MCP_TRANSPORT="stdio"  # or "sse" for web-based integration
export MCP_HOST="127.0.0.1"   # for sse transport
export MCP_PORT="8000"         # for sse transport

MCP Client Configuration

Claude Desktop / Cursor IDE

Add to your ~/.config/claude-desktop/mcp.json or ~/.cursor/mcp.json:

{
  "mcpServers": {
    "ipi-provisioner": {
      "command": "uv",
      "args": ["run", "python", "/Users/jhajyahy/mcp/ipi-provisioner-mcp/main.py"],
      "description": "IPI Cluster Provisioning Assistant for OpenShift Baremetal",
      "env": {
        "OPENSHIFT_RELEASE_IMAGE": "quay.io/openshift-release-dev/ocp-release:4.17.0-x86_64",
        "PULL_SECRET_PATH": "/path/to/pull-secret.json",
        "SSH_KEY_PATH": "/path/to/id_rsa.pub"
      }
    }
  }
}

Usage Examples

1. List Available Templates

User: List available install-config templates

Response shows Compact and HA templates with descriptions.

2. Generate Install Config

User: Generate an install-config for a 3-master HA cluster named 'prod-cluster'
with base domain 'example.com', API VIP 192.168.1.10, Ingress VIP 192.168.1.11

3. Validate Install Config

User: Validate this install-config.yaml:
[paste your config]

Returns validation errors, warnings, and a summary.

4. Test BMC Connectivity

User: Test BMC connection to redfish://192.168.1.100 with username admin and password secret

5. Validate Network Configuration

User: Validate network config with cluster CIDR 10.128.0.0/14, service CIDR 172.30.0.0/16,
machine CIDR 192.168.1.0/24, API VIP 192.168.1.10, Ingress VIP 192.168.1.11

6. Generate DNS Configuration

User: Generate DNS config for cluster 'ocp' with base domain 'example.com',
API VIP 192.168.1.10, Ingress VIP 192.168.1.11, and hosts:
- master-0 with IP 192.168.1.20
- master-1 with IP 192.168.1.21
- master-2 with IP 192.168.1.22

This will generate A and PTR records for all cluster components including the API VIP, Ingress VIP, and all hosts.

7. Extract OpenShift Installer

User: Extract openshift-install from release image
quay.io/openshift-release-dev/ocp-release:4.17.0-x86_64

8. Check Installation Status

User: Get installation status for /path/to/install-dir

Common Workflows

Workflow 1: Validate Existing Config

  1. Validate config: validate_install_config(yaml_content)

  2. Validate networks: validate_complete_network_config(...)

  3. Validate BMCs: validate_bmc_addresses(hosts)

  4. Generate DNS config: generate_dns_config(...)

Workflow 2: Troubleshoot Installation

  1. Check status: get_installation_status(install_dir)

  2. Get logs: get_installation_logs(install_dir, lines=100)

  3. Validate network: validate_complete_network_config(...)

  4. Test BMCs: validate_bmc_addresses(hosts)

Testing

Run the test suite:

uv run pytest tests/ -v

Templates

Available Templates

  1. baremetal-ipi-compact.yaml - Compact Cluster

    • 3 master nodes (also act as workers)

    • Requires API and Ingress VIPs

    • Good for resource-constrained environments

  2. baremetal-ipi-ha.yaml - High Availability

    • 3 master nodes

    • 2+ dedicated worker nodes

    • Requires API and Ingress VIPs

    • Production-ready configuration

Network Requirements

Machine Network

  • Physical network for baremetal hosts

  • Contains API VIP and Ingress VIP (for HA)

  • Example: 192.168.1.0/24

Cluster Network (Pod Network)

  • Virtual network for pod-to-pod communication

  • Example: 10.128.0.0/14

  • Each node gets a /23 subnet (510 IPs per node)

Service Network

  • Virtual network for Kubernetes services

  • Example: 172.30.0.0/16

DNS Requirements (HA/Compact)

A Records

  • api.<cluster_name>.<base_domain> → API VIP

  • *.apps.<cluster_name>.<base_domain> → Ingress VIP (wildcard)

  • <hostname>.<base_domain> → Host IP (for each cluster node)

PTR Records (Reverse DNS)

  • API VIP → api.<cluster_name>.<base_domain>

  • Each host IP → <hostname>.<base_domain>

Example for cluster 'ocp' with domain 'example.com':

# A Records
api.ocp.example.com.        A    10.1.235.200
*.apps.ocp.example.com.     A    10.1.235.201
master-0.example.com.       A    10.1.235.25
master-1.example.com.       A    10.1.235.26
master-2.example.com.       A    10.1.235.27

# PTR Records
200.235.1.10.in-addr.arpa.  PTR  api.ocp.example.com.
25.235.1.10.in-addr.arpa.   PTR  master-0.example.com.
26.235.1.10.in-addr.arpa.   PTR  master-1.example.com.
27.235.1.10.in-addr.arpa.   PTR  master-2.example.com.

BMC Requirements

Supported BMC Types

  • Redfish (recommended)

  • Redfish Virtual Media

  • IPMI

  • iDRAC Virtual Media

BMC Address Format

  • Redfish: redfish://192.168.1.100 or redfish+https://192.168.1.100:443

  • IPMI: ipmi://192.168.1.100

Troubleshooting

Common Issues

  1. BMC Connection Failures

    • Use test_bmc_connection to verify connectivity

    • Check BMC credentials

    • Verify network connectivity to BMC

  2. Network Validation Errors

    • Use validate_complete_network_config to check for overlaps

    • Ensure VIPs are in machine network range

    • Verify DNS is configured correctly

  3. Installation Failures

    • Use get_installation_logs to check logs

    • Verify all BMCs are reachable

    • Check network configuration

    • Ensure DNS records exist (for HA)

Contributing

Contributions are welcome! Please ensure:

  • All tests pass: uv run pytest tests/ -v

  • Code follows existing patterns

  • Add tests for new functionality

License

Apache 2.0


Built for OpenShift Metal Platform Team

Available Tools

24 tools
calculate_cluster_network_capacityA

Calculate cluster network capacity.

Args: cluster_cidr: Cluster network CIDR (e.g., '10.128.0.0/14') host_prefix: Host prefix - subnet size per node (e.g., 23)

Returns: Capacity calculations (max nodes, IPs per node, etc.)

Inputs: host_prefix (required), cluster_cidr (required). Returns: object

check_installer_binaryA

Check if openshift-install binary is available.

Args: install_dir: Optional installation directory to check for local binary

Returns: Binary existence check results

Inputs: install_dir. Returns: object

check_ip_in_networkB

Check if an IP address is within a CIDR range.

Args: ip_address: IP address to check cidr: CIDR range

Returns: Check result

Inputs: cidr (required), ip_address (required). Returns: object

check_network_overlapB

Check if two networks overlap.

Args: cidr1: First CIDR cidr2: Second CIDR

Returns: Overlap check result

Inputs: cidr1 (required), cidr2 (required). Returns: object

create_baremetal_host_entryA

Create a baremetal host entry for install-config.yaml.

Args: name: Host name (e.g., 'master-0') role: Host role ('master' or 'worker') bmc_address: BMC address (e.g., 'redfish://192.168.1.100') bmc_username: BMC username bmc_password: BMC password boot_mac_address: Boot MAC address (e.g., 'aa:bb:cc:dd:ee:ff') root_device_hint: Optional root device hint (e.g., '/dev/sda' or 'wwn')

Returns: Host configuration dictionary ready for install-config.yaml

Inputs: name (required), role (required), bmc_address (required), bmc_password (required), +3 more. Returns: object

create_installation_manifestsA

Create Kubernetes manifests from install-config.yaml.

Args: install_dir: Installation directory containing install-config.yaml installer_path: Path to openshift-install binary (default: 'openshift-install')

Returns: Manifest creation results

Inputs: install_dir (required), installer_path. Returns: object

extract_openshift_installerA

Extract openshift-install binary from a release image.

Args: release_image: OpenShift release image URL (e.g., 'quay.io/openshift-release-dev/ocp-release:4.17.0-x86_64') output_dir: Directory to extract installer to (default: current directory)

Returns: Extraction results and next steps

Inputs: release_image (required), output_dir. Returns: object

generate_bmc_test_scriptB

Generate a bash script to test BMC connectivity for multiple hosts.

Args: hosts: List of host configurations with BMC details

Returns: Bash script for testing BMC connectivity

Inputs: hosts (required). Returns: object

generate_dns_configA

Generate DNS configuration for the cluster.

Args: cluster_name: Cluster name base_domain: Base domain api_vip: API VIP address ingress_vip: Ingress VIP address hosts: Optional JSON string of hosts list. Each host should have 'name' and 'ip' keys. Example: '[{"name": "master-0", "ip": "10.1.235.25"}, {"name": "master-1", "ip": "10.1.235.26"}]'

Returns: Required DNS records and validation commands including A and PTR records for hosts

Inputs: api_vip (required), base_domain (required), ingress_vip (required), cluster_name (required), +1 more. Returns: object

generate_install_configA

Generate an install-config.yaml for baremetal IPI.

Args: cluster_name: Name of the cluster base_domain: Base domain (e.g., example.com) pull_secret: Pull secret content (JSON string) ssh_key: SSH public key content api_vip: API VIP address ingress_vip: Ingress VIP address hosts: List of baremetal hosts with BMC configuration machine_network_cidr: Machine network CIDR (default: 192.168.1.0/24) cluster_network_cidr: Cluster network CIDR (default: 10.128.0.0/14) service_network_cidr: Service network CIDR (default: 172.30.0.0/16) network_type: Network type (default: OVNKubernetes) control_plane_replicas: Number of master nodes (default: 3) worker_replicas: Number of worker nodes (default: 0)

Returns: Generated install-config as dictionary and YAML string

Inputs: hosts (required), api_vip (required), ssh_key (required), base_domain (required), +9 more. Returns: object

generate_network_diagramA

Generate a network diagram for the cluster.

Args: cluster_cidr: Cluster (pod) network CIDR service_cidr: Service network CIDR machine_cidr: Machine network CIDR api_vip: API VIP ingress_vip: Ingress VIP

Returns: Network diagram

Inputs: api_vip (required), ingress_vip (required), cluster_cidr (required), machine_cidr (required), +1 more. Returns: object

get_config_templateA

Get an install-config template.

Args: template_name: Template name (e.g., 'baremetal-ipi-compact', 'baremetal-ipi-ha')

Returns: Template content and metadata

Inputs: template_name (required). Returns: object

get_installation_logsA

Get recent installation log entries.

Args: install_dir: Installation directory lines: Number of recent lines to retrieve (default: 50)

Returns: Recent log entries

Inputs: install_dir (required), lines. Returns: object

get_installation_statusB

Get cluster installation status.

Args: install_dir: Installation directory

Returns: Installation status and progress

Inputs: install_dir (required). Returns: object

list_config_templatesA

List all available install-config templates.

Returns: List of templates with descriptions

Inputs: no named parameters. Returns: object

parse_bmc_addressA

Parse and validate BMC address format.

Args: bmc_address: BMC address (e.g., 'redfish://192.168.1.100:443')

Returns: Parsed BMC address components

Inputs: bmc_address (required). Returns: object

prepare_cluster_destroyA

Prepare cluster destroy command.

This tool provides the command to destroy the cluster. Use with caution - this will delete the entire cluster!

Args: install_dir: Installation directory installer_path: Path to openshift-install binary (default: 'openshift-install')

Returns: Destroy command and information

Inputs: install_dir (required), installer_path. Returns: object

prepare_cluster_installationA

Prepare cluster installation command.

This tool doesn't actually start the installation (which can take 30-60 minutes), but provides the command to run.

Args: install_dir: Installation directory installer_path: Path to openshift-install binary (default: 'openshift-install') log_level: Log level (debug, info, warn, error)

Returns: Installation command and information

Inputs: install_dir (required), log_level, installer_path. Returns: object

test_bmc_connectionA

Test BMC connectivity (Redfish).

Args: bmc_address: BMC address (e.g., 'redfish://192.168.1.100' or 'redfish+https://192.168.1.100') username: BMC username password: BMC password verify_ssl: Whether to verify SSL certificates (default: False)

Returns: Connection test results

Inputs: password (required), username (required), bmc_address (required), verify_ssl. Returns: object

validate_bmc_addressesA

Validate BMC addresses for multiple hosts.

Args: hosts: List of host configurations with BMC details Each host should have: name, bmc.address, bmc.username, bmc.password

Returns: Validation results for all hosts

Inputs: hosts (required). Returns: object

validate_complete_network_configA

Validate complete network configuration for overlaps and validity.

Args: cluster_cidr: Cluster network CIDR service_cidr: Service network CIDR machine_cidr: Machine network CIDR api_vip: Optional API VIP (required for HA) ingress_vip: Optional Ingress VIP (required for HA)

Returns: Comprehensive validation results

Inputs: cluster_cidr (required), machine_cidr (required), service_cidr (required), api_vip, +1 more. Returns: object

validate_install_configA

Validate an install-config.yaml file.

Args: config_yaml: The install-config.yaml content as a string

Returns: Validation results with errors and summary

Inputs: config_yaml (required). Returns: object

validate_network_cidrA

Validate CIDR notation.

Args: cidr: CIDR string (e.g., '192.168.1.0/24')

Returns: Validation result

Inputs: cidr (required). Returns: object

validate_vip_configurationC

Validate VIP (Virtual IP) configuration.

Args: api_vip: API VIP address ingress_vip: Ingress VIP address machine_network_cidr: Machine network CIDR

Returns: Validation results

Inputs: api_vip (required), ingress_vip (required), machine_network_cidr (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 24 tools

    Disambiguation4/5

    Tools are mostly distinct, each targeting a specific task like config generation, BMC testing, network validation, or installer commands. However, test_bmc_connection and validate_bmc_addresses could be confused, though one is a live test and the other validates multiple host BMC details.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with lowercase and underscores, such as list_config_templates, generate_install_config, validate_vip_configuration, and get_installation_logs. The verbs vary but the pattern is uniformly applied.

    Tool Count4/5

    24 tools is on the higher end but reasonable for the complex IPI provisioning domain, covering templates, BMC, network, and installer utilities. Some tools like parse_bmc_address and validate_network_cidr are granular, but the count is not excessive for the scope.

    Completeness4/5

    The tool surface covers the main lifecycle stages: config generation and validation, BMC connectivity, network checks, DNS generation, manifest creation, installation preparation, status, logs, and destroy commands. A minor gap is that actual installation execution is not performed (only the command is provided), but this is a reasonable design choice.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Oracle Cloud Infrastructure (OCI) that provides tools to manage Compute, Object Storage, Block Storage, Networking, Autonomous Database, and IAM via the official OCI SDK.
      23
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for bare-metal lab operations, enabling inventory, commissioning, deployment, fabric audit, and job scheduling via Hermes agent skills and a tool server.
      Apache 2.0