Skip to main content
Glama
@mhdd_24/ansible-mcp

@mhdd_24/ansible-mcp

by Mhdd-24

@mhdd_24/ansible-mcp

MCP server for Ansible: playbooks, inventories, and execution.

Same architecture as @mhdd_24/sublime-mcp.

Full documentation: docs/WIKI.md


How it works (30 seconds)

You (chat) → MCP client → ansible-mcp → Ansible APIs / CLIs / local tools

Related MCP server: AAP MCP Server

Prerequisites

Requirement

Notes

Node.js 18+

ESM TypeScript MCP server

Credentials / CLIs

See environment variables below


Install

Option A — npm (after publish)

npm install -g @mhdd_24/ansible-mcp

Option B — npx

npx @mhdd_24/ansible-mcp

Option C — clone and build

git clone https://github.com/Mhdd-24/Ansible-MCP.git
cd Ansible-MCP
npm install
npm run build
node dist/index.js

Configure Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "ansible": {
      "command": "npx",
      "args": ["-y", "@mhdd_24/ansible-mcp"],
      "env": {
        "ANSIBLE_PLAYBOOK_BIN": "...",
        "ANSIBLE_WORKDIR": "..."
      }
    }
  }
}

Local development:

{
  "command": "node",
  "args": ["/absolute/path/to/Ansible-MCP/dist/index.js"]
}

Environment variables

Variable

Description

ANSIBLE_PLAYBOOK_BIN

ansible-playbook binary

ANSIBLE_WORKDIR

Default workdir


Tools

Tool

Description

ansible_status

Check ansible / ansible-playbook availability.

ansible_list_inventory

List inventory hosts.

ansible_syntax_check

Syntax-check a playbook.

ansible_run_playbook

Run a playbook (confirm required).


License

ISC

Available Tools

4 tools
ansible_list_inventoryB

List inventory hosts.

Inputs: inventory (required).

ansible_run_playbookC

Run a playbook (confirm required).

Inputs: playbook (required), confirm, extraVars, inventory.

ansible_statusA

Check ansible / ansible-playbook availability.

Inputs: no named parameters.

ansible_syntax_checkC

Syntax-check a playbook.

Inputs: playbook (required), inventory.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct action: checking environment, inventory listing, syntax validation, and playbook execution. There is no overlap in purpose, making selection unambiguous.

    Naming Consistency5/5

    All tools follow the same ansible_ prefix followed by clear verb_noun structure. This consistent pattern makes the tool names predictable and easy to scan.

    Tool Count5/5

    With only 4 tools, the server is tightly scoped to the core Ansible workflows. Every tool addresses a fundamental need and none feel redundant or unnecessary.

    Completeness4/5

    The server covers the main lifecycle for working with Ansible: verify availability, inspect inventory, validate playbooks, and run them. Missing are advanced features like ad-hoc commands or detailed inventory introspection, but these are not essential for basic operation.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers