Labsco
sibilleb logo

AAP Enterprise MCP Server

β˜… 30

from sibilleb

An MCP server that allows AI assistants to interact with Ansible Automation Platform (AAP) and Event-Driven Ansible (EDA) infrastructure.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedPaid serviceAdvanced setup

AAP Enterprise MCP Server

A comprehensive Model Context Protocol (MCP) server suite for Red Hat's automation and infrastructure ecosystem, enabling AI assistants to interact with Ansible Automation Platform (AAP), Event-Driven Ansible (EDA), ansible-lint code quality tools, and Red Hat's official documentation with secure domain validation.

Features

Ansible Automation Platform (AAP) Integration

  • Inventory Management: List, create, update inventories and manage hosts/groups
  • Job Management: Run job templates, monitor job status, and retrieve logs
  • Project Management: Create and manage SCM-based projects
  • Template Management: Create and manage job templates
  • Host Operations: Add/remove hosts, manage host variables and facts
  • Ad-hoc Commands: Execute ansible commands directly on inventory hosts

Event-Driven Ansible (EDA) Integration

  • Activation Management: List, create, enable/disable EDA activations
  • Rulebook Management: Manage and query rulebooks
  • Decision Environment Management: Manage decision environments
  • Event Stream Monitoring: Monitor event streams

Ansible Galaxy Integration

  • Collection Search: Search and discover Ansible collections by name, namespace, or keywords
  • Role Search: Find community roles by keyword, author, or specific criteria
  • Content Details: Get comprehensive information about collections and roles including versions, dependencies, and installation instructions
  • Smart Suggestions: AI-powered content recommendations based on use case descriptions
  • AAP Integration: Intelligent suggestions that consider existing AAP infrastructure and inventories

Ansible Lint Integration

  • Playbook Validation: Real-time linting of Ansible playbook content with configurable quality profiles
  • File Analysis: Comprehensive analysis of Ansible files, roles, and entire project structures
  • Best Practice Enforcement: Automated checking against Ansible community standards and best practices
  • Syntax Validation: Quick syntax checking for immediate feedback during development
  • Multi-Profile Support: Progressive quality improvement with profiles from basic to production-ready
  • Rule Management: List, filter, and understand ansible-lint rules with detailed explanations

Red Hat Documentation Integration (Streamlined)

  • Efficient Discovery: Web search-based content discovery using official Red Hat domains
  • Smart Content Fetching: PDF-first strategy handling Red Hat's JavaScript rendering issues
  • Domain Security: Validates access to 50+ official Red Hat domains for secure documentation access
  • Minimal MCP Overhead: Streamlined 2-tool approach reduces API calls by 75%
  • Search Query Generation: Creates optimized search queries for external WebSearch MCP tool usage
  • Authentication Handling: Smart detection of subscription-required vs public content

Getting Your API Token

Method 1: AAP Web Interface

  1. Log into your AAP web interface
  2. Click on your username in the top right corner
  3. Select "User Settings" or "My Profile"
  4. Navigate to the "Tokens" section
  5. Click "Add" or "Create Token"
  6. Set the scope to "Write" for full functionality
  7. Copy the generated token immediately (it won't be shown again)

Method 2: Command Line

curl -k -X POST \
  "https://your-aap-server.com/api/v2/tokens/" \
  -H "Content-Type: application/json" \
  -u "username:password" \
  -d '{
    "description": "MCP Server Token",
    "application": null,
    "scope": "write"
  }'

Server Architecture

This project implements a four-server MCP architecture for comprehensive Red Hat ecosystem coverage:

ServerFilePurposeKey Features
Ansible Automation Platformansible.pyAAP integration with Galaxy searchJob management, inventory control, Galaxy discovery (855 lines)
Event-Driven Ansibleeda.pyEDA integrationActivation management, rulebook handling (96 lines)
Ansible Lintansible-lint.pyCode quality and best practicesProgressive quality profiles, project analysis (502 lines)
Red Hat Documentationredhat_docs.pyOfficial Red Hat documentation accessDomain validation, hybrid search, PDF access

Combined Capabilities

  • Complete Automation Lifecycle: From documentation discovery to implementation with quality assurance
  • Security: Domain-validated access ensures only official Red Hat sources
  • Intelligence: AI-powered recommendations and specialized telco/edge guidance
  • Scalability: Independent servers allow focused functionality and scaling

Available Tools

Ansible Automation Platform Tools

ToolDescription
list_inventoriesList all inventories
get_inventoryGet inventory details by ID
create_inventoryCreate a new inventory
list_hostsList hosts in an inventory
add_host_to_inventoryAdd a host to inventory
run_jobExecute a job template
job_statusCheck job execution status
job_logsRetrieve job execution logs
list_job_templatesList available job templates
create_job_templateCreate a new job template
create_projectCreate a new project
run_adhoc_commandExecute ad-hoc ansible commands
list_projectsList all projects
get_projectGet project details by ID
list_project_updatesList project update jobs (SCM sync)
get_project_updateGet project update job status
get_project_update_logsGet project update job logs
update_projectTrigger project update (SCM sync)

Ansible Galaxy Search Tools

ToolDescription
search_galaxy_collectionsSearch Ansible Galaxy collections by query, tags, or namespace
search_galaxy_rolesSearch Ansible Galaxy roles by keyword, name, or author
get_collection_detailsGet detailed information about a specific collection
get_role_detailsGet detailed information about a specific role
suggest_ansible_contentIntelligently suggest collections and roles based on use case description

Ansible Lint Tools

ToolDescription
lint_playbookLint Ansible playbook content with configurable profiles and rules
lint_fileLint specific Ansible files on disk
lint_roleComprehensive validation of Ansible role directories
validate_syntaxQuick syntax-only validation for immediate feedback
check_best_practicesContext-aware best practice checking (dev/staging/production)
analyze_projectAnalyze entire Ansible project structure with comprehensive reporting
list_rulesList available ansible-lint rules, optionally filtered by tags
list_tagsList all available tags for ansible-lint rules
get_ansible_lint_versionGet version information for installed ansible-lint

Event-Driven Ansible Tools

ToolDescription
list_activationsList EDA activations
get_activationGet activation details
create_activationCreate new activation
enable_activationEnable an activation
disable_activationDisable an activation
restart_activationRestart an activation
list_rulebooksList available rulebooks
get_rulebookGet rulebook details
list_decision_environmentsList decision environments

Red Hat Documentation Tools

ToolDescription
read_documentationRead Red Hat documentation with domain validation and PDF-first access
list_productsList all available Red Hat products and versions
search_documentationSearch Red Hat documentation with version prioritization
search_documentation_enhancedNEW: Hybrid search combining sitemap + web search discovery
search_with_web_guidanceNEW: Get direct results + optimized Red Hat domain-restricted web search queries
smart_documentation_finderNEW: Intelligent multi-source documentation discovery
get_product_guidesGet product guides with semantic version sorting (13 guides for OpenShift 4.18)
recommend_contentIntelligent recommendations with telco/edge/CNF specialization

Development

Running Tests

# Install development dependencies
uv sync --group dev

# Run tests
pytest

# Run with coverage
pytest --cov=.

Code Formatting

# Format code
black .

# Lint code
ruff check .

# Type checking
mypy .

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Key Achievements

🎯 Red Hat Documentation Success Metrics

  • βœ… Version Detection: OpenShift 4.18 correctly identified as latest (not 3.x)
  • βœ… PDF Access: 1.4MB+ PDF files successfully accessible
  • βœ… Search Relevance: Telco edge queries return specialized documentation
  • βœ… Domain Security: 100% Red Hat domain validation (50+ domains tested)
  • βœ… Web Search Integration: Hybrid approach with official source restriction

πŸ“Š Performance Improvements

MetricBeforeAfterStatus
Latest Version Detection❌ 3.x versionsβœ… 4.18+ versionsFixed
PDF Access Success Rate❌ 301/404 errorsβœ… 200 OK responses100%
Domain Validation❌ No filteringβœ… 50+ official domainsSecured
Available OpenShift Guides8 generic13 specialized+62%

Support

Related Projects

Ready for production use with secure, domain-validated Red Hat ecosystem access! πŸš€