A

Ansible MCP

by YawLabs · io.github.YawLabs/ansible-mcp

Read-only server that reports what is actually true in a local Ansible checkout: the option specs of installed modules, task-argument validity checks, role interfaces, redacted inventory, play structure, effective config, requirements drift, and which tasks a collection upgrade would break. It lets coding agents verify specs and arguments against the installed collections before writing anything, without running plays, connecting to managed hosts, or supplying vault secrets.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-yawlabs-ansible-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ansible-mcp"
      ],
      "env": {
        "OAM_BIN": "<VALUE>",
        "ANSIBLE_MCP_DIR": "the server's working directory",
        "OAM_INSTALL_DIR": "<VALUE>",
        "ANSIBLE_MCP_CACHE": "~/.cache/ansible-mcp",
        "ANSIBLE_MCP_BIN_DIR": "<VALUE>",
        "ANSIBLE_MCP_RUNTIME": "auto",
        "ANSIBLE_MCP_PASS_ENV": "<VALUE>",
        "ANSIBLE_MCP_PATH_STYLE": "auto",
        "ANSIBLE_MCP_TIMEOUT_MS": "120000",
        "ANSIBLE_MCP_REMOTE_CACHE": "$HOME/.cache/ansible-mcp on the Ansible side",
        "ANSIBLE_MCP_COMMAND_PREFIX": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY": "<VALUE>"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-yawlabs-ansible-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ansible-mcp"
      ],
      "env": {
        "OAM_BIN": "<VALUE>",
        "ANSIBLE_MCP_DIR": "the server's working directory",
        "OAM_INSTALL_DIR": "<VALUE>",
        "ANSIBLE_MCP_CACHE": "~/.cache/ansible-mcp",
        "ANSIBLE_MCP_BIN_DIR": "<VALUE>",
        "ANSIBLE_MCP_RUNTIME": "auto",
        "ANSIBLE_MCP_PASS_ENV": "<VALUE>",
        "ANSIBLE_MCP_PATH_STYLE": "auto",
        "ANSIBLE_MCP_TIMEOUT_MS": "120000",
        "ANSIBLE_MCP_REMOTE_CACHE": "$HOME/.cache/ansible-mcp on the Ansible side",
        "ANSIBLE_MCP_COMMAND_PREFIX": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY": "<VALUE>"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-yawlabs-ansible-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ansible-mcp"
      ],
      "env": {
        "OAM_BIN": "<VALUE>",
        "ANSIBLE_MCP_DIR": "the server's working directory",
        "OAM_INSTALL_DIR": "<VALUE>",
        "ANSIBLE_MCP_CACHE": "~/.cache/ansible-mcp",
        "ANSIBLE_MCP_BIN_DIR": "<VALUE>",
        "ANSIBLE_MCP_RUNTIME": "auto",
        "ANSIBLE_MCP_PASS_ENV": "<VALUE>",
        "ANSIBLE_MCP_PATH_STYLE": "auto",
        "ANSIBLE_MCP_TIMEOUT_MS": "120000",
        "ANSIBLE_MCP_REMOTE_CACHE": "$HOME/.cache/ansible-mcp on the Ansible side",
        "ANSIBLE_MCP_COMMAND_PREFIX": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY": "<VALUE>"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-yawlabs-ansible-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ansible-mcp"
      ],
      "env": {
        "OAM_BIN": "<VALUE>",
        "ANSIBLE_MCP_DIR": "the server's working directory",
        "OAM_INSTALL_DIR": "<VALUE>",
        "ANSIBLE_MCP_CACHE": "~/.cache/ansible-mcp",
        "ANSIBLE_MCP_BIN_DIR": "<VALUE>",
        "ANSIBLE_MCP_RUNTIME": "auto",
        "ANSIBLE_MCP_PASS_ENV": "<VALUE>",
        "ANSIBLE_MCP_PATH_STYLE": "auto",
        "ANSIBLE_MCP_TIMEOUT_MS": "120000",
        "ANSIBLE_MCP_REMOTE_CACHE": "$HOME/.cache/ansible-mcp on the Ansible side",
        "ANSIBLE_MCP_COMMAND_PREFIX": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY": "<VALUE>"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-yawlabs-ansible-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ansible-mcp"
      ],
      "env": {
        "OAM_BIN": "<VALUE>",
        "ANSIBLE_MCP_DIR": "the server's working directory",
        "OAM_INSTALL_DIR": "<VALUE>",
        "ANSIBLE_MCP_CACHE": "~/.cache/ansible-mcp",
        "ANSIBLE_MCP_BIN_DIR": "<VALUE>",
        "ANSIBLE_MCP_RUNTIME": "auto",
        "ANSIBLE_MCP_PASS_ENV": "<VALUE>",
        "ANSIBLE_MCP_PATH_STYLE": "auto",
        "ANSIBLE_MCP_TIMEOUT_MS": "120000",
        "ANSIBLE_MCP_REMOTE_CACHE": "$HOME/.cache/ansible-mcp on the Ansible side",
        "ANSIBLE_MCP_COMMAND_PREFIX": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY": "<VALUE>"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-yawlabs-ansible-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ansible-mcp"
      ],
      "env": {
        "OAM_BIN": "<VALUE>",
        "ANSIBLE_MCP_DIR": "the server's working directory",
        "OAM_INSTALL_DIR": "<VALUE>",
        "ANSIBLE_MCP_CACHE": "~/.cache/ansible-mcp",
        "ANSIBLE_MCP_BIN_DIR": "<VALUE>",
        "ANSIBLE_MCP_RUNTIME": "auto",
        "ANSIBLE_MCP_PASS_ENV": "<VALUE>",
        "ANSIBLE_MCP_PATH_STYLE": "auto",
        "ANSIBLE_MCP_TIMEOUT_MS": "120000",
        "ANSIBLE_MCP_REMOTE_CACHE": "$HOME/.cache/ansible-mcp on the Ansible side",
        "ANSIBLE_MCP_COMMAND_PREFIX": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS": "<VALUE>",
        "ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY": "<VALUE>"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
OAM_BIN No Path to the oam binary to use. Otherwise the launcher checks `OAM_INSTALL_DIR`, the installed locations (`~/.oam/bin`, and `%LOCALAPPDATA%\oam\bin` on Windows) and `PATH`, and takes the newest.
ANSIBLE_MCP_DIR No Project used when a tool call passes no `dir`. Default: the server's working directory
OAM_INSTALL_DIR No Directory the launcher checks for the oam binary when `OAM_BIN` is not set.
ANSIBLE_MCP_CACHE No Server-side cache (and the Ansible-side one in native mode): the dummy vault file, local temp, upgrade targets. Safe to delete. Default: ~/.cache/ansible-mcp
ANSIBLE_MCP_BIN_DIR No Ansible-side directory holding `ansible-*` (a venv's `bin`). Also put first on the child's `PATH` (ansible-lint needs `ansible-playbook` next to it). Unset uses `PATH`.
ANSIBLE_MCP_RUNTIME No `auto`: the newest oam at 0.19.0 or newer, else Node. `oam`: oam or exit with an error. `node`: always Node -- the escape hatch when a problem only shows up under oam. Default: auto
ANSIBLE_MCP_PASS_ENV No Comma-separated names of server env vars to forward to the Ansible side in prefix mode.
ANSIBLE_MCP_PATH_STYLE No `wsl` or `native`. `auto` is `wsl` when the prefix starts with `wsl`/`wsl.exe`. Other prefixes (`ssh`, `docker exec`) get `env -C <dir> ...` and are best effort. Default: auto
ANSIBLE_MCP_TIMEOUT_MS No Kill any Ansible command after this long (the upgrade download gets 3x). Default: 120000
ANSIBLE_MCP_REMOTE_CACHE No The Ansible-side cache in prefix mode. Default: $HOME/.cache/ansible-mcp on the Ansible side
ANSIBLE_MCP_COMMAND_PREFIX No JSON array prepended to every Ansible command, e.g. ["wsl.exe","-d","Ubuntu","--exec"]. A value not starting with `[` is split on whitespace. Required on Windows (Ansible inside WSL). Unset means native execution.
ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS No `1` lets playbooks with lookups in play-level `name` / `hosts` / `vars_files` be parsed (Ansible runs those lookups on this machine). Unset refuses them.
ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY No `1` re-enables script, constructed and plugin inventory sources (they run code and may call cloud APIs). Unset disables them.

Similar servers