Ansible MCP server

Integrates with Ansible to enable infrastructure automation through direct execution of playbooks, ad-hoc commands, inventory management, and AWS resource operations for DevOps workflows
Back to servers
Setup instructions
Provider
jascha
Release date
May 05, 2025
Language
Python
Stats
14 stars

MCP SysOperator is a Model Context Protocol server that enables AI assistants to directly manage infrastructure as code through Ansible and Terraform. It allows for executing playbooks, managing cloud resources, and performing infrastructure operations without requiring manual intervention.

Installation

Clone and Build

git clone https://github.com/tarnover/mcp-sysoperator.git
cd mcp-sysoperator
npm install
npm run build

Configure MCP Settings

Add the SysOperator server to your MCP settings configuration file:

For VSCode with Claude extension:

  • Edit ~/.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 this to the mcpServers section:

{
  "mcpServers": {
    "sysoperator": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-sysoperator/build/index.js"],
      "env": {}
    }
  }
}

Replace /absolute/path/to/mcp-sysoperator with your actual installation path.

Using SysOperator

Ansible Operations

Run a Playbook

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>run_playbook</tool_name>
<arguments>
{
  "playbook": "/path/to/your/playbook.yml",
  "inventory": "/path/to/inventory.ini",
  "extraVars": {
    "var1": "value1",
    "var2": "value2"
  },
  "tags": "setup,configure",
  "limit": "webservers"
}
</arguments>
</use_mcp_tool>

List Inventory

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>list_inventory</tool_name>
<arguments>
{
  "inventory": "/path/to/inventory.ini"
}
</arguments>
</use_mcp_tool>

Check Playbook Syntax

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>check_syntax</tool_name>
<arguments>
{
  "playbook": "/path/to/your/playbook.yml"
}
</arguments>
</use_mcp_tool>

List Tasks in a Playbook

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>list_tasks</tool_name>
<arguments>
{
  "playbook": "/path/to/your/playbook.yml"
}
</arguments>
</use_mcp_tool>

Access Default Inventory Resource

<access_mcp_resource>
<server_name>sysoperator</server_name>
<uri>sysoperator://inventory/default</uri>
</access_mcp_resource>

AWS Operations

List S3 Buckets

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>aws_s3</tool_name>
<arguments>
{
  "action": "list_buckets",
  "region": "us-east-1"
}
</arguments>
</use_mcp_tool>

Terraform Operations

Initialize a Terraform Project

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>terraform</tool_name>
<arguments>
{
  "action": "init",
  "workingDir": "/path/to/terraform/project"
}
</arguments>
</use_mcp_tool>

Create a Terraform Plan

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>terraform</tool_name>
<arguments>
{
  "action": "plan",
  "workingDir": "/path/to/terraform/project",
  "vars": {
    "instance_type": "t2.micro",
    "region": "us-west-2"
  }
}
</arguments>
</use_mcp_tool>

Apply Terraform Changes

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>terraform</tool_name>
<arguments>
{
  "action": "apply",
  "workingDir": "/path/to/terraform/project",
  "autoApprove": true,
  "vars": {
    "instance_type": "t2.micro",
    "region": "us-west-2"
  }
}
</arguments>
</use_mcp_tool>

LocalStack Integration

SysOperator includes integration with LocalStack for testing AWS operations locally:

Using Terraform with LocalStack

<use_mcp_tool>
<server_name>sysoperator</server_name>
<tool_name>terraform</tool_name>
<arguments>
{
  "action": "apply",
  "workingDir": "/path/to/terraform/project",
  "useLocalstack": true,
  "autoApprove": true,
  "vars": {
    "instance_type": "t2.micro",
    "region": "us-west-2"
  }
}
</arguments>
</use_mcp_tool>

LocalStack Setup

To use LocalStack functionality:

# Install LocalStack and awslocal CLI
pip install localstack awscli-local

# Start LocalStack
localstack start

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "sysoperator" '{"command":"node","args":["/absolute/path/to/mcp-sysoperator/build/index.js"],"env":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "sysoperator": {
            "command": "node",
            "args": [
                "/absolute/path/to/mcp-sysoperator/build/index.js"
            ],
            "env": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "sysoperator": {
            "command": "node",
            "args": [
                "/absolute/path/to/mcp-sysoperator/build/index.js"
            ],
            "env": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later