Skip to main content
Glama
infra-mdsystems

ansible-mcp-server

Ansible NLP MCP

本地 MCP 服务器,允许 Codex 通过自然语言与此 Ansible 仓库交互,使用安全工具而不是暴露通用 shell。

工具

  • health:显示根目录、超时时间以及是否启用可变执行。

  • list_playbooks:列出可执行的 playbook 和工作流。

  • inspect_playbook:总结 plays、主机、vars_files、初始任务和常见的必需变量。

  • suggest_playbooks:根据自然语言请求对 playbook 进行排名。

  • inventory_graph:执行 ansible-inventory --graph

  • inventory_summary:总结清单中的组和主机。

  • syntax_check:执行 ansible-playbook --syntax-check

  • check_playbook:执行 ansible-playbook --check

  • run_playbook:执行实际的 playbook,默认阻止。

  • ping_hosts:执行 ansible -m pingansible.windows.win_ping

  • list_logstail_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、语法检查和检查模式,但会阻止实际执行 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 意图示例

  • “我该用哪个 playbook 来更新 wuday1 的 Windows?”

  • “对 Windows Update 的 playbook 使用 day=wuday1 进行语法检查。”

  • “仅在 rocky 组上以检查模式运行 Linux 更新。”

  • “显示 Citrix Day 的最新日志。”

  • “列出清单组以及每个组中有多少台主机。”

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    C
    quality
    F
    maintenance
    This 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.
    18
    26
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    Enterprise-grade MCP server exposing Ansible Automation Platform 2.x as a complete AI interface for LLMs, enabling natural language management of automation resources.
    86
    1
    Apache 2.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    Industry-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.
    10

View all related MCP servers

Related MCP Connectors

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

  • GibsonAI MCP server: manage your databases with natural language

  • Official Microsoft MCP Server to query Microsoft Entra data using natural language

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/infra-mdsystems/ansible_mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server