@mhdd_24/ansible-mcp
Provides tools for interacting with Ansible, enabling availability checks, inventory host listing, playbook syntax checking, and playbook execution.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@mhdd_24/ansible-mcprun the playbook site.yml in production"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@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 toolsRelated MCP server: zerobyte-mcp
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-mcpOption B — npx
npx @mhdd_24/ansible-mcpOption 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.jsConfigure 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 binary |
| Default workdir |
Tools
Tool | Description |
| Check ansible / ansible-playbook availability. |
| List inventory hosts. |
| Syntax-check a playbook. |
| Run a playbook (confirm required). |
License
ISC
Available Tools
4 toolsansible_list_inventoryB
List inventory hosts.
| Name | Required | Description | Default |
|---|---|---|---|
| inventory | Yes | Inventory path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. 'List' weakly implies a read-only operation, but the description does not state whether it has side effects, requires special permissions, or how it behaves if the inventory path is invalid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. It is appropriately sized for a very simple tool with one parameter.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter list operation, the description is minimally adequate, but it lacks important context such as what the output looks like, error behavior, and whether the inventory path should be a file or directory. These gaps matter more because there is no output schema or annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides 100% coverage by describing the only parameter as 'Inventory path'. The description adds no additional meaning about the parameter, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and resource ('inventory hosts'), and the operation is clearly distinct from sibling tools like ansible_run_playbook and ansible_syntax_check. It stops short of a 5 because it does not explicitly differentiate itself or clarify the exact kind of inventory listing (e.g., hostnames only versus full inventory details).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no guidance on when to use this tool versus the sibling tools. It does not mention typical use cases, exclusions, or alternatives such as ansible_status.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ansible_run_playbookC
Run a playbook (confirm required).
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Must be true to execute | |
| playbook | Yes | Playbook | |
| extraVars | No | JSON extra-vars | |
| inventory | No | Inventory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It mentions that confirmation is required, which is useful, but it does not disclose that running a playbook can execute arbitrary changes on targets, require permissions, or have side effects. The description is too thin for a potentially impactful operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and the key safety requirement is front-loaded. It is not bloated, though for a tool that executes playbooks it could reasonably include one or two more sentences of context without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool can execute potentially impactful playbooks, has no annotations, and has no output schema, the description is not complete enough. It lacks any mention of side effects, prerequisites, error behavior, or how this relates to the safer sibling tools for validation and status checks.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description adds no extra meaning beyond the schema, and the 'confirm required' note merely restates the confirm parameter's schema description. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('Run a playbook') and a clear resource, which distinguishes it from siblings like ansible_syntax_check and ansible_status. However, it does not explicitly contrast itself with those alternatives or explain the nature of execution beyond the action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided about when to use this tool versus ansible_syntax_check, ansible_status, or ansible_list_inventory. An agent is left to infer that running is different from checking or listing, but there is no explicit context for prerequisites or safer alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ansible_statusA
Check ansible / ansible-playbook availability.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full behavioral burden. It states the check but does not disclose output format, success/failure indicators, or whether it inspects both executables separately.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. It communicates the core function efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter availability check, this is minimally adequate. However, with no output schema, the description does not clarify what a successful or failed availability result looks like, leaving mild ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so there is nothing for the description to add beyond the empty schema. The baseline of 4 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Check') and a clear resource ('ansible / ansible-playbook availability'). This is semantically distinct from the sibling tools, which handle inventory, syntax checks, and playbook runs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool instead of the siblings, nor when it should be skipped. The description does not mention preconditions or typical call contexts.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ansible_syntax_checkC
Syntax-check a playbook.
| Name | Required | Description | Default |
|---|---|---|---|
| playbook | Yes | Playbook path | |
| inventory | No | Inventory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of disclosing behavior. 'Syntax-check' implies a non-mutating validation operation, but the description doesn't state that the playbook is not executed, what happens on syntax errors, or whether inventory affects the check. This leaves key behavioral traits undisclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It is appropriately concise for the simple purpose, though it may err on the side of being too sparse to be fully self-contained.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description is the only source of context. It fails to clarify that this tool only validates syntax and does not run the playbook, which is crucial for distinguishing it from ansible_run_playbook. The description is too minimal to fully equip an agent for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both 'playbook' and 'inventory' are already documented in the input schema. The description adds no extra semantic context about how to use these parameters, such as path formats or the role of inventory in syntax checking, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action, 'Syntax-check', and a specific resource, 'a playbook'. This clearly conveys the tool's function and is distinctly different from sibling tools like ansible_run_playbook and ansible_status, though it does not explicitly name those siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention that syntax-checking is a prerequisite before running a playbook, nor does it contrast with ansible_run_playbook or ansible_status. The usage context must be inferred entirely.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
ansible_list_inventory - First observed
ansible_run_playbook - First observed
ansible_status - First observed
ansible_syntax_check
TDQS
Scored across 4 tools
Each tool targets a distinct action: checking environment, inventory listing, syntax validation, and playbook execution. There is no overlap in purpose, making selection unambiguous.
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.
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.
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.
Related MCP Connectors
Manage portable AI agent playbooks, Agent Skills, MCP configurations, personas, and memory.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Authenticated MCP server for ClearPolicy policy and compliance workflows.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables management and analysis of AWS security groups, S3 buckets, and VPC connections via MCP.7MIT
- FlicenseNot gradedqualityDmaintenanceEnables managing Zerobyte backups via MCP, including listing repositories, snapshots, schedules, and restoring backups.-
- AlicenseAqualityCmaintenanceEnables managing GitHub Actions workflows through MCP, including listing and inspecting workflows, triggering workflow_dispatch and repository_dispatch events, and monitoring or canceling workflow runs.718 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables inspecting and managing Kubernetes clusters through MCP, including listing deployments and pods, retrieving logs and events, and scaling or restarting deployments.-