Work in Progress – this guide is actively being developed.

Security patching at scale is one of the most time-consuming and error-prone tasks in IT operations. Teams manually check vulnerability reports, cross-reference advisories, identify affected systems, build remediation plans, and schedule maintenance windows – often across hundreds or thousands of RHEL virtual machines running on OpenShift Virtualization. A single critical CVE can consume days of engineering time from discovery to resolution.
This guide demonstrates how to collapse that timeline from days to minutes using Red Hat Lightspeed MCP and the Ansible Automation Platform MCP server. An operator describes the problem in natural language – “patch CVE-2024-6174 on my production fleet” – and the MCP-connected AI assistant identifies affected systems, surfaces the correct advisory, selects the approved remediation playbook, and executes it through AAP with full audit trail. No manual advisory lookup, no hand-written playbooks, no SSH sessions.
Vulnerability management on RHEL is a well-understood domain: Red Hat publishes security advisories (RHSAs), each mapping one or more CVEs to specific package updates across RHEL versions. Tools like dnf updateinfo and the Red Hat Lightspeed (formerly Insights) Vulnerability service make it straightforward to identify which systems are affected and which errata to apply. The challenge is not knowing what to do – it is doing it quickly, consistently, and at scale across a fleet of virtual machines.
OpenShift Virtualization adds a layer of complexity. RHEL VMs managed through OpenShift inherit the benefits of Kubernetes orchestration but still require traditional in-guest patching for OS-level vulnerabilities. Organizations need a way to bridge the Kubernetes management plane with RHEL system administration – and that bridge is Ansible Automation Platform.
The Model Context Protocol (MCP) changes how operators interact with these systems. Instead of navigating multiple consoles and CLIs, an MCP-enabled AI assistant can query Red Hat Lightspeed for vulnerability data, cross-reference it with the organization’s AAP inventory, and trigger approved remediation – all from a single conversational interface. This is not autonomous AI making unsupervised decisions; it is AI-assisted operations where the human remains in the loop but the toil is eliminated.
This solution connects two MCP servers to an AI assistant (such as an IDE with MCP support) to create an end-to-end patching workflow:
| Persona | Challenge | What They Gain |
|---|---|---|
| IT Ops Engineer / SRE | Manually correlating CVEs to advisories, checking each system, and running patches one by one | Natural-language patching: describe the CVE, the assistant handles advisory lookup, system identification, and execution |
| Automation Architect | Building and maintaining per-CVE playbooks and job templates for every advisory | MCP-driven workflow that dynamically selects the right remediation based on the advisory, no per-CVE template sprawl |
| IT Manager / Director | Patch compliance SLAs measured in days or weeks; audit gaps between discovery and remediation | Measurable reduction in time-to-patch with full audit trail through AAP job logs |
Recommended Demos and Self-Paced Labs:
ansible.controller collection features used in this guide| Collection | Type | Purpose |
|---|---|---|
| ansible.controller | Certified | Programmatic interaction with AAP Controller (job launches, inventory queries) |
| redhat.rhel_system_roles | Certified | RHEL system configuration and patching tasks |
| System | Required | Purpose |
|---|---|---|
| Red Hat Lightspeed (console.redhat.com) | Yes | Vulnerability data, host inventory, remediation playbook generation |
| OpenShift Virtualization | Yes | Platform running the RHEL VMs to be patched |
| MCP-compatible AI client | Yes | IDE or tool with MCP support (e.g., Cursor, VS Code with MCP extension) |
| MCP Server | Purpose |
|---|---|
| Red Hat Lightspeed MCP | Exposes Vulnerability, Inventory, Advisor, Remediations, and RBAC APIs |
| AAP MCP server | Exposes job templates, inventories, and job launch/status APIs |
RBAC: Both MCP servers require proper role assignments.
Lightspeed MCP needs: Vulnerability viewer, Inventory Hosts viewer, Remediations user. AAP MCP needs: Execute permission on the relevant job templates and Read on inventories.
Operational Impact: Medium – applies package updates to production RHEL VMs. Test in non-production first.
graph LR
subgraph Identify
A([CVE Reported]) --> B[Lightspeed MCP]
B --> C[Affected Hosts + Advisory]
end
subgraph Remediate
C --> D[AAP MCP]
D --> E[Execute Patch]
end
E --> F([Validated])
The workflow follows a Day 2 operations pattern:
| Stage | Impact | Notes |
|---|---|---|
| 1. Identify affected systems | None | Read-only queries to Lightspeed Vulnerability and Inventory APIs |
| 2. Retrieve advisory details | None | Read-only API call |
| 3. Select remediation playbook | None | Read-only query to AAP job templates |
| 4. Execute patch | High | Applies package updates to target systems; schedule during change window |
| 5. Validate | Low | Read-only verification commands |
Operational Impact: None
The AI assistant uses the Lightspeed MCP Vulnerability tools to identify which connected systems are affected by the reported CVE.
# Lightspeed MCP tool call (conceptual)
- tool: vulnerability_get_cve_details
parameters:
cve_id: "CVE-2024-6174"
# Returns: severity, description, affected_systems[], applicable_advisories[]
The Lightspeed Vulnerability API returns the list of systems where the CVE is present, along with the applicable Red Hat Security Advisory (RHSA). This replaces manual cross-referencing between the CVE database, errata pages, and your inventory.
Operational Impact: None
With the advisory ID from Step 1, the assistant retrieves the specific package versions that resolve the vulnerability.
# Lightspeed MCP tool call (conceptual)
- tool: vulnerability_get_advisory_details
parameters:
advisory_id: "RHSA-2025:10848"
# Returns: fixed_package_versions[], affected_rhel_versions[], severity
For CVE-2024-6174, this returns that cloud-init must be updated to version 24.4-4.el9_6.3 or later. The assistant can also cross-reference with the Inventory MCP tools to confirm which RHEL version each affected host is running.
Operational Impact: None
The assistant queries the AAP MCP server to find an existing job template for security patching, or uses the Lightspeed Remediations API to generate one.
# AAP MCP tool call (conceptual)
- tool: job_templates_list
parameters:
search: "security patch"
# Or generate a remediation playbook via Lightspeed
- tool: remediations_create_playbook
parameters:
cve_ids: ["CVE-2024-6174"]
system_ids: ["<uuid-of-affected-host>"]
Why two MCP servers?
Lightspeed MCP knows what is wrong (which CVEs affect which hosts). AAP MCP knows how to fix it (which job templates are approved, what credentials and inventories to use). Connecting both to the same AI assistant lets it bridge vulnerability intelligence with remediation execution.
Operational Impact: High
With the correct job template identified and the target hosts confirmed, the assistant launches the patch through AAP. The human reviews and approves before execution.
# AAP MCP tool call (conceptual)
- tool: job_templates_launch
parameters:
job_template_id: 42
extra_vars:
cve_id: "CVE-2024-6174"
target_hosts: "affected_rhel_vms"
limit: "ocp-virt-prod-*"
The underlying playbook uses standard ansible.builtin.dnf tasks to apply the update:
- name: Patch CVE via advisory
hosts: all
become: true
tasks:
- name: Apply security update for target CVE
ansible.builtin.dnf:
name: "{{ target_package }}"
state: latest
security: true
register: patch_result
- name: Verify package was updated
ansible.builtin.command:
cmd: "rpm -q {{ target_package }}"
register: post_patch_version
changed_when: false
- name: Report patch status
ansible.builtin.debug:
msg: "{{ inventory_hostname }}: {{ post_patch_version.stdout }}"
RBAC: Govern who can trigger patches.
Assign the
Executerole on patching job templates only to thesecurity-opsteam. The AI assistant acts on behalf of the authenticated user – it cannot bypass AAP’s RBAC model.
Operational Impact: Low
After the job completes, the assistant confirms the patch was applied by checking the AAP job output and optionally re-querying Lightspeed Vulnerability to verify the CVE is no longer reported for the patched hosts.
# AAP MCP tool call (conceptual)
- tool: jobs_get_details
parameters:
job_id: "{{ launched_job_id }}"
# Lightspeed MCP re-check
- tool: vulnerability_get_systems_affected
parameters:
cve_id: "CVE-2024-6174"
# Expect: affected_count reduced or zero
Trigger the full workflow by asking the AI assistant to patch a known CVE on a test system:
“Check if CVE-2024-6174 affects any of my RHEL systems and patch the affected hosts.”
The assistant should:
After execution, verify on the target host:
$ rpm -q cloud-init
cloud-init-24.4-7.el9_7.1.noarch
The AAP job output should show:
PLAY RECAP *********************************************************************
target_host : ok=3 changed=1 unreachable=0 failed=0 skipped=0
| Symptom | Likely Cause | Fix |
|---|---|---|
| Lightspeed MCP returns no affected systems | Systems not connected to Red Hat Lightspeed or Inventory viewer role missing | Verify systems are registered with rhc and RBAC roles are assigned to the service account |
| AAP MCP cannot find job templates | Insufficient RBAC permissions on the AAP user/token | Assign at least Read on the job template and Execute to launch |
dnf update fails with “No packages marked for update” |
System already patched or on a RHEL version where the fix is not yet available | Check dnf updateinfo list --cves <CVE> on the target; verify RHEL version matches the advisory |
| Job template launch returns 403 | AAP token lacks Execute permission | Update the credential in AAP and reassign the RBAC role |
| Maturity | Description |
|---|---|
| Crawl | Use Lightspeed MCP to identify affected systems and advisories; patch manually via SSH or ad-hoc AAP jobs |
| Walk | Connect AAP MCP so the assistant can launch approved job templates; human reviews and approves each execution |
| Run | Fully automated pipeline: compliance scan triggers Lightspeed lookup, AAP patches affected systems within policy-defined maintenance windows, results feed back to Lightspeed for verification |