dprince/openstack-k8s-mcp
If you are the rightful owner of openstack-k8s-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 OpenStack K8s MCP is a Model Context Protocol server designed to facilitate interaction with OpenStack Kubernetes operators, providing MCP-compatible access to OpenStackVersion CRDs within a Kubernetes cluster.
OpenStack K8s MCP
A Model Context Protocol (MCP) server for querying OpenStack Kubernetes operators. This tool provides MCP-compatible access to OpenStackVersion CRDs in your Kubernetes cluster.
Features
-
get_openstack_version: Query OpenStackVersion CRD to retrieve:
- Target version
- Available version
- Deployed version
- Status conditions
-
update_openstack_version: Patch the targetVersion and optionally customContainerImages fields of an OpenStackVersion CRD
-
wait_openstack_version: Wait for a specific condition to be met on an OpenStackVersion CRD
-
get_openstack_controlplane: Query OpenStackControlPlane CRD to retrieve spec and status information
-
verify_openstack_controlplane: Verify that all conditions on an OpenStackControlPlane CRD are in a ready state
-
create_dataplane_deployment: Create an OpenStackDataplaneDeployment CR to deploy services on dataplane nodes
-
get_dataplane_deployment: Query OpenStackDataplaneDeployment CRD to retrieve spec and status information
-
list_dataplane_deployments: List all OpenStackDataplaneDeployment CRs in a namespace
-
list_dataplane_nodesets: List all OpenStackDataplaneNodeSet CRs in a namespace
-
verify_openstack_dataplanenodesets: Verify that all conditions on all OpenStackDataplaneNodeSet CRs in a namespace are in a ready state
Prerequisites
- Go 1.22 or higher
- Access to a Kubernetes cluster with OpenStack operators installed
- Valid kubeconfig or in-cluster configuration
Installation
# Clone the repository
git clone <repository-url>
cd openstack-k8s-mcp
# Build the binary
go build -o openstack-k8s-mcp .
Usage
Running the MCP Server
The server communicates over stdio following the MCP protocol:
./openstack-k8s-mcp
MCP Tool: get_openstack_version
Query an OpenStackVersion custom resource:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackVersion CR is located. Defaults toopenstackif not provided.name(optional): Name of the OpenStackVersion CR to query. If not provided, auto-discovers the first CR in the namespace.
Returns: JSON object containing:
name: CR namenamespace: CR namespacetargetVersion: Desired OpenStack versionavailableVersion: Available versiondeployedVersion: Currently deployed versionreadyConditions: Array of condition types that are ready (status: True)notReadyConditions: Array of condition types that are not readycustomContainerImages: Custom container images (if present)
Example Response
{
"name": "openstack",
"namespace": "openstack",
"targetVersion": "0.3.0",
"availableVersion": "0.3.0",
"deployedVersion": "0.3.0",
"readyConditions": ["Ready", "Available"],
"notReadyConditions": []
}
MCP Tool: update_openstack_version
Patch the targetVersion and optionally customContainerImages fields of the first OpenStackVersion custom resource in the namespace:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackVersion CR is located. Defaults toopenstackif not provided.targetVersion(required): The target version to set for the OpenStackVersion CRcustomContainerImages(optional): Map of service names to custom container image URLs. If not provided, customContainerImages will not be modified.
Returns: JSON object containing:
name: CR namenamespace: CR namespacespec.targetVersion: Updated target OpenStack versionstatus.availableVersion: Available versionstatus.deployedVersion: Currently deployed version
Example Response
{
"name": "openstack",
"namespace": "openstack",
"spec": {
"targetVersion": "0.4.0"
},
"status": {
"availableVersion": "0.3.0",
"deployedVersion": "0.3.0"
}
}
Example Usage with customContainerImages
{
"namespace": "openstack",
"targetVersion": "0.4.0",
"customContainerImages": {
"nova": "quay.io/openstack-k8s-operators/nova-operator:v0.4.0",
"neutron": "quay.io/openstack-k8s-operators/neutron-operator:v0.4.0"
}
}
MCP Tool: wait_openstack_version
Wait for a specific condition to be met on an OpenStackVersion custom resource:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackVersion CR is located. Defaults toopenstackif not provided.name(optional): Name of the OpenStackVersion CR to wait on. If not provided, auto-discovers the first CR in the namespace.condition(required): The condition type to wait for (e.g., "Ready", "Available")timeout(optional): Maximum time to wait in seconds. Defaults to 600 seconds if not provided.pollInterval(optional): Interval in seconds between polling attempts. Defaults to 5 seconds if not provided.
Returns: JSON object containing:
name: CR namenamespace: CR namespacecondition: The condition type that was waited formet: Boolean indicating whether the condition was metmessage: Status message from the conditionreason: Reason from the condition
Example Response
{
"name": "openstack",
"namespace": "openstack",
"condition": "Ready",
"met": true,
"message": "All OpenStack components are ready",
"reason": "AllComponentsReady"
}
MCP Tool: get_openstack_controlplane
Query an OpenStackControlPlane custom resource:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackControlPlane CR is located. Defaults toopenstackif not provided.name(optional): Name of the OpenStackControlPlane CR to query. If not provided, returns the first CR found in the namespace.
Returns: JSON object containing:
name: CR namenamespace: CR namespacespec: ControlPlane specification including:- Service configurations (Nova, Neutron, Cinder, Glance, etc.)
- Database configuration
- Message queue configuration
- Other controlplane settings
status: ControlPlane status including:conditions: Array of condition objects with deployment status- Service-specific status information
- Other status fields as available
Example Response
{
"name": "openstack",
"namespace": "openstack",
"spec": {
"secret": "osp-secret",
"storageClass": "local-storage",
"nova": {
"enabled": true,
"template": {
"secret": "osp-secret"
}
},
"neutron": {
"enabled": true,
"template": {
"secret": "osp-secret"
}
},
"cinder": {
"enabled": true,
"template": {
"cinderVolumes": {
"volume1": {
"storageClass": "local-storage"
}
}
}
}
},
"status": {
"conditions": [
{
"type": "Ready",
"status": "True",
"lastTransitionTime": "2025-01-15T10:30:00Z",
"reason": "AllServicesReady",
"message": "All OpenStack services are ready"
}
]
}
}
MCP Tool: verify_openstack_controlplane
Verify that all conditions on an OpenStackControlPlane custom resource are in a ready state:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackControlPlane CR is located. Defaults toopenstackif not provided.name(optional): Name of the OpenStackControlPlane CR to verify. If not provided, verifies the first CR found in the namespace.
Returns: JSON object containing:
name: CR namenamespace: CR namespaceallReady: Boolean indicating whether all conditions are readytotalConditions: Total number of conditionsreadyConditions: Array of condition type strings that are readynotReadyConditions: Array of condition objects that are not ready, each containing type, status, reason, and message
Example Response (All Ready)
{
"name": "openstack",
"namespace": "openstack",
"allReady": true,
"totalConditions": 5,
"readyConditions": ["Ready", "Available", "Configured", "Deployed", "ServiceReady"],
"notReadyConditions": []
}
Example Response (Not Ready)
{
"name": "openstack",
"namespace": "openstack",
"allReady": false,
"totalConditions": 5,
"readyConditions": ["Configured", "Deployed"],
"notReadyConditions": [
{
"type": "Ready",
"status": "False",
"reason": "Deploying",
"message": "OpenStack services are being deployed"
},
{
"type": "Available",
"status": "False",
"reason": "Deploying",
"message": "Some services are not yet available"
}
]
}
MCP Tool: create_dataplane_deployment
Create an OpenStackDataplaneDeployment custom resource to deploy services on dataplane nodes:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackDataplaneDeployment CR will be created. Defaults toopenstackif not provided.name(required): Name of the OpenStackDataplaneDeployment CR to create (use dashes/underscores, not dots)spec(optional): Complete deployment spec as JSON object. Can include nodeSets, servicesOverride, ansibleTags, ansibleLimit, etc.nodeSets(optional): Array of nodeSet names to deploy to. If not provided and no spec given, auto-discovers all nodeSets in namespace.servicesOverride(optional): Array of service names to override the default services for the deployment
Returns: Success message confirming the creation of the OpenStackDataplaneDeployment CR with the specified nodeSets and optional servicesOverride.
Example Usage
Basic deployment to a single nodeSet:
{
"name": "my-deployment",
"namespace": "openstack",
"nodeSets": ["compute-nodes"]
}
Deployment to multiple nodeSets with service override:
{
"name": "my-deployment",
"namespace": "openstack",
"nodeSets": ["compute-nodes", "storage-nodes"],
"servicesOverride": ["nova", "neutron", "ovn"]
}
MCP Tool: get_dataplane_deployment
Query an OpenStackDataplaneDeployment custom resource to retrieve deployment information:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackDataplaneDeployment CR is located. Defaults toopenstackif not provided.name(required): Name of the OpenStackDataplaneDeployment CR to query
Returns: JSON object containing:
name: CR namenamespace: CR namespacespec: Deployment specification including:nodeSets: Array of nodeSet namesservicesOverride: Array of service names (if specified)
status: Deployment status including:conditions: Array of condition objects with deployment progress and statusnodeSetConditions: Per-nodeSet deployment status- Other status fields as available
Example Response
{
"name": "my-deployment",
"namespace": "openstack",
"spec": {
"nodeSets": ["compute-nodes"],
"servicesOverride": ["nova", "neutron"]
},
"status": {
"conditions": [
{
"type": "Ready",
"status": "True",
"lastTransitionTime": "2025-01-15T10:30:00Z",
"reason": "DeploymentComplete",
"message": "All nodeSets have been deployed successfully"
}
],
"nodeSetConditions": {
"compute-nodes": {
"Ready": {
"status": "True",
"message": "NodeSet deployment complete"
}
}
}
}
}
MCP Tool: list_dataplane_deployments
List all OpenStackDataplaneDeployment custom resources in a namespace:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackDataplaneDeployment CRs are located. Defaults toopenstackif not provided.
Returns: JSON array containing objects with:
name: Deployment CR namenamespace: Deployment CR namespacespec: Deployment specification including:nodeSets: Array of nodeSet namesservicesOverride: Array of service names (if specified)
status: Deployment status including:conditions: Array of condition objectsnodeSetConditions: Per-nodeSet deployment status- Other status fields as available
Example Response
[
{
"name": "edpm-deployment",
"namespace": "openstack",
"spec": {
"nodeSets": ["compute-nodes", "storage-nodes"],
"servicesOverride": ["nova", "neutron", "ovn"]
},
"status": {
"conditions": [
{
"type": "Ready",
"status": "True",
"lastTransitionTime": "2025-01-15T10:30:00Z",
"reason": "DeploymentComplete",
"message": "All nodeSets have been deployed successfully"
}
],
"nodeSetConditions": {
"compute-nodes": {
"Ready": {
"status": "True",
"message": "NodeSet deployment complete"
}
},
"storage-nodes": {
"Ready": {
"status": "True",
"message": "NodeSet deployment complete"
}
}
}
}
},
{
"name": "upgrade-deployment",
"namespace": "openstack",
"spec": {
"nodeSets": ["compute-nodes"]
},
"status": {
"conditions": [
{
"type": "Ready",
"status": "False",
"lastTransitionTime": "2025-01-15T11:00:00Z",
"reason": "DeploymentInProgress",
"message": "Deployment in progress"
}
]
}
}
]
MCP Tool: list_dataplane_nodesets
List all OpenStackDataplaneNodeSet custom resources in a namespace:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackDataplaneNodeSet CRs are located. Defaults toopenstackif not provided.
Returns: JSON array containing objects with:
name: NodeSet CR namenamespace: NodeSet CR namespacespec: NodeSet specification including:nodeTemplate: Template for node configurationnodes: Map of node names to their configurationsservices: Services to deploy on the nodeSet- Other specification fields
status: NodeSet status including:conditions: Array of condition objectsdeploymentStatus: Deployment progress information- Other status fields as available
Example Response
[
{
"name": "compute-nodes",
"namespace": "openstack",
"spec": {
"nodeTemplate": {
"ansibleSSHPrivateKeySecret": "dataplane-ansible-ssh-private-key-secret"
},
"nodes": {
"compute-0": {
"hostName": "compute-0",
"ansible": {
"ansibleHost": "192.168.1.10"
}
},
"compute-1": {
"hostName": "compute-1",
"ansible": {
"ansibleHost": "192.168.1.11"
}
}
},
"services": ["nova", "neutron", "ovn"]
},
"status": {
"conditions": [
{
"type": "Ready",
"status": "True",
"lastTransitionTime": "2025-01-15T10:30:00Z",
"message": "NodeSet is ready"
}
]
}
},
{
"name": "storage-nodes",
"namespace": "openstack",
"spec": {
"nodes": {
"storage-0": {
"hostName": "storage-0",
"ansible": {
"ansibleHost": "192.168.1.20"
}
}
},
"services": ["ceph"]
},
"status": {
"conditions": [
{
"type": "Ready",
"status": "True",
"message": "NodeSet is ready"
}
]
}
}
]
MCP Tool: verify_openstack_dataplanenodesets
Verify that all conditions on all OpenStackDataplaneNodeSet custom resources in a namespace are in a ready state:
Parameters:
namespace(optional): Kubernetes namespace where the OpenStackDataplaneNodeSet CRs are located. Defaults toopenstackif not provided.
Returns: JSON object containing:
namespace: Namespace that was checkedallReady: Boolean indicating whether all NodeSets are readytotalNodeSets: Total number of NodeSets in the namespacereadyNodeSets: Array of NodeSet names that are readynotReadyNodeSets: Array of NodeSet verification results for NodeSets that are not ready
Each notReadyNodeSets entry contains:
name: NodeSet nameallReady: Boolean indicating whether all conditions are readytotalConditions: Total number of conditionsreadyConditions: Array of condition type strings that are readynotReadyConditions: Array of condition objects with type, status, reason, and message
Example Response (All Ready)
{
"namespace": "openstack",
"allReady": true,
"totalNodeSets": 2,
"readyNodeSets": ["compute-nodes", "controller-nodes"],
"notReadyNodeSets": []
}
Example Response (Not All Ready)
{
"namespace": "openstack",
"allReady": false,
"totalNodeSets": 2,
"readyNodeSets": ["controller-nodes"],
"notReadyNodeSets": [
{
"name": "compute-nodes",
"allReady": false,
"totalConditions": 3,
"readyConditions": ["SetupReady"],
"notReadyConditions": [
{
"type": "DeploymentReady",
"status": "False",
"reason": "Deploying",
"message": "Deployment in progress"
},
{
"type": "Ready",
"status": "False",
"reason": "NotReady",
"message": "NodeSet is not ready"
}
]
}
]
}
Configuration with Claude Desktop
Add to your Claude Desktop MCP settings:
{
"mcpServers": {
"openstack-k8s": {
"command": "/path/to/openstack-k8s-mcp"
}
}
}
Development
Project Structure
main.go: MCP server implementationclient.go: Kubernetes client wrappergo.mod: Go module dependencies
Dependencies
github.com/mark3labs/mcp-go: MCP SDK for Gogithub.com/openstack-k8s-operators/openstack-operator/apis: OpenStack operator API typesk8s.io/client-go: Kubernetes Go clientk8s.io/apimachinery: Kubernetes API machinery
License
MIT