ansible-flow-mcp
MCP server that exposes Ansible modules to AI agents with a search-schema-check-execute workflow, enabling safe ad-hoc runs via check mode by default. It provides tools to search modules, fetch schemas, run modules, and list collections.
README
ansible-flow-mcp
MCP server that exposes Ansible modules and playbooks to AI agents:
search → schema → check → execute
<p align="center"> <img src="docs/images/architecture.png" alt="Dual-track architecture with OpenFlow" width="720" /> </p>
Dual-tracked with OpenFlow Ansible canvas gallery
(plan · OpenFlow umbrella · validation).
Not affiliated with Red Hat or the Ansible project beyond using the public Ansible CLI and docs.
Requirements
- Python ≥ 3.11
ansible/ansible-coreonPATHfor real runs (unit tests mock the CLI)- Collection
ansible.posix(JSON stdout callbackansible.posix.jsonon ansible-core ≥ 2.15) - Other collections you intend to use installed on the control node
python3 -m pip install --user 'ansible-core>=2.16,<2.19'
export PATH="$HOME/.local/bin:$PATH"
ansible-galaxy collection install ansible.posix
Install (dev)
cd ansible-flow-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
Run (stdio MCP)
ansible-flow-mcp
# or: python -m ansible_flow_mcp.server
Cursor / Claude Desktop
See examples/cursor-mcp.json and examples/claude-desktop.json.
Local path example:
{
"mcpServers": {
"ansible-flow": {
"command": "/path/to/ansible-flow-mcp/.venv/bin/ansible-flow-mcp"
}
}
}
Tools
| Tool | Purpose |
|---|---|
search_modules |
Gallery search |
get_module_schema |
Slim argSpec for FQCN |
run_module |
Ad-hoc ansible (check_mode default true) |
run_playbook |
ansible-playbook on a path-jailed .yml |
list_collections |
Collections in gallery |
Agent ritual (modules)
search_modulesget_module_schemarun_module(..., check_mode=true)run_module(..., check_mode=false)if appropriate
Agent ritual (playbooks)
- Confirm playbook path is under an allowlisted root
run_playbook(..., check_mode=true)run_playbook(..., check_mode=false)if appropriate
<p align="center"> <img src="docs/images/gallery-concept.png" alt="Module gallery concept (shared with OpenFlow)" width="640" /> </p>
Catalog
catalog/collections-allowlist.yml— allowed collections + denied free-form modulescatalog/gallery.json— searchable module listcatalog/schemas/*.json— optional UI/agent schemas (full gallery coverage)
Regenerate when ansible-doc is available:
pip install pyyaml
python scripts/generate_catalog.py
Galaxy factory (top collections)
Scrape top Galaxy collections by download count, queue module schema jobs, merge into the gallery — OpenFlow-style TUI:
python scripts/factory/tui.py
# or headless:
python scripts/factory/scrape_galaxy.py --top 40 --enqueue
python scripts/factory/queue_worker.py
See scripts/factory/README.md.
Env
| Variable | Meaning |
|---|---|
ANSIBLE_FLOW_CATALOG_DIR |
Override catalog path |
ANSIBLE_FLOW_COLLECTIONS |
Comma-separated collection allowlist override |
ANSIBLE_FLOW_INVENTORY |
Default -i inventory |
ANSIBLE_FLOW_TIMEOUT |
Seconds (default 120 module / 300 playbook) |
ANSIBLE_FLOW_PLAYBOOK_ROOTS |
Extra colon-separated playbook path roots |
OPENFLOW_ANSIBLE_PLAYBOOK_ROOTS |
Same roots (OpenFlow-compatible alias) |
Default playbook roots include cwd, ./playbooks, ./ansible, /data/ansible, and the system temp dir. Max playbook size 2MB; .yml / .yaml only.
Security
See docs/SECURITY.md. Free-form modules (command/shell/raw/script) are denied by default. Playbooks are path-jailed. CLI is argv-only (no shell interpolation). Structured output uses ansible.posix.json.
OpenFlow parity
| OpenFlow | This MCP server |
|---|---|
| Palette Ansible gallery | search_modules |
| Form | JSON module options | get_module_schema + run_module args |
| Playbook resource | run_playbook |
ansibleSsh / become |
Inventory / Ansible config on the control node |
Golden runner fixtures under tests/fixtures/ define the shared result shape for OpenFlow’s openflow-node-base.ansible executor (TypeScript port).
OpenFlow docs: docs/ansible.md
License
Apache-2.0
Publish (PyPI)
pip install build twine
python -m build
# twine upload dist/*
Or from git:
uvx --from ansible-flow-mcp ansible-flow-mcp
Schemas cover the full committed gallery (builtin + popular collections). Regenerate with scripts/generate_catalog.py when ansible-doc is available.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。