Skip to main content
Glama
Ansible MCP Server
by tarnover

MCP 시스템 운영자

Infrastructure as Code 작업을 위한 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버를 통해 AI 어시스턴트는 Ansible 및 Terraform과 상호 작용하고, 플레이북 및 Terraform 계획을 실행하고, 클라우드 리소스를 관리하고, 기타 인프라 작업을 직접 수행할 수 있습니다.
(이전에는 mcp-ansible 로 알려졌던 프로젝트)

데모 프로젝트

데모의 모든 코드는 Claude 3.7 Sonnet(OpenRouter를 통해), Cline 및 SysOperator를 사용하여 생성되었습니다.

  • AWS LAMP 스택 - AWS에 예제 LAMP 스택을 배포하기 위한 모든 Ansible 코드

  • AWS Terraform LAMP - LAMP 스택에 응답하는 Terraform 및 Ansible 코드

Related MCP server: AAP MCP Server

특징

  • Ansible 플레이북 실행 : 인벤토리, 추가 변수, 태그 및 제한과 같은 매개변수를 지원하는 Ansible 플레이북을 실행합니다.

  • 인벤토리 목록 : Ansible 인벤토리 파일에서 호스트 및 그룹 보기

  • 구문 확인 : 실행 없이 Ansible 플레이북 구문 검증

  • 작업 목록 : 플레이북에서 실행될 작업을 미리 봅니다.

  • 기본 인벤토리 액세스 : 리소스 API를 통해 기본 Ansible 인벤토리 파일에 액세스합니다.

  • AWS 통합 : AWS 리소스(EC2, S3, VPC, CloudFormation 등)를 관리합니다.

  • Terraform 지원 : Terraform 명령(init, plan, apply, destroy, output 등)을 실행합니다.

  • tflocal 통합 : 로컬 클라우드 개발을 위해 LocalStack을 사용하여 Terraform 구성 테스트

  • LocalStack 지원 : 실제 AWS 자격 증명 없이 LocalStack을 사용하여 로컬에서 AWS 작업을 테스트합니다.

요구 사항

  • Node.js 18 이상

  • npm 또는 yarn

  • Ansible이 설치되고 PATH에 있음

  • @modelcontextprotocol/sdk (자동으로 설치됨)

  • AWS 작업의 경우: AWS CLI 및 유효한 자격 증명

  • LocalStack의 경우: LocalStack이 설치되고 실행 중이고 awslocal CLI가 있습니다.

설치

1. 저장소를 복제합니다.

지엑스피1

2. 종속성 설치

npm install

3. 서버를 구축하세요

npm run build

4. MCP 설정 구성

MCP 설정 구성 파일에 Ansible MCP 서버를 추가합니다.

Claude 확장 기능이 있는 VSCode의 경우:

  • ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json 파일을 편집하세요.

Claude Desktop 앱의 경우:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 편집하세요.

  • Windows: %APPDATA%\Claude\claude_desktop_config.json 편집하세요.

  • Linux: ~/.config/Claude/claude_desktop_config.json 편집하세요.

mcpServers 섹션에 다음을 추가합니다.

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

/absolute/path/to/mcp-sysoperator 실제 설치 경로로 바꿔야 합니다.

사용 예

MCP 서버를 설치하고 구성하면 AI 어시스턴트에 다음 도구가 제공됩니다.

1. 플레이북 실행

<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>

2. 재고 목록

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

3. 플레이북 구문 확인

<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>

4. 플레이북에 작업 나열

<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>

5. 기본 인벤토리 리소스에 액세스

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

6. AWS S3 작업

<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>

7. Terraform Init 및 Plan

<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>

<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>

8. Terraform 적용

<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>

9. LocalStack(tflocal)을 사용한 Terraform

<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 통합

이 프로젝트에는 실제 AWS 자격 증명 없이 로컬에서 AWS 작업을 테스트할 수 있도록 LocalStack과의 통합이 포함되어 있습니다. LocalStack 통합을 통해 다음을 수행할 수 있습니다.

  1. AWS 서비스를 로컬로 사용하는 Ansible 플레이북 테스트

  2. AWS 비용 없이 AWS 운영을 개발하고 테스트하세요

  3. 실제 AWS 자격 증명이 필요하지 않고 테스트 실행

  4. 실제 AWS에 배포하기 전에 인프라 코드를 검증하세요.

LocalStack 사용하기

LocalStack 통합을 사용하는 방법에 대한 자세한 지침은 LocalStack README를 참조하세요.

빠른 시작:

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

# Start LocalStack
localstack start

# Run the sample playbook
node localstack/run_sample_playbook.mjs

개발

프로젝트 구조

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                     # Documentation

새로운 기능 추가

MCP 서버에 새로운 기능을 추가하려면:

  1. src/ansible-mcp-server/index.ts 수정(향후: src/sysoperator/index.ts )

  2. setupToolHandlers 메서드에 새 도구를 추가합니다.

  3. 적절한 작업 파일에서 도구에 대한 핸들러 기능을 구현하세요.

  4. common/types.ts 에 스키마 정의를 추가합니다.

  5. npm run build 로 다시 빌드하세요

⚠️ 면책 조항

SysOperator는 현재 활발하게 개발 중이며 광범위한 테스트를 진행하고 있습니다. 현재 운영 환경에서의 사용은 권장하지 않습니다. 소프트웨어에 중대한 변경, 불완전한 기능 또는 예기치 않은 동작이 발생할 수 있습니다.

사용 시 모든 책임은 사용자에게 있습니다.

특허

MIT 라이선스 - 자세한 내용은 라이선스를 참조하세요.

Available Tools

18 tools
aws_cloudformationC

Manage AWS CloudFormation stacks

Inputs: action (required), region (required), capabilities, parameters, +4 more.

aws_dynamic_inventoryC

Create AWS dynamic inventory

Inputs: region (required), compose, filters, hostnames, +1 more.

aws_ec2C

Manage AWS EC2 instances (list, create, start, stop, terminate)

Inputs: action (required), region (required), count, filters, +9 more.

aws_elbC

Manage AWS Elastic Load Balancers

Inputs: action (required), region (required), healthCheck, lbType, +7 more.

aws_iamC

Manage AWS IAM roles and policies

Inputs: action (required), region (required), assumeRolePolicyDocument, managedPolicies, +5 more.

aws_lambdaC

Manage AWS Lambda functions

Inputs: action (required), region (required), description, environment, +12 more.

aws_rdsC

Manage AWS RDS database instances

Inputs: action (required), region (required), allocatedStorage, backupRetentionPeriod, +10 more.

aws_route53C

Manage AWS Route53 DNS records and zones

Inputs: action (required), region (required), comment, recordName, +6 more.

aws_s3C

Manage AWS S3 buckets and objects

Inputs: action (required), region (required), acl, bucket, +5 more.

aws_vpcC

Manage AWS VPC networks

Inputs: action (required), region (required), cidrBlock, dnsHostnames, +5 more.

check_syntaxA

Check syntax of an Ansible playbook without executing it

Inputs: playbook (required).

list_inventoryC

List Ansible inventory hosts and groups

Inputs: inventory.

list_tasksC

List all tasks that would be executed by a playbook

Inputs: playbook (required).

run_ad_hocC

Run an Ansible ad-hoc command against specified hosts

Inputs: pattern (required), args, become, extra_vars, +2 more.

run_playbookC

Run an Ansible playbook

Inputs: playbook (required), extraVars, inventory, limit, +1 more.

terraformC

Execute Terraform commands (init, plan, apply, destroy, validate, output, etc.)

Inputs: action (required), workingDir (required), autoApprove, backendConfig, +8 more.

vault_decrypt_stringC

Decrypt a string encrypted with Ansible Vault

Inputs: string (required), vault_id, vault_password_file.

vault_encrypt_stringC

Encrypt a string using Ansible Vault

Inputs: string (required), name, vault_id, vault_password_file.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools are clearly distinct by AWS service or Ansible function, with minimal overlap. However, aws_ec2's broad scope (list, create, start, stop, terminate) could be confused with more specific AWS tools, and terraform seems out of place in an Ansible-focused server, creating some ambiguity.

    Naming Consistency4/5

    Tools follow a consistent snake_case pattern throughout, with clear verb_noun structures (e.g., run_playbook, list_inventory). The main deviation is the terraform tool, which lacks a verb prefix, slightly breaking the pattern.

    Tool Count3/5

    With 18 tools, the count is borderline high for an Ansible server, especially since it includes AWS-specific tools that might be better scoped separately. It feels slightly heavy, but still manageable given the domain coverage.

    Completeness4/5

    The toolset covers core Ansible operations (syntax checking, inventory, tasks, ad-hoc commands, playbooks, vault) and extensive AWS management, but lacks tools for other cloud providers or non-AWS infrastructure, which could be gaps for broader automation needs.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      Not graded
      maintenance
      An MCP server for Infrastructure as Code that enables AI assistants to manage cloud resources through Ansible and Terraform operations. It supports executing playbooks, managing AWS services, and running Terraform commands with optional LocalStack integration.
      18
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enterprise-grade MCP server exposing Ansible Automation Platform 2.x as a complete AI interface for LLMs, enabling natural language management of automation resources.
      86
      1
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      MCP server that exposes Ansible modules to AI agents with a search-schema-check-execute workflow, enabling safe ad-hoc runs via check mode by default. It provides tools to search modules, fetch schemas, run modules, and list collections.
      5
      3
      Apache 2.0