The Ansible MCP Server enables AI assistants to manage infrastructure as code with the following capabilities:
- Ansible Operations:
- Run playbooks with customizable parameters (inventory, extra vars, tags, limits)
- List inventory hosts and groups
- Check playbook syntax
- Preview playbook tasks
- Execute ad-hoc commands
- Encrypt/decrypt with Ansible Vault
- Create dynamic AWS inventory
- AWS Management:
- EC2 instances (list, create, start, stop, terminate)
- S3 buckets and objects
- VPC networks
- CloudFormation stacks
- IAM roles and policies
- RDS database instances
- Route53 DNS records and zones
- Elastic Load Balancers
- Lambda functions
- Terraform Support:
- Execute commands (init, plan, apply, destroy, output)
- LocalStack Integration:
- Test AWS operations locally without real credentials
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.
MCP SysOperator
A Model Context Protocol (MCP) server for Infrastructure as Code operations. This server allows AI assistants to interact with Ansible and Terraform, execute playbooks and Terraform plans, manage cloud resources, and perform other infrastructure operations directly.
(Project previously known as mcp-ansible)
Demo Projects
All code in demos generated using Claude 3.7 Sonnet (via OpenRouter), Cline, and SysOperator
- AWS LAMP Stack - All Ansible code to deploy example LAMP stack in AWS
- AWS Terraform LAMP - Terraform and Ansible code to reply a LAMP stack
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
- AWS Integration: Manage AWS resources (EC2, S3, VPC, CloudFormation, etc.)
- Terraform Support: Execute Terraform commands (init, plan, apply, destroy, output, etc.)
- tflocal Integration: Test Terraform configurations with LocalStack for local cloud development
- LocalStack Support: Test AWS operations locally using LocalStack without real AWS credentials
Requirements
- Node.js 18 or higher
- npm or yarn
- Ansible installed and in PATH
- @modelcontextprotocol/sdk (installed automatically)
- For AWS operations: AWS CLI and valid credentials
- For LocalStack: LocalStack installed and running, awslocal CLI
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-sysoperator
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
6. AWS S3 Operations
7. Terraform Init and Plan
8. Terraform Apply
9. Terraform with LocalStack (tflocal)
LocalStack Integration
This project includes integration with LocalStack for testing AWS operations locally without real AWS credentials. The LocalStack integration allows you to:
- Test Ansible playbooks that use AWS services locally
- Develop and test AWS operations without incurring AWS costs
- Run tests without requiring real AWS credentials
- Validate your infrastructure code before deploying to real AWS
Using LocalStack
See the LocalStack README for detailed instructions on using the LocalStack integration.
Quick start:
Development
Project Structure
Adding New Features
To add new capabilities to the MCP server:
- Modify
src/ansible-mcp-server/index.ts
(future:src/sysoperator/index.ts
) - Add your new tool in the
setupToolHandlers
method - Implement a handler function for your tool in the appropriate operations file
- Add the schema definition in
common/types.ts
- Rebuild with
npm run build
⚠️ Disclaimer
SysOperator is currently in active development and undergoing extensive testing. It is not recommended for use in production environments at this time. The software may experience breaking changes, incomplete features, or unexpected behavior.
Use at your own risk.
License
MIT License - See LICENSE for details
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
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
- -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
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with Azure DevOps services, allowing users to query work items with plans to support creating/updating items, managing pipelines, handling pull requests, and administering sprints and branch policies.Last updated -916PythonMIT License