Get the FREE Ultimate OpenClaw Setup Guide →

mcp -aap

This is an example of MCP Server to work with Ansible Automation Platform

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mancubus77-mcp-server-aap uv run python server.py \
  --env AAP_URL="https://your-aap-instance.com" \
  --env AAP_TOKEN="your-access-token-here" \
  --env AAP_TIMEOUT="30" \
  --env AAP_PROJECT_ID="your-project-id" \
  --env AAP_VERIFY_SSL="True" \
  --env AAP_MAX_RETRIES="3"

How to use

This MCP server provides an integration layer with Ansible Automation Platform (AAP). It exposes tools to discover available Ansible job templates within a configured AAP project, launch those templates with custom extra variables and parameters, and monitor or retrieve outputs for running jobs. It also includes a lightweight capability to test connectivity to AAP and handle errors with retry logic. Use it as an interface for LLMs to plan and execute automation against your AAP environment, then fetch status and logs to present actionable feedback. The available tools include get_job_templates, launch_job_template, get_job_status, get_job_output, and test_aap_connection, enabling discovery, execution, and monitoring of AAP automation from MCP conversations.

How to install

Prerequisites:

  • Python 3.8+ installed on the host
  • Access to an Ansible Automation Platform (AAP) instance
  • AAP API access token with appropriate permissions

Installation steps:

  1. Clone this repository to your environment.
  2. Create and populate environment variables (see env_example in the repo or use a .env file):
    • AAP_URL: Base URL of your AAP instance
    • AAP_TOKEN: Bearer token for API authentication
    • AAP_PROJECT_ID: Default project ID to extract templates from
    • AAP_VERIFY_SSL: true/false to verify SSL certificates
    • AAP_TIMEOUT: Request timeout in seconds
    • AAP_MAX_RETRIES: Retry attempts for failed requests
  3. Install Python dependencies:
    uv pip install -r requirements.txt
    
  4. Run the MCP server (example for uv):
    uv run python server.py
    
  5. Optionally, configure Claude Desktop or other MCP clients to connect using the provided MCP server configuration.

Notes:

  • Ensure network access from the MCP host to the AAP instance
  • Keep AAP_TOKEN secure and do not commit it to source control

Additional notes

Tips and notes:

  • Use AAP_VERIFY_SSL to enforce SSL in production environments and avoid exposing tokens over insecure connections.
  • The server expects AAP_PROJECT_ID to determine the scope for template discovery; adjust as needed for multi-project setups.
  • If you encounter authentication errors, double-check token permissions and token scope within AAP.
  • For long-running templates or large outputs, use get_job_status and get_job_output to fetch incremental updates and logs.
  • Consider enabling retry logic (AAP_MAX_RETRIES) and adjusting AAP_TIMEOUT for network reliability in your environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers