IPI Provisioner MCP Server
An MCP server for OpenShift Baremetal IPI cluster provisioning, allowing users to generate and validate install-config.yaml files, test BMC connectivity, validate networks, and manage cluster installation lifecycle.
README
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
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)
validate_install_config- Validate install-config.yaml contentgenerate_install_config- Generate install-config.yaml from parametersget_config_template- Get a pre-built templatelist_config_templates- List all available templatescreate_baremetal_host_entry- Create a host entry for install-config
BMC Operations (4 tools)
test_bmc_connection- Test single BMC connectivity (Redfish)validate_bmc_addresses- Validate multiple BMC addressesparse_bmc_address- Parse and validate BMC address formatgenerate_bmc_test_script- Generate bash script for BMC testing
Network Validation (8 tools)
validate_network_cidr- Validate CIDR notationcheck_ip_in_network- Check if IP is in CIDR rangecheck_network_overlap- Check if two networks overlapvalidate_vip_configuration- Validate VIP configurationgenerate_dns_config- Generate DNS records for clustercalculate_cluster_network_capacity- Calculate pod network capacitygenerate_network_diagram- Generate network diagramvalidate_complete_network_config- Comprehensive network validation
Cluster Lifecycle (6 tools)
check_installer_binary- Check if openshift-install existsextract_openshift_installer- Extract installer from release imagecreate_installation_manifests- Create Kubernetes manifestsprepare_cluster_installation- Prepare installation commandprepare_cluster_destroy- Prepare cluster destroy commandget_installation_status- Get installation statusget_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
- Validate config:
validate_install_config(yaml_content) - Validate networks:
validate_complete_network_config(...) - Validate BMCs:
validate_bmc_addresses(hosts) - Generate DNS config:
generate_dns_config(...)
Workflow 2: Troubleshoot Installation
- Check status:
get_installation_status(install_dir) - Get logs:
get_installation_logs(install_dir, lines=100) - Validate network:
validate_complete_network_config(...) - Test BMCs:
validate_bmc_addresses(hosts)
Testing
Run the test suite:
uv run pytest tests/ -v
Templates
Available Templates
-
baremetal-ipi-compact.yaml - Compact Cluster
- 3 master nodes (also act as workers)
- Requires API and Ingress VIPs
- Good for resource-constrained environments
-
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.100orredfish+https://192.168.1.100:443 - IPMI:
ipmi://192.168.1.100
Troubleshooting
Common Issues
-
BMC Connection Failures
- Use
test_bmc_connectionto verify connectivity - Check BMC credentials
- Verify network connectivity to BMC
- Use
-
Network Validation Errors
- Use
validate_complete_network_configto check for overlaps - Ensure VIPs are in machine network range
- Verify DNS is configured correctly
- Use
-
Installation Failures
- Use
get_installation_logsto check logs - Verify all BMCs are reachable
- Check network configuration
- Ensure DNS records exist (for HA)
- Use
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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。