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

From describing to doing: How MCP makes AI-driven Ansible automation reliable

August 19, 2026
Leonardo Gallego
Related topics:
Developer toolsAutomation and managementArtificial intelligenceDeveloper productivity
Related products:
Red Hat Ansible Automation Platform

    Ask an AI assistant how to lint an Ansible playbook today, and you'll likely get a helpful but generic answer: "Use ansible-lint. Install it with pip install ansible-lint, then run it against your playbook." Correct. But not useful when you already have ansible-lint installed, your team has a custom linting profile, and what you wanted was for the tool to run and fix the violations.

    That's the gap between an AI that describes and an AI that does. The Ansible development tools Model Context Protocol (MCP) server bridges it, and it works with whatever AI model you already use.

    The Ansible playbook context-switching problem

    Developing Ansible automation today involves constant context switching. Checking module documentation across upstream docs, Red Hat Knowledgebase articles, and internal communities of practice. Figuring out which tool to use and how to run it. Parsing AI-generated suggestions against what's installed. Correlating lint violations with runtime failures. All of it means jumping between browser tabs, terminals, and the editor. It adds up.

    The workflow is fragmented, and it hits new automation developers hardest. When someone asks an AI assistant for help writing a playbook, the assistant generates syntactically correct code, but it might reference uninstalled collections, use nonexistent module parameters, or ignore the organization's naming conventions entirely. The AI doesn't know what's in the developer's local environment.

    Model Context Protocol: From advisor to operator

    The Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools through a unified interface. Instead of the AI guessing how to use a tool, MCP provides a structured contract: the tool declares what it can do (with full parameter schemas), and the AI calls it deterministically.

    The Ansible development tools MCP server (@ansible/ansible-mcp-server) wraps the Ansible development tools command-line interface (CLI) into this protocol. With the MCP server configured, the interaction changes, as shown in Table 1:

    Table 1: Developer workflows with and without the Ansible MCP server.
    Scenario or promptWithout MCPWith MCP
    "How do I lint my playbook?"AI explains how to install and run ansible-lintAI finds the ansible-lint MCP tool, executes it, and returns results
    "Set up my environment"AI suggests various pip and galaxy commandsAI calls the environment setup tool directly
    "Create a playbook for..."AI scaffolds from memory, might hallucinate module namesAI uses ansible-creator through MCP, producing valid scaffolding
    Quality checkRequires reading logs, fixing manually, re-promptingAI runs lint, applies --fix, iterates until clean

    MCP adds a layer of abstraction between the AI and the tool, providing context around when, why, and exactly how to execute a particular process. This architecture cuts back on guesswork and non-deterministic behaviors, making AI-driven development reliable.

    What the Ansible development tools MCP server can do

    The current Ansible development tools MCP server covers the core automation developer workflow across several areas:

    • Code quality: Run ansible-lint against playbooks, roles, and collections, with the option to auto-fix violations.
    • Project scaffolding: Create new collections, playbooks, and roles through ansible-creator, following organizational templates and standards.
    • Playbook execution: Run playbooks through ansible-navigator with execution environment support.
    • Environment management: Set up, inspect, and verify Ansible development environments, including tool versions and dependencies.
    • Execution environments: Define and build execution environment (EE) container images from within the conversation.
    • Best practices: Surface community and organizational guidelines so the AI generates code that follows your team's conventions.

    These aren't wrappers around generic shell commands. Each tool encodes the specific way an Ansible development tool needs to be invoked, with the right flags, the right order, and proper error handling. The AI doesn't figure out how to run ansible-lint on its own; it follows the implementation the Ansible engineering team built.

    The engineering team is already expanding the MCP server to add plug-in discovery and documentation lookup across installed collections, Galaxy browsing, task and playbook generation grounded in real module schemas, and tighter integration between the MCP tools and the Visual Studio Code (VS Code) extension user interface (UI). The goal is full parity: anything a developer can do through the extension's interface, an AI agent can do through MCP, and vice versa.

    Bring your own model

    The Ansible development tools MCP server doesn't require a specific AI provider. It works with any MCP-compatible client, so automation developers and content creators can use the AI assistant they already have:

    • GitHub Copilot in VS Code
    • Claude Code in the terminal or VS Code
    • Gemini CLI for Google's models
    • Cursor, Windsurf, or any other MCP-compatible editor

    The Ansible VS Code extension makes setup even simpler. The @ansible/ansible-mcp-server package ships bundled inside the extension itself. Set ansible.mcpServer.enabled to true, and the extension spawns the MCP server as a child process using VS Code's built-in Node.js runtime. No separate npm install, no Node.js on your PATH. It's available to any AI chat client in the integrated development environment (IDE) as soon as you enable the setting.

    For organizations with specific AI governance requirements, the choice of model stays in their hands. The Ansible engineering team is currently developing a provider-agnostic middleware approach to decouple AI provider logic from the core extension. Users will configure their endpoint and API key in 1 place, enabling a "bring your own model" (model customization) setup working with local instances, air-gapped corporate servers, or any cloud provider.

    Developing an Ansible playbook with a deterministic coding assistant

    Model flexibility is 1 piece. The harder problem is accuracy. AI-generated Ansible code today often looks correct but fails on execution because the model doesn't know what's installed in the developer's environment.

    By feeding the AI real-time context directly from the local workspace, the server prioritizes correctness over raw generation speed:

    • Full ansible-doc coverage via MCP, grounding the AI in authoritative schema data for every installed collection and module version
    • Environment-aware generation, where the AI won't generate code for missing dependencies and instead offers a path to resolve them (such as ansible-galaxy install) within the chat interface
    • A documentation feedback loop, where code generates structured reference guides the AI consumes to ground its future suggestions

    The goal: an AI assistant that doesn't hallucinate collection names or guess module parameters, because it knows what's available in your environment.

    This solves a long-standing challenge for automation architects attempting to standardize practices across distributed engineering teams. Today, enforcing naming conventions, lint profiles, and approved patterns means writing a wiki and hoping everyone reads it. The MCP server includes a documentation and knowledge layer surfacing best practices, module documentation, and organizational guidelines directly into the AI conversation. Every developer's AI assistant follows the same standards because the MCP server injects local lint rules and schemas directly into every prompt interaction.

    This layer is expanding in the next generation of the server, with deeper coverage of collection docs, plug-in schemas, and community guidance. While Ansible development workspaces keep your local tools and versions consistent, the MCP server keeps your playbooks aligned with team standards.

    Note

    Ansible development workspaces deliver consistent, browser-based environments with Red Hat OpenShift Dev Spaces, so every developer's AI assistant runs against the same toolchain.

    What the Ansible MCP server looks like in practice

    Integrating Ansible development tools with MCP simplifies both day-to-day content creation and broader operational management.

    Inner loop: content development

    Imagine you are building a new network automation collection and want to go from zero to clean, tested code without leaving your editor. You can ask your AI assistant:

    "Scaffold a network automation collection, add a backup role, lint it, write Molecule tests, fix all violations."

    The AI calls ansible-creator to scaffold the project, generates role defaults and tasks, runs ansible-lint against the team's profile, applies fixes, and presents the result for review. 1 context. No tab switching.

    Outer loop: operational integration

    While developers benefit from immediate local assistance in VS Code, platform engineers can provide governed MCP endpoints that safely connect content authoring to non-production execution environments. Available starting with Ansible Automation Platform 2.5 and generally available in Ansible Automation Platform 2.7, the Ansible Automation Platform gateway exposes MCP endpoints for job management, inventory queries, system monitoring, and more.

    A platform engineer can ask:

    "Show me failed jobs in the last 24 hours, check inventory for hosts missing the security baseline, launch the remediation template."

    The AI queries the Ansible Automation Platform controller API for failed jobs, cross-references inventory data, and launches a job template, all through structured MCP calls with the user's role-based access control (RBAC) permissions. You can scope tokens as read-only for querying or read-write when job launching is needed.

    Warning

    Use development or staging Ansible Automation Platform instances for AI-assisted workflows.

    AI assistants can launch jobs and modify platform state through the Ansible Automation Platform MCP server. Always point MCP configurations at non-production instances during development, and use a read-only token unless you specifically need the AI assistant to launch jobs.

    Together, the Ansible development tools MCP server and the Ansible Automation Platform MCP server connect the inner loop (content creation) with the outer loop (content execution) through the same AI interface. Write a playbook, push it to a development Ansible Automation Platform instance, run it, troubleshoot failures. 1 conversation.

    Getting started with the Ansible MCP server

    In the VS Code extension: Install the Ansible extension for VS Code, then enable ansible.mcpServer.enabled in your settings. The MCP server starts automatically and is available to any AI chat client in VS Code.

    With Claude Code:

    claude mcp add ansible -- npx -y @ansible/ansible-mcp-server --stdio

    With any MCP client (such as VS Code Copilot Chat or Cursor): Add to your MCP configuration:

    {
      "mcp": {
        "servers": {
          "ansible": {
            "command": "npx",
            "args": ["-y", "@ansible/ansible-mcp-server", "--stdio"],
            "env": {
              "WORKSPACE_ROOT": "${workspaceFolder}"
            }
          }
        }
      }
    }

    As a container:

    podman run --rm -i \
      -v /path/to/your/ansible/project:/workspace \
      -e WORKSPACE_ROOT=/workspace \
      ghcr.io/ansible/devtools-mcp-server:latest --stdio

    The Ansible development tools MCP server is available as a Technology Preview. For the full setup guide, including Ansible Automation Platform MCP server configuration, see the MCP server documentation.

    Beyond development: Using the Ansible MCP server in execution environments

    The Ansible development tools MCP server covers the development side, but the Ansible ecosystem is also exploring MCP at runtime. The ansible.mcp collection (available as a Technology Preview) lets you invoke MCP servers directly from playbooks using native Ansible module syntax inside execution environments. That's a topic for another post, but the direction is worth noting: MCP is becoming an integration layer across the Ansible platform, from development through execution.

    Additional resources

    Ready to bring deterministic AI into your Ansible workflow? Enable ansible.mcpServer.enabled in your VS Code settings today to try the Technology Preview and transform your AI assistant from a passive advisor into an active development tool.

    • Solution guide: Complete technical walkthrough covering both Ansible development workspaces and MCP server configuration.
    • Documentation: Create, test, and deploy automation content with Ansible development tools.
    • Video: ansible-lint walkthrough

    Related Posts

    • Simplify GitOps workflows with MCP in OpenShift Lightspeed

    • MCP servers vs. skills: Choosing the right context for your AI

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

    • Optimize infrastructure health with Red Hat Lightspeed MCP

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

    • Kubernetes MCP server: AI-powered cluster management

    Recent Posts

    • From describing to doing: How MCP makes AI-driven Ansible automation reliable

    • The tokenomics of self-hosted LLMs

    • Securing Claude Code plug-ins: Best practices for repository security

    • Architecting the Red Hat OpenShift AI dashboard for Models-as-a-Service

    • Build bootable image mode for Red Hat Enterprise Linux with image builder

    What’s up next?

    Learning Path Introduction to Ansible share image

    Foundations of Ansible

    Explore essential Ansible concepts, terminology, and tools, then set up your...
    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
    Ask AI