# @yawlabs/ansible-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/YawLabs/ansible-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 1125  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/yawlabs-ansible-mcp

## Description
Ansible MCP server for what is true in THIS checkout: installed module specs, task-argument checks, role interfaces, inventory (redacted), play structure, config, collection drift and collection-upgrade impact

## Tools
Capabilities this server exposes over MCP:

- **ansible_project_info** — What this Ansible checkout contains and how Ansible sees it: ansible-core version, effective config file, collections and roles paths, installed ansible-* binaries, detected playbooks, inventories, roles and requirements files. Call it first. Read-only; never connects to a managed host (AAP MCP covers controller state, ADT MCP takes actions).
- **ansible_module_doc** — Exact options (type, required, default, choices, aliases, suboptions) of a module or plugin as INSTALLED here (ansible-doc), with the collection version that provides it and redirects resolved. Use before writing a task; options drift between collection versions, so training-data guesses are often wrong.
- **ansible_module_search** — Find installed modules or plugins by name or description (ansible-doc -l), ranked exact name, prefix, token, then description match. Pass query, collection, or both.
- **ansible_check_task_args** — Check tasks (inline YAML, or a tasks file / playbook) against the INSTALLED module docs: unknown options, missing required ones, bad choices and types (YAML 1.1 aware: unquoted off/yes/0755), suboptions, deprecated options. ansible-doc cannot express cross-option rules (mutually_exclusive, required_if), so the answer says what it could not check; it catches action-plugin modules (copy, template) that ansible-lint's args rule skips.
- **ansible_role_interface** — A role's interface: argument_specs entry points and options (no_log honoured), defaults with redacted values, which defaults are undocumented, dependencies, vars names and galaxy_info. Works for local roles (roles_path, dir/roles, or a path) and collection roles (ns.collection.role).
- **ansible_inventory** — Groups, hosts and inventory-level vars (ansible-inventory --graph/--list/--host), always redacted: vault values, secret-like names and secret-shaped values are hidden, templates are shown unrendered. Script and plugin inventory sources run code, so they are skipped unless ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY=1 (which can also call cloud APIs); vault secrets are never supplied, so whole-file vaults degrade to a per-file view.
- **ansible_playbook_structure** — Plays, matched hosts, tasks (with module and file:line where unambiguous) and tags of a playbook (ansible-playbook --syntax-check, then --list-hosts --list-tasks --list-tags), plus deprecation warnings Ansible printed while parsing; never runs a play. Parses playbooks with Ansible: treat dir as code you would run --syntax-check on (play-level Jinja and playbook-adjacent vars plugins are evaluated); lookups in play-level fields are refused unless ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS=1.
- **ansible_config** — The effective configuration for this dir (ansible-config dump) with each setting's origin (ansible.cfg, env, default); galaxy server tokens and passwords are always redacted. Settings this server overrides for safety in its other tools (vault password files, inventory and vars plugins) are flagged.
- **ansible_collections** — requirements.yml (collections and roles) against what is installed: ok, VIOLATES (with file:line) or MISSING, using galaxy constraint rules, plus collections shadowed across collections paths (the first in COLLECTIONS_PATHS wins). Never installs anything.
- **ansible_lint_summary** — ansible-lint (offline) grouped by rule with counts, severities and file:line locations; never fixes anything (ADT MCP's ansible_lint fixes). Parses playbooks with Ansible: treat dir as code you would run --syntax-check on (play-level Jinja and playbook-adjacent vars plugins are evaluated); lookups in play-level fields are refused unless ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS=1.
- **ansible_upgrade_impact** — What breaks in THIS project's tasks if one collection moves to an exact version: removed or moved modules (meta/runtime.yml redirects and tombstones), removed options and aliases, newly required options, dropped choices, type and default changes, each tied to the task's file:line, plus requirements.yml constraints and a verdict. Downloads the target collection from Galaxy (or the configured servers) into this server's cache on first use; never touches dir, requirements files or your collections paths.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "ansible-mcp": {
    "command": "npx",
    "args": ["-y","@yawlabs/ansible-mcp@latest"]
  }
}
```

## Documentation

## What @yawlabs/ansible-mcp does

@yawlabs/ansible-mcp gives an MCP client visibility into the Ansible environment and project it is pointed at. Its source of truth is the installed Ansible and collection content on the control node, rather than training data or an assumed latest release.

The server is read-only. It can inspect module and plugin argument specifications, role interfaces, inventories, playbook structure, effective configuration, collection requirements, and offline lint results. It can also compare the modules used by a project with a specified collection version and identify likely task breakage.

Sensitive material is redacted. Inventory values are always redacted, secret-like configuration values are masked, vault markers are represented safely, and whole-file vaults are listed without being read.

## How it works

Every tool accepts an optional `dir` identifying the Ansible project. `ansible_project_info` is intended as the first call because it identifies the Ansible version, effective configuration, collections and roles paths, installed binaries, detected playbooks, inventories, roles, and requirements files.

The server uses local Ansible inspection commands such as `ansible-doc`, `ansible-config`, `ansible-inventory`, `ansible-playbook --syntax-check`, and collection or role listing commands. Task validation compares YAML against the installed documentation and reports unknown options, missing required arguments, invalid choices or types, suboption problems, duplicate keys, deprecated options, and YAML 1.1 concerns such as unquoted `off` or `0755`. It also states which cross-option rules the documentation cannot check instead of claiming a task is fully valid.

Collection upgrade analysis installs the target collection into a server-owned cache when needed, then compares relevant argument specifications and project requirements. This is the only operation that may contact Galaxy or configured collection servers. On macOS and Linux, Ansible runs locally; on Windows, the server invokes Ansible through WSL.

## Setup and configuration

Install it as an MCP command with the npm package through `npx`:

```json
{
  "command": "npx",
  "args": ["-y", "@yawlabs/ansible-mcp"]
}
```

Point tool calls at the project directory with `dir` when the checkout is not the default working directory. The server reads the Ansible installation, collection paths, roles, configuration, and project files available on that control node.

Dynamic inventory sources are disabled by default. Play-level lookups are also refused before Ansible parses a playbook unless explicitly enabled. Optional environment settings include `ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY=1` and `ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS=1`.

## Tools and capabilities

- `ansible_module_doc` returns installed module or plugin options, defaults, aliases, suboptions, deprecations, return data, examples, and collection version.
- `ansible_module_search` searches installed modules and plugins by name or description.
- `ansible_check_task_args` validates inline YAML, task files, or playbooks against installed documentation.
- `ansible_role_interface` reports role argument specifications, defaults, dependencies, variables, and Galaxy metadata.
- `ansible_inventory` shows groups, hosts, and inventory structure with values redacted.
- `ansible_playbook_structure` reports syntax-check results, plays, matched hosts, tasks, tags, locations, and parse warnings.
- `ansible_config` shows effective settings and their origins while flagging safety overrides.
- `ansible_collections` compares requirements with installed collections, including constraints and shadowed copies.
- `ansible_lint_summary` groups offline lint findings by rule, severity, count, and location.
- `ansible_upgrade_impact` identifies removed or moved modules, changed options, new requirements, choice and type changes, constraints, and an optional target syntax check.

## Limitations and notes

The server does not execute plays, modules, check mode, diffs, fact gathering, or connections to managed hosts. It never runs configured vault password scripts and does not accept vault secrets. Dynamic inventory, play-level lookups, and related code paths can execute project-controlled behavior when explicitly enabled, so the checkout should be treated as code being inspected by Ansible.

It complements tools that execute Ansible, fix lint issues, manage controller jobs, scaffold content, or build execution environments; those actions are outside this server’s scope.

_Full upstream README: https://allmcps.com/mcp/yawlabs-ansible-mcp/readme_

