Integrations
Allows AI assistants to execute Ansible playbooks, view and manage inventory, validate playbook syntax, and preview tasks that would be executed by a playbook.
Serves as the runtime environment for the MCP server, allowing the Ansible integration to operate.
Ansible MCP Server
A Model Context Protocol (MCP) server for Ansible automation. This server allows AI assistants to interact with Ansible, execute playbooks, manage inventory, and perform other Ansible operations directly.
Features
- Run Ansible Playbooks: Execute Ansible playbooks with support for parameters like inventory, extra vars, tags, and limits
- List Inventory: View hosts and groups from an Ansible inventory file
- Check Syntax: Validate Ansible playbook syntax without execution
- List Tasks: Preview tasks that would be executed by a playbook
- Access Default Inventory: Access the default Ansible inventory file via resource API
Requirements
- Node.js 18 or higher
- npm or yarn
- Ansible installed and in PATH
- @modelcontextprotocol/sdk (installed automatically)
Installation
1. Clone the repository
2. Install dependencies
3. Build the server
4. Configure MCP settings
Add the Ansible MCP server to your MCP settings configuration file.
For VSCode with Claude extension:
- Edit the file at
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
For Claude Desktop app:
- macOS: Edit
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: Edit
%APPDATA%\Claude\claude_desktop_config.json
- Linux: Edit
~/.config/Claude/claude_desktop_config.json
Add the following to the mcpServers
section:
Make sure to replace /absolute/path/to/mcp-ansible
with the actual path to your installation.
Usage Examples
Once installed and configured, the MCP server provides the following tools to the AI assistant:
1. Run a Playbook
2. List Inventory
3. Check Playbook Syntax
4. List Tasks in a Playbook
5. Access Default Inventory Resource
Development
Project Structure
Adding New Features
To add new Ansible capabilities to the MCP server:
- Modify
src/ansible-mcp-server/index.ts
- Add your new tool in the
setupToolHandlers
method - Implement a handler function for your tool
- Rebuild with
npm run build
License
MIT License - See LICENSE for details
You must be authenticated.
Tools
This Model Context Protocol server enables AI assistants to interact directly with Ansible, allowing them to execute playbooks, manage inventory, check syntax, and perform other Ansible operations.
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that allows secure execution of pre-approved commands, enabling AI assistants to safely interact with the user's system.Last updated -1318JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to access Flow blockchain data and perform operations such as checking balances, resolving domains, executing scripts, and submitting transactions.Last updated -JavaScript
- -securityFlicense-qualityA Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.Last updated -1TypeScript
- -securityAlicense-qualityA Model Context Protocol server that connects AI assistants like Claude to Moneybird accounting software, enabling management of contacts, financial data, products, and business operations through natural language.Last updated -1JavaScriptMIT License