Skip to main content
Glama

Ansible MCP Server

by tarnover

MCP SysOperator

Ein Model Context Protocol (MCP)-Server für Infrastructure-as-Code-Operationen. Dieser Server ermöglicht KI-Assistenten die Interaktion mit Ansible und Terraform, die Ausführung von Playbooks und Terraform-Plänen, die Verwaltung von Cloud-Ressourcen und die direkte Durchführung anderer Infrastrukturoperationen.
(Das Projekt war früher als mcp-ansible bekannt)

Demo-Projekte

Der gesamte Code in Demos wurde mit Claude 3.7 Sonnet (über OpenRouter), Cline und SysOperator generiert

  • AWS LAMP Stack – Der gesamte Ansible-Code zum Bereitstellen eines Beispiel-LAMP-Stacks in AWS
  • AWS Terraform LAMP – Terraform- und Ansible-Code zum Antworten auf einen LAMP-Stack

Merkmale

  • Ansible-Playbooks ausführen : Führen Sie Ansible-Playbooks mit Unterstützung für Parameter wie Inventar, zusätzliche Variablen, Tags und Limits aus
  • Inventar auflisten : Hosts und Gruppen aus einer Ansible-Inventardatei anzeigen
  • Syntax prüfen : Validieren Sie die Ansible-Playbook-Syntax ohne Ausführung
  • Aufgaben auflisten : Zeigen Sie eine Vorschau der Aufgaben an, die von einem Playbook ausgeführt werden würden
  • Zugriff auf Standardinventar : Zugriff auf die Standard-Ansible-Inventardatei über die Ressourcen-API
  • AWS-Integration : Verwalten Sie AWS-Ressourcen (EC2, S3, VPC, CloudFormation usw.)
  • Terraform-Unterstützung : Führen Sie Terraform-Befehle aus (Init, Plan, Apply, Destroy, Output usw.)
  • tflocal-Integration : Testen Sie Terraform-Konfigurationen mit LocalStack für die lokale Cloud-Entwicklung
  • LocalStack-Support : Testen Sie AWS-Operationen lokal mit LocalStack ohne echte AWS-Anmeldeinformationen

Anforderungen

  • Node.js 18 oder höher
  • npm oder yarn
  • Ansible installiert und im PATH
  • @modelcontextprotocol/sdk (automatisch installiert)
  • Für AWS-Operationen: AWS CLI und gültige Anmeldeinformationen
  • Für LocalStack: LocalStack installiert und ausgeführt, awslocal CLI

Installation

1. Klonen Sie das Repository

git clone https://github.com/tarnover/mcp-sysoperator.git cd mcp-sysoperator

2. Abhängigkeiten installieren

npm install

3. Erstellen Sie den Server

npm run build

4. MCP-Einstellungen konfigurieren

Fügen Sie den Ansible MCP-Server zu Ihrer MCP-Einstellungskonfigurationsdatei hinzu.

Für VSCode mit Claude-Erweiterung:

  • Bearbeiten Sie die Datei unter ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Für die Claude Desktop-App:

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

Fügen Sie dem Abschnitt mcpServers Folgendes hinzu:

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

Stellen Sie sicher, dass Sie /absolute/path/to/mcp-sysoperator durch den tatsächlichen Pfad zu Ihrer Installation ersetzen.

Anwendungsbeispiele

Nach der Installation und Konfiguration stellt der MCP-Server dem KI-Assistenten die folgenden Tools zur Verfügung:

1. Führen Sie ein Playbook aus

<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. Inventar auflisten

<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. Überprüfen Sie die 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>

4. Aufgaben in einem Playbook auflisten

<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. Zugriff auf die Standardinventarressource

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

6. AWS S3-Operationen

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

<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. Terraform mit LocalStack (tflocal)

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

Dieses Projekt umfasst die Integration mit LocalStack, um AWS-Operationen lokal ohne echte AWS-Anmeldeinformationen zu testen. Die LocalStack-Integration ermöglicht Ihnen:

  1. Testen Sie Ansible-Playbooks, die AWS-Dienste lokal verwenden
  2. Entwickeln und testen Sie AWS-Operationen, ohne AWS-Kosten zu verursachen
  3. Führen Sie Tests durch, ohne echte AWS-Anmeldeinformationen zu benötigen
  4. Validieren Sie Ihren Infrastrukturcode vor der Bereitstellung in echtem AWS

Verwenden von LocalStack

Ausführliche Anweisungen zur Verwendung der LocalStack-Integration finden Sie in der README-Datei von LocalStack .

Schnellstart:

# Install LocalStack and awslocal CLI pip install localstack awscli-local # Start LocalStack localstack start # Run the sample playbook node localstack/run_sample_playbook.mjs

Entwicklung

Projektstruktur

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

Neue Funktionen hinzufügen

So fügen Sie dem MCP-Server neue Funktionen hinzu:

  1. Ändern Sie src/ansible-mcp-server/index.ts (zukünftig: src/sysoperator/index.ts ).
  2. Fügen Sie Ihr neues Tool in der Methode setupToolHandlers hinzu
  3. Implementieren Sie eine Handler-Funktion für Ihr Tool in der entsprechenden Operationsdatei
  4. Fügen Sie die Schemadefinition in common/types.ts
  5. Neuaufbau mit npm run build

⚠️ Haftungsausschluss

SysOperator befindet sich derzeit in der aktiven Entwicklung und wird umfassend getestet. Der Einsatz in Produktionsumgebungen wird derzeit nicht empfohlen. Es kann zu schwerwiegenden Änderungen, unvollständigen Funktionen oder unerwartetem Verhalten der Software kommen.

Die Nutzung erfolgt auf eigene Gefahr.

Lizenz

MIT-Lizenz – Einzelheiten finden Sie unter LIZENZ

Related MCP Servers

  • -
    security
    F
    license
    -
    quality
    A 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
    • Linux
    • Apple
  • -
    security
    F
    license
    -
    quality
    A 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 -
    1
    TypeScript
  • -
    security
    A
    license
    -
    quality
    A 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 -
    1
    JavaScript
    MIT License
    • Apple
  • A
    security
    A
    license
    A
    quality
    A 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 -
    9
    50
    Python
    MIT License
    • Linux
    • Apple

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tarnover/mcp-ansible'

If you have feedback or need assistance with the MCP directory API, please join our Discord server