mcp-sysoperator
MCP for Ansible, Terraform, LocalStack, and other IaC tools. Create and iterate IaC
Documentation
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
git clone https://github.com/tarnover/mcp-sysoperator.git
cd mcp-sysoperator2. Install dependencies
npm install3. Build the server
npm run build4. 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:
{
"mcpServers": {
"sysoperator": {
"command": "node",
"args": ["/absolute/path/to/mcp-sysoperator/build/index.js"],
"env": {}
}
}
}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
sysoperator
run_playbook
{
"playbook": "/path/to/your/playbook.yml",
"inventory": "/path/to/inventory.ini",
"extraVars": {
"var1": "value1",
"var2": "value2"
},
"tags": "setup,configure",
"limit": "webservers"
}2. List Inventory
sysoperator
list_inventory
{
"inventory": "/path/to/inventory.ini"
}3. Check Playbook Syntax
sysoperator
check_syntax
{
"playbook": "/path/to/your/playbook.yml"
}4. List Tasks in a Playbook
sysoperator
list_tasks
{
"playbook": "/path/to/your/playbook.yml"
}5. Access Default Inventory Resource
sysoperator
sysoperator://inventory/default6. AWS S3 Operations
sysoperator
aws_s3
{
"action": "list_buckets",
"region": "us-east-1"
}7. Terraform Init and Plan
sysoperator
terraform
{
"action": "init",
"workingDir": "/path/to/terraform/project"
}
sysoperator
terraform
{
"action": "plan",
"workingDir": "/path/to/terraform/project",
"vars": {
"instance_type": "t2.micro",
"region": "us-west-2"
}
}8. Terraform Apply
sysoperator
terraform
{
"action": "apply",
"workingDir": "/path/to/terraform/project",
"autoApprove": true,
"vars": {
"instance_type": "t2.micro",
"region": "us-west-2"
}
}9. Terraform with LocalStack (tflocal)
sysoperator
terraform
{
"action": "apply",
"workingDir": "/path/to/terraform/project",
"useLocalstack": true,
"autoApprove": true,
"vars": {
"instance_type": "t2.micro",
"region": "us-west-2"
}
}LocalStack Integration
This project includes integration with LocalStack for testing AWS operations locally without real AWS credentials. The LocalStack integration allows you to:
1. Test Ansible playbooks that use AWS services locally
2. Develop and test AWS operations without incurring AWS costs
3. Run tests without requiring real AWS credentials
4. 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:
# Install LocalStack and awslocal CLI
pip install localstack awscli-local
# Start LocalStack
localstack start
# Run the sample playbook
node localstack/run_sample_playbook.mjsDevelopment
Project Structure
mcp-sysoperator/
├── src/
│ ├── index.ts # Main entry point
│ └── ansible-mcp-server/ # Will be renamed in filesystem in future updates
│ ├── index.ts # MCP SysOperator server implementation
│ ├── common/ # Common utilities and types
│ │ ├── errors.ts # Error definitions
│ │ ├── types.ts # Type and schema definitions
│ │ ├── utils.ts # Utility functions
│ │ └── version.ts # Version information
│ └── operations/ # Operation handlers
│ ├── ad_hoc.ts # Ansible ad-hoc commands
│ ├── aws.ts # AWS operations
│ ├── inventory.ts # Ansible inventory operations
│ ├── playbooks.ts # Ansible playbook operations
│ ├── terraform.ts # Terraform operations
│ └── vault.ts # Ansible vault operations
├── localstack/ # LocalStack integration
│ ├── README.md # LocalStack documentation
│ ├── sample_playbook.yml # Sample playbook for LocalStack
│ ├── inventory.ini # Sample inventory for LocalStack
│ ├── run_sample_playbook.mjs # Script to run sample playbook
│ └── utils.localstack.ts # Modified utils for LocalStack
├── package.json # Project configuration and dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # DocumentationAdding New Features
To add new capabilities to the MCP server:
1. Modify `src/ansible-mcp-server/index.ts` (future: `src/sysoperator/index.ts`)
2. Add your new tool in the `setupToolHandlers` method
3. Implement a handler function for your tool in the appropriate operations file
4. Add the schema definition in `common/types.ts`
5. 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
Frequently asked questions
What is mcp-sysoperator?
mcp-sysoperator is MCP for Ansible, Terraform, LocalStack, and other IaC tools. Create and iterate IaC
How do I install mcp-sysoperator?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-sysoperator open source?
Yes — it is hosted on GitHub at https://github.com/tarnover/mcp-ansible and has 18 stars.
Related MCP tools
MCP 资源精选, MCP指南,Claude MCP,MCP Servers, MCP Clients Trusted by 4800+ developers. Trusted by 4800+ developers. Trusted by 4800+ developers.
MCP Aggregator, Orchestrator, Middleware, Gateway in one docker TypeScript-based implementation. Trusted by 1400+ developers.
A Unified MCP Server Management App TypeScript-based implementation. Trusted by 800+ developers. Trusted by 800+ developers.
A Model Context Protocol (MCP) server implementation for remote memory bank management, inspired by Cline Memory Bank. TypeScript-based implementation.
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
A Minecraft MCP Server powered by Mineflayer API. It allows to control a Minecraft character in real-time, allowing AI assistants to build structures, explor...
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP