Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Building Red Hat MCP-ready images with image mode for Red Hat Enterprise Linux

Integrating AI-assisted troubleshooting into Red Hat Enterprise Linux image mode

April 14, 2026
Louis Imershein
Related topics:
Artificial intelligenceDeveloper toolsIntegration
Related products:
Red Hat Enterprise Linux

    Building a bootable OS image should feel as seamless as building a container. That's the goal of image mode for Red Hat Enterprise Linux (RHEL). A key advantage for developers using image mode with RHEL is the integration of AI-assisted troubleshooting directly into the development loop.

    By leveraging the Model Context Protocol (MCP), you can connect VS Code or Cursor to two specialized intelligence streams: One for local system telemetry and one for global proactive security.

    Red Hat provides two MCP servers that can help you diagnose issues with your image mode for RHEL servers:

    • MCP server for RHEL gives your AI agent a live look at the OS to read journalctl, check systemctl units, and inspect resource pressure.
    • MCP server for Red Hat Lightspeed (formerly Insights) for RHEL queries Red Hat's proactive analytics to identify CVEs and best practice drift before you ever push your images to production.

    Step 1: Generate your AI bridge keys

    Before configuring your IDE or image, you need a dedicated SSH key pair for the MCP server. Run this in your build environment:

    $ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_mcp \
    -C "rhel-mcp-agent" -N ""

    For the example below, you must obtain values for the LIGHTSPEED_CLIENT_ID and LIGHTSPEED_CLIENT_SECRET variables required to connect the MCP Server for Red Hat Lightpeed to the Red Hat Lightspeed services.. To obtain these, log into the Red Hat Lightspeed console at console.redhat.com and configure a service account or API client for Red Hat Lightspeed.

    After you have the values, you can set them to automatically load on Linux in $HOME/.bashrc. Set these variables in your environment before the IDE launches the MCP server.

    # Values for these variables are from console.redhat.com
    export LIGHTSPEED_CLIENT_ID="[Your ID Here]"
    export LIGHTSPEED_CLIENT_SECRET="[Your Secret Here]"

    Step 2: Configuring your AI agent

    This configuration script is for a generic IDE configuration file (for example, mcp.json) compatible with editors such as VS Code and Cursor. Add the following to your IDE's MCP configuration file. Note how you mount your .ssh directory so the MCP container can use the key you just created.

    {
      "mcpServers": {
        "rhel-runtime": {
          "type": "stdio",
          "command": "podman",
          "args": [
            "run", "-i", "--rm", 
            "-v", "${env:HOME}/.ssh:/root/.ssh:ro",
            "quay.io/redhat/rhel-mcp-server:latest"
          ],
          "env": {
            "LINUX_MCP_USER": "mcp",
            "LINUX_MCP_HOST": "192.168.122.50",
            "LINUX_MCP_SSH_KEY_PATH": "/root/.ssh/id_ed25519_mcp"
          }
        },
        "redhat-lightspeed": {
          "type": "stdio",
          "command": "podman",
          "args": [
            "run", "-i", "--rm", 
            "--env", "LIGHTSPEED_CLIENT_ID", 
            "--env", "LIGHTSPEED_CLIENT_SECRET",
            "quay.io/redhat-services-prod/insights-mcp:latest"
          ]
        }
      }
    }

    Step 3: Designing the registered image

    In your Containerfile, prepare the environment for both remote host configuration (rhc) and secure AI access with the mcp user:

    FROM quay.io/redhat/redhat-bootc:9.4
    
    # Install rhc, cloud-init, and openssh-server
    RUN dnf -y install rhc cloud-init openssh-server && dnf clean all
    
    # Create the dedicated mcp user bridge
    RUN useradd -m -G wheel mcp && \
        echo "mcp ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/mcp
    
    # Enable services for first boot
    RUN systemctl enable cloud-init sshd
    
    COPY . /app
    RUN bootc install

    Step 4: Zero-touch registration and access with cloud-init

    Paste the public key you generated in step 1 into your cloud-config. This allows the MCP server to log in automatically without a password. An example cloud-config:

    #cloud-config
    users:
      - name: mcp
        sudo: ALL=(ALL) NOPASSWD:ALL
        shell: /bin/bash
        ssh_authorized_keys:
          # cat ~/.ssh/id_ed25519_mcp.pub
          - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOmcpAgentExampleKey12345 rhel-mcp-agent
    
    rh_subscription:
      org: "1234567"
      activation-key: "development-stack-key"
      auto-attach: true
    
    runcmd:
      - [ rhc, connect ]

    Troubleshooting the configuration

    If your IDE reports a connection refused error, have a look at these three common friction points:

    • A bootc system takes a few seconds to initialize sshd. Wait 10 seconds and retry.
    • Ensure that LINUX_MCP_HOST in mcp.json matches the actual IP of the running container (obtained with podman inspect <id>).
    • Try ssh -i ~/.ssh/id_ed25519_mcp mcp@<container-ip>. If this fails, your MCP server will also fail. Check for a local firewall blocking port 22.

    MCP servers in action

    By integrating the Model Context Protocol into your RHEL image, your coding assistant gains two streams of information you can utilize proactively to make bootable images more reliable and performant. For example :

    • Red Hat Lightspeed for RHEL queries Red Hat's proactive analytics on a scheduled basis. The Red Hat Lightspeed MCP server provides a real-time bridge between LLMs and the Red Hat Lightspeed for RHEL proactive analytics. You can use it to find out how an upcoming Red Hat Enterprise Linux release will affect your specific environment as well as to flag newly discovered common vulnerabilities and exposures (CVE) relevant to the packages in your image. This identifies security risks and "best practice" drift before you commit a single line of code to production.
    • The RHEL MCP server gives your AI agent an on-demand, live look at the state of your operating system. This allows for immediate root-cause analysis on performance issues by reading system telemetry, inspecting resource pressure (CPU, memory), and checking for overloaded system components like journal files.
    • RHEL MCP server can directly read journalctl and inspect critical systemd units, such as NetworkManager or sshd, and help your coding assistant to quickly diagnose issues in areas such as network connectivity, firewall misconfiguration, and service dependencies that cause connection refusals. You get this without having to analyze logs yourself, or to manually scrape data and copy/paste it into an assistant.

    Next steps

    Red Hat MCP servers can help you move beyond manual system troubleshooting. By integrating image mode for RHEL with the Model Context Protocol, you streamline your pipeline. You get a single, bootable container image that's secure, fully registered, and instantly debuggable by AI agents right inside your IDE.

    To learn more and get started, check out these resources:

    • Tutorial: Leverage AI for root-cause analysis with MCP servers
    • Deep dive: Smarter troubleshooting with the new MCP server for RHEL
    • Patterns: RHEL AI-native patterns GitHub repo

    Related Posts

    • Unlocking UBI to Red Hat Enterprise Linux container images

    • Optimize infrastructure health with Red Hat Lightspeed MCP

    • How to connect OpenShift Lightspeed MCP to your IDE

    • Find and fix RHEL vulnerabilities with Red Hat Lightspeed MCP

    • Building effective AI agents with Model Context Protocol (MCP)

    Recent Posts

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.