ansible-mcp-server
Provides tools for interacting with an Ansible repository, including playbook discovery, inspection, inventory querying, syntax checking, check-mode execution, and real playbook runs, enabling natural language management of Ansible automation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ansible-mcp-serverWhich playbook should I use to update Windows hosts?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Ansible NLP MCP
Local MCP server to allow Codex to interact with this Ansible repository through natural language, using safe tools instead of exposing a generic shell.
Tools
health: shows root, timeout, and whether mutable execution is enabled.list_playbooks: lists executable playbooks and workflows.inspect_playbook: summarizes plays, hosts,vars_files, initial tasks, and common required variables.suggest_playbooks: ranks playbooks based on a natural language request.inventory_graph: runsansible-inventory --graph.inventory_summary: summarizes inventory groups and hosts.syntax_check: runsansible-playbook --syntax-check.check_playbook: runsansible-playbook --check.run_playbook: runs the actual playbook, blocked by default.ping_hosts: runsansible -m pingoransible.windows.win_ping.list_logsandtail_log: queries logs insidelogs/.
Related MCP server: AAP MCP Server
Installation
cd /root/ansible
python3 -m venv .venv-mcp
. .venv-mcp/bin/activate
pip install -r ansible_mcp/requirements.txtLocal testing
cd /root/ansible
. .venv-mcp/bin/activate
python -m ansible_mcp.serverThis command starts an MCP server over stdio and waits for an MCP client.
Codex configuration
Example for .codex/config.toml in the project, or for ~/.codex/config.toml if you want to enable it globally:
[mcp_servers.ansible]
command = "/root/ansible/.venv-mcp/bin/python"
args = ["/root/ansible/ansible_mcp/server.py"]
cwd = "/root/ansible"
enabled = true
startup_timeout_sec = 10
tool_timeout_sec = 900
env = { ANSIBLE_MCP_ROOT = "/root/ansible", ANSIBLE_MCP_ALLOW_RUN = "0" }With ANSIBLE_MCP_ALLOW_RUN = "0", the MCP allows inspection, inventory, ping, syntax-check, and check mode, but blocks actual playbook execution.
To allow mutable execution:
[mcp_servers.ansible]
command = "/root/ansible/.venv-mcp/bin/python"
args = ["/root/ansible/ansible_mcp/server.py"]
cwd = "/root/ansible"
enabled = true
startup_timeout_sec = 10
tool_timeout_sec = 900
env = { ANSIBLE_MCP_ROOT = "/root/ansible", ANSIBLE_MCP_ALLOW_RUN = "1" }Even when enabled, run_playbook still requires confirm = "RUN" in the tool call.
NLP intent examples
"Which playbook do I use to update Windows on wuday1?"
"Run syntax-check on the Windows Update playbook with
day=wuday1.""Run the Linux update in check mode only on the rocky group."
"Show the latest Citrix Day logs."
"List the inventory groups and how many hosts are in each one."
This server cannot be deployed
Maintenance
Related MCP Connectors
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Related MCP Servers
- AlicenseCqualityFmaintenanceThis Model Context Protocol server enables AI assistants to interact directly with Ansible, allowing them to execute playbooks, manage inventory, check syntax, and perform other Ansible operations.1826MIT
- AlicenseBqualityDmaintenanceEnterprise-grade MCP server exposing Ansible Automation Platform 2.x as a complete AI interface for LLMs, enabling natural language management of automation resources.861Apache 2.0
- FlicenseAqualityDmaintenanceAn MCP server that lets AI agents discover Ansible Galaxy collection input/output contracts, including module arguments, return values, and role facts, to help generate accurate playbooks.6-
- FlicenseNot gradedqualityDmaintenanceIndustry-standard MCP server for AWX/AAP/Ansible Tower automation, enabling AI agents to manage job templates, launch and monitor jobs, and handle inventories and projects through natural language.11-