ansible-mcp-server
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., "@ansible-mcp-server Create an Ansible playbook to deploy nginx"
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.
Ansible MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to manage infrastructure using Ansible and Terraform.
Features
58 Infrastructure Management Tools
Ansible playbook creation and execution
Terraform infrastructure provisioning
Hardware discovery and inventory
Security scanning and auditing
Service deployment from catalog
Network device management
Environment management (test/staging/production)
AI-Optimized Design
Flexible playbook creation accepting YAML strings
Comprehensive error handling
Context persistence between sessions
Dynamic tool loading for services
Cross-Platform Support
Linux server deployment
Windows client support via SSE proxy
Remote server management
Related MCP server: Cloud Pilot MCP
Quick Start
Prerequisites
Node.js 16+
Ansible 2.9+
Terraform (optional)
Installation
# Clone the repository
git clone https://github.com/yourusername/ansible-mcp-server.git
cd ansible-mcp-server
# Install dependencies
npm install
# Copy and configure environment
cp .env.example .env
# Edit .env with your settings
# Run the server
npm startFor Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"ansible": {
"command": "node",
"args": ["/path/to/ansible-mcp-server/src/index.js"],
"env": {
"PROXMOX_HOST": "your-proxmox-host",
"PROXMOX_USER": "root@pam",
"PROXMOX_PASSWORD": "your-password"
}
}
}
}Windows Users
For Windows Claude Desktop, use the SSE proxy:
Deploy the MCP server to a Linux host
Run the SSE server on the Linux host
Configure Claude Desktop to use the Windows client
See Windows Setup Guide for details.
Available Tools
Ansible Tools
create-playbook-flexible- Create playbooks with YAML strings or objectsansible-playbook- Run Ansible playbooksansible-task- Run ad-hoc Ansible tasksansible-role- Execute Ansible rolesvalidate-playbook- Validate playbook syntaxcreate-role-structure- Generate Ansible role directories
Infrastructure Tools
hardware-scan- Comprehensive hardware discoverystorage-analysis- Storage and SMART health analysisnetwork-interfaces- Network adapter discoverydiscover-proxmox- Discover Proxmox VMsgenerate-inventory- Create Ansible inventories
Security Tools
security-quick-scan- Quick security assessmentsecurity-scan-ports- Port scanningsecurity-check-passwords- Password policy auditsecurity-audit-accounts- User account auditsecurity-check-ssh- SSH configuration audit
Service Management
browse-services- Browse service catalogdeploy-service- Deploy services from cataloglist-environments- List deployment environmentsdeploy-to-environment- Deploy with environment protection
Documentation
Testing
Run the comprehensive feature test suite:
# Run tests in development environment
npm test
# Test specific environments
npm run test:dev # Development
npm run test:qa # QA
npm run test:staging # Staging
npm run test:prod # Production
# Verbose output for debugging
npm run test:verboseOur feature tests validate complete VM lifecycle workflows including:
VM creation from Proxmox templates
Service installation (Jenkins, etc.)
Service verification and management
VM deletion and cleanup
MCP context management
See Testing Guidelines for detailed information.
Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built for use with Claude and other AI assistants
Uses the Model Context Protocol
Available Tools
87 toolsadd-external-serverB
Add an external server to the Ansible inventory
Inputs: name (required), ip (required), type (required), sshPort, +4 more.
ansible-playbookC
Run an Ansible playbook
Inputs: playbook (required), inventory, hosts, check, +7 more.
ansible-roleC
Run an Ansible role
Inputs: role (required), hosts, inventory, become, +3 more.
ansible-taskC
Run a single Ansible task ad-hoc
Inputs: task (required), hosts, inventory, become, +3 more.
browse-servicesC
Browse available services in the catalog with optional filtering
Inputs: category, search.
capture-stateB
Capture current infrastructure state for change tracking
Inputs: outputDir, includeDiagrams, captureConfigs.
check-node-capacityC
Check if a node has capacity for requested resources
Inputs: nodeName (required), requestedResources (required).
compare-inventory-stateA
Compare context inventory with live Proxmox inventory and detect deviations
Inputs: autoAlert, updateContext.
compare-service-requirementsC
Compare requirements for multiple services
Inputs: services (required).
create-acceptance-testC
Create an acceptance test deployment
Inputs: serviceName (required), testType (required), testConfig.
create-compliant-templateC
Create a new MCP-compliant template from a base VM
Inputs: baseVmId (required), templateName (required), osType.
create-playbookC
Create a new Ansible playbook file
Inputs: name (required), tasks (required), hosts, vars, +1 more.
create-playbook-flexibleB
Create an Ansible playbook with flexible input (YAML string or structured data)
Inputs: name (required), content (required), directory.
create-role-structureB
Create a complete Ansible role directory structure
Inputs: roleName (required), includeTasks, includeHandlers, includeTemplates, +1 more.
create-vm-enhancedB
Create VM in Proxmox and automatically update infrastructure context
Inputs: vmId (required), vmName (required), serviceName (required), vmIP (required), +5 more.
create-vm-templateC
Generate Terraform configuration for Proxmox VMs
Inputs: name (required), vmid (required), template (required), cores, +4 more.
delete-vm-enhancedB
Delete VM from Proxmox and automatically update infrastructure context
Inputs: vmId (required), serviceName (required), vmIP (required), vmName, +2 more.
deploy-serviceC
Deploy a service from the catalog by creating VM and configuring it
Inputs: serviceName (required), vmName (required), vmid (required), ipAddress, +1 more.
deploy-to-environmentC
Deploy a service to a specific environment
Inputs: serviceName (required), environment (required), config.
detect-existing-serviceC
Detect if a service is already installed in the infrastructure
Inputs: serviceName (required), searchMethod, port.
discover-ansible-controllerB
Discover existing Ansible controllers on the network
Inputs: subnet.
discover-network-devicesC
Discover devices on the network and classify them
Inputs: subnet, knownDevices.
discover-proxmoxB
Discover all VMs on a Proxmox server and extract their configuration
Inputs: proxmoxHost, proxmoxUser, proxmoxPassword, includeTemplates, +1 more.
discover-templatesC
Discover and validate all templates in infrastructure
Inputs: validateAll, fixNonCompliant.
find-best-nodeC
Find the best node for VM placement based on resources and preferences
Inputs: requiredResources (required), preferences.
fix-templateC
Fix non-compliant template issues
Inputs: templateId (required), issue (required), action (required), credentials.
generate-diagramB
Generate infrastructure diagram from current state
Inputs: format, includeNetworks, includeStorage.
generate-inventoryC
Generate an Ansible inventory file from discovered Proxmox VMs
Inputs: outputFile, groupBy, includeOffline.
generate-inventory-playbookC
Generate a playbook for gathering inventory information
Inputs: name (required), targetHosts, gatherFacts, outputFile.
generate-secure-passwordC
Generate a secure password for ansible-admin accounts
Inputs: length, includeSpecial.
get-best-practiceC
Get best practices for MCP operations
Inputs: topic (required).
get-configC
Get current configuration values
Inputs: section.
get-error-recoveryC
Get error recovery steps for common issues
Inputs: error (required).
get-mcp-contextB
Get stored context information from MCP
Inputs: key.
get-service-sopC
Get installation and management procedures for a specific service
Inputs: serviceName (required), section.
get-validation-checksC
Get validation checks for operations
Inputs: phase (required).
gpu-detectionC
Detect and analyze GPU hardware
Inputs: target, includeDriverInfo.
handle-duplicate-serviceC
Handle user decision for duplicate service
Inputs: serviceName (required), existingVm (required), action (required), options.
hardware-benchmarkC
Run basic hardware benchmarks
Inputs: target, tests, duration.
hardware-inventoryC
Manage hardware inventory database
Inputs: action (required), hostname, hardware.
hardware-scanC
Comprehensive hardware scan of a system
Inputs: target, categories, format, saveToInventory.
import-ansible-configB
Import configuration from existing Ansible controller
Inputs: controllerHost (required), sshUser, configTypes.
inventory-statusC
Check inventory status and staleness
Inputs: detailed.
list-environmentsA
List available deployment environments
Inputs: no named parameters.
list-hostsB
List all hosts in inventory
Inputs: inventory, group, format.
list-loaded-toolsA
List all currently loaded tools and services
Inputs: no named parameters.
list-service-sopsA
List all available service-specific SOPs
Inputs: no named parameters.
list-sopsC
List all available standard operating procedures
Inputs: category.
list-vm-credentialsB
List all VMs with stored credentials
Inputs: no named parameters.
load-service-toolsC
Load tools specific to a service
Inputs: serviceName (required).
manage-service-enhancedC
Manage services and automatically update their status in context
Inputs: serviceName (required), action (required), vmIP (required).
migrate-ssh-keysC
Migrate SSH keys from existing controller
Inputs: sourceHost (required), sshUser, keyTypes.
network-interfacesC
Detailed network interface information
Inputs: target, includeVirtual, includeStats.
process-deviationC
Process a specific inventory deviation with user decision
Inputs: deviationType (required), vmId (required), action (required), details.
proxmox-inventoryC
Discover and manage Proxmox infrastructure inventory
Inputs: action (required), force, categories.
query-sopC
Query standard operating procedures for common MCP operations
Inputs: operation (required), category, detailed.
remove-external-serverA
Remove an external server from inventory
Inputs: name (required).
retrieve-vm-credentialsB
Retrieve ansible-admin credentials for a VM
Inputs: vmId (required), decrypt.
security-audit-accountsC
Audit user accounts for security issues
Inputs: checkSudo, checkDefaults.
security-check-firewallB
Check firewall configuration and rules
Inputs: no named parameters.
security-check-passwordsC
Check for weak passwords and password policies
Inputs: checkPolicy.
security-check-sshC
Audit SSH configuration for security
Inputs: no named parameters.
security-check-updatesC
Check for security updates and vulnerable packages
Inputs: checkCVE.
security-quick-scanC
Run a quick security assessment covering basic checks
Inputs: target.
security-scan-portsC
Scan for open ports on specified hosts
Inputs: targets, portRange.
server-debugC
Run diagnostic commands for debugging
Inputs: command (required), safe.
server-healthD
Check server health and dependencies
Inputs: detailed.
server-logsC
Get server logs for debugging
Inputs: service (required), lines, since.
server-restartA
Restart MCP or SSE server to recover from errors
Inputs: service (required), reason.
service-detailsC
Get detailed information about a specific service
Inputs: serviceName (required).
set-mcp-contextB
Store context information in MCP for future sessions
Inputs: key (required), value.
setup-networkC
Configure network settings for VMs
Inputs: gateway (required), nameserver, networkCidr, domain.
setup-proxmoxC
Configure Proxmox connection settings
Inputs: host (required), user, password, apiTokenId, +3 more.
setup-servicesC
Configure IP addresses for services
Inputs: nextcloudIp, mailserverIp, keycloakIp, nginxIp.
setup-wizardA
Run interactive setup wizard to configure all settings
Inputs: no named parameters.
storage-analysisC
Detailed storage analysis including health checks
Inputs: target, includePartitions, includeSmartData.
store-vm-credentialsC
Store ansible-admin credentials for a VM in context
Inputs: vmId (required), vmName (required), vmIp (required), adminUser, +4 more.
terraform-applyB
Apply Terraform configuration to create/update infrastructure
Inputs: directory (required), autoApprove, target.
terraform-outputA
Get outputs from Terraform state
Inputs: directory (required), json.
terraform-planB
Create an execution plan for Terraform changes
Inputs: directory (required), destroy, target, varFile, +1 more.
test-connectionC
Test connection to configured services
Inputs: service (required).
test-server-connectivityC
Test connectivity to a server using various methods
Inputs: target (required), methods.
unload-service-toolsC
Unload tools specific to a service
Inputs: serviceName (required).
update-context-after-operationC
Update MCP context after successful VM or service operations
Inputs: operationType (required), entityId (required), updates (required).
update-ollama-modelsC
Update models on existing Ollama server
Inputs: vmIp (required), action (required), models.
validate-playbookB
Validate an Ansible playbook syntax
Inputs: playbook (required), syntaxCheck.
validate-templateC
Validate a template meets MCP standards
Inputs: templateId (required), testVmId, cleanup.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 87 tools
Several tools have unclear boundaries, such as create-playbook vs create-playbook-flexible, discover-proxmox vs proxmox-inventory, and test-server-connectivity vs test-connection. The large number of overlapping operational areas makes it easy for an agent to select the wrong tool despite mostly descriptive names.
The tool names consistently use lowercase hyphenated snake_case, which is readable. However, the pattern is mixed: many are verb_noun like create-playbook, but others are noun_noun like inventory-status or noun_verb like server-restart, so the convention is not strictly enforced.
With 87 tools, the server is dramatically over-scoped for an Ansible-focused MCP. Many tools cover tangential domains like Terraform, hardware benchmarking, security scanning, and server debugging, making the toolset unwieldy and difficult for agents to navigate effectively.
The toolset provides broad lifecycle coverage across Ansible playbooks, Proxmox VM management, inventory, credentials, services, security checks, and context persistence. Minor gaps exist, such as no explicit Terraform destroy/state tool or playbook update/delete, but overall agents have enough tools to complete most workflows without dead ends.
Maintenance
Related MCP Connectors
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
- Eyevinn Open Source CloudDeprecatedio.osaas.mcp
Your AI Agent's Infrastructure Layer. Connect Claude, Copilot, Codex, or ChatGPT to 200+ managed open source services. Start databases, pipelines, and applications through natural language.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Related MCP Servers
-licenseNot gradedqualityNot gradedmaintenanceEnables comprehensive DevOps infrastructure management through tools for Jenkins, Ansible, Terraform, Kubernetes, and Docker operations. Features a sophisticated memory system for context retention and provides validation, generation, and optimization capabilities across DevOps workflows.1-- AlicenseNot gradedqualityDmaintenanceProvides AI agents with natural language control over AWS, Azure, GCP, and Alibaba Cloud infrastructure through dynamic API discovery and execution. Supports 51,900+ cloud operations and includes OpenTofu integration for complete infrastructure lifecycle management.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform DevOps tasks including Kubernetes management, cloud provider operations, CI/CD, security scanning, and infrastructure monitoring through natural language.MIT
- FlicenseCqualityDmaintenanceEnables AI assistants to manage Ansible infrastructure, including inventories, playbooks, roles, and advanced troubleshooting with self-healing capabilities.39-