Install
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
Windows / Linux path
%APPDATA%\Claude\claude_desktop_config.json~/.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
.cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global).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
.mcp.json (project) or %USERPROFILE%\.claude.json (global).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
.vscode\mcp.json.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
%USERPROFILE%\.codeium\windsurf\mcp_config.json~/.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
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json~/.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.
| Name | Required | Description |
|---|---|---|
| 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. |