Loading…
Accelerate automation with AI and the Ansible development tools MCP servers
Red HatLeonardo Gallego
Summary
Ansible automation development often involves frequent context switching and struggles with AI assistants generating syntactically valid code that hallucinates module parameters or misses local dependencies. To address this gap, the Ansible development tools Model Context Protocol server connects AI assistants to external development tooling through structured interfaces. The server wraps command-line utilities, enabling AI models to deterministically run ansible-lint with automatic fixes, scaffold projects via ansible-creator, manage environments, and build execution environment container images. By surfacing local workspace schemas, documentation, and organizational linting standards, the system grounds AI responses in real environment configurations. The integration operates across multiple MCP-compatible clients without requiring a specific model provider.
Context
Ansible playbook authoring involves constant context switching across documentation, terminals, and editors, while AI assistants frequently generate code referencing uninstalled collections or invalid module parameters because they lack awareness of the local developer environment.
Approach / What changed
The Ansible development tools Model Context Protocol server (@ansible/ansible-mcp-server) wraps the Ansible CLI tools into structured MCP interfaces, providing real-time schema data, local linting rules, and deterministic execution tools for tasks like linting, scaffolding, and environment management.
Takeaways
- The Ansible MCP server bundles inside the Ansible VS Code extension and spawns automatically via the built-in Node.js runtime when enabling ansible.mcpServer.enabled.
- Ansible Automation Platform exposes gateway MCP endpoints starting in version 2.6.4+ and generally available in 2.7 for querying controller APIs, inventory data, and launching job templates under RBAC permissions.
- The ansible.mcp collection is available as a Technology Preview to allow playbooks to invoke MCP servers directly using native Ansible module syntax inside execution environments.
Related reading
Red Hat ·
Red Hat Ansible development workspaces for governed automation content creation
Ansible development workspaces in Red Hat Ansible Automation Platform leverage Red Hat OpenShift Dev Spaces to solve environment drift and lengthy developer onboarding. Instead of configuring local environments, developers access cloud-hosted VS Code instances via a web browser using declarative devfile.yaml configurations. The platform enforces immutability with a read-only /var directory at runtime, preventing arbitrary package installations that cause configuration drift. To address differing domain requirements across teams without creating bloated monolithic images, the solution implements a four-tiered image strategy based on OpenShift BuildConfigs and ImageStreams. When base container images receive security patches, the dependent image layers automatically rebuild throughout the entire chain.
Leonardo GallegoRed Hat ·
Try the Ansible playbook generation lab with Gemini and OpenAI