ansible-mcp-server
Ansible NLP MCP
Codex가 일반 셸을 노출하는 대신 안전한 도구를 사용하여 이 Ansible 저장소와 자연어로 상호작용할 수 있게 하는 로컬 MCP 서버입니다.
도구
health: 루트, 타임아웃 및 변경 실행이 활성화되어 있는지 여부를 표시합니다.list_playbooks: 실행 가능한 playbooks와 workflows를 나열합니다.inspect_playbook: plays, hosts,vars_files, 초기 tasks 및 공통 필수 변수를 요약합니다.suggest_playbooks: 자연어 요청을 기반으로 playbooks의 순위를 매깁니다.inventory_graph:ansible-inventory --graph를 실행합니다.inventory_summary: 인벤토리의 그룹과 hosts를 요약합니다.syntax_check:ansible-playbook --syntax-check를 실행합니다.check_playbook:ansible-playbook --check를 실행합니다.run_playbook: 실제 playbook을 실행하며, 기본적으로 차단됩니다.ping_hosts:ansible -m ping또는ansible.windows.win_ping을 실행합니다.list_logs및tail_log:logs/내의 로그를 조회합니다.
Related MCP server: AAP MCP Server
설치
cd /root/ansible
python3 -m venv .venv-mcp
. .venv-mcp/bin/activate
pip install -r ansible_mcp/requirements.txt로컬 테스트
cd /root/ansible
. .venv-mcp/bin/activate
python -m ansible_mcp.server이 명령은 stdio를 통해 MCP 서버를 시작하고 MCP 클라이언트를 기다립니다.
Codex에서의 설정
프로젝트의 .codex/config.toml 또는 전역으로 활성화하려면 ~/.codex/config.toml에 대한 예시:
[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" }ANSIBLE_MCP_ALLOW_RUN = "0"을 사용하면 MCP는 검사, 인벤토리, ping, syntax-check 및 check-mode를 허용하지만 실제 playbook 실행은 차단합니다.
변경 실행을 허용하려면:
[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" }활성화된 경우에도 run_playbook은 도구 호출에서 여전히 confirm = "RUN"을 요구합니다.
NLP 의도 예시
"wuday1의 Windows를 업데이트하려면 어떤 playbook을 사용하나요?"
"
day=wuday1로 Windows Update playbook의 syntax-check를 수행하세요.""rocky 그룹에서만 Linux 업데이트를 check mode로 실행하세요."
"Citrix Day의 최근 로그를 표시하세요."
"인벤토리 그룹을 나열하고 각 그룹에 hosts가 몇 개 있는지 표시하세요."
This server cannot be deployed
Maintenance
Related MCP Connectors
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
MCP server for generating rough-draft project plans from natural-language prompts.
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
- AlicenseAqualityDmaintenanceAn 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.6296 npmMIT
- 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.12-