@scarlet-mesh/mcp-ansible-info
v1.0.0
Published
MCP Server for Ansible information and playbook management
Readme
Ansible Info MCP Server
Overview
This MCP (Model Context Protocol) server, ansible-info, provides comprehensive information about Ansible automation and helps with playbook management. It offers access to Ansible version information, installation guides, module listings, and automated playbook generation from templates.
Features
- Version Information: Get current Ansible version and documentation links
- Module Listings: Access to available Ansible modules and their documentation
- Installation Guides: Platform-specific installation instructions for RHEL/CentOS, Ubuntu, and pip-based installations
- Playbook Generation: Generate Ansible playbooks from predefined templates with custom variables
- Template Management: Support for multiple playbook templates including package installation, service configuration, and user setup
Tools
The server provides the following MCP tools:
get-ansible-version: Retrieves current Ansible version information and documentation linksget-ansible-modules: Lists available Ansible modules with documentation referencesget-installation-guide: Provides detailed installation instructions for different operating systemsgenerate-playbook: Generates Ansible playbooks from templates with customizable variables
Available Templates
The server includes several predefined playbook templates:
install-package: Creates playbooks for package installationconfigure-service: Generates service configuration and management playbookssetup-user: Creates user and group management playbooks
Setup
Prerequisites
- Node.js
- An MCP client (e.g., a compatible AI tool or application)
Installation
Clone this repository or navigate to the ansible-info package.
Install the dependencies:
npm install
Running the Server
Start the server:
npm startThe server will listen for MCP requests via standard input/output.
Usage
To use the server, send MCP requests from a compatible client. Here are example requests for each tool:
Get Ansible version:
{ "tool_name": "get-ansible-version", "input": {} }Get available modules:
{ "tool_name": "get-ansible-modules", "input": {} }Get installation guide:
{ "tool_name": "get-installation-guide", "input": {} }Generate playbook from template:
{ "tool_name": "generate-playbook", "input": { "templateName": "install-package", "variables": { "package_name": "httpd" } } }
Refer to the MCP client documentation for instructions on sending requests and handling responses.
Data Structures
The server works with the following data structures:
interface AnsibleInfo {
version: string;
installation: {
rhel: string[];
ubuntu: string[];
pip: string[];
};
documentation: {
main: string;
installation: string;
playbooks: string;
};
modules: string[];
}
interface PlaybookTask {
name: string;
module: string;
args: Record<string, any>;
}
interface Playbook {
name: string;
hosts: string[];
tasks: PlaybookTask[];
vars?: Record<string, any>;
}Supported Platforms
The installation guide provides instructions for:
- RHEL/CentOS: Using subscription-manager and DNF
- Ubuntu: Using apt package manager
- Cross-platform: Using Python pip
Template Variables
Each template supports different variables:
- install-package:
package_name - configure-service:
service_name,config_template,config_path - setup-user:
username,group_name,user_shell
