Logo Ansible

Ansible

Tổ chức
Knuckles-Team

MCP Server and API for Ansible Tower

Nhà phát hànhKnuckles-Team
Kho mãansible-tower-mcp
Ngôn ngữPython
Bản fork
2
Sao
2
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Ansible cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    2 sao và 2 bản fork từ kho mã được liên kết.

Ansible Tower Mcp

CLI or API | MCP | Agent

PyPI - Version MCP Server PyPI - Downloads GitHub Repo stars GitHub forks GitHub contributors PyPI - License GitHub GitHub last commit (by committer) GitHub pull requests GitHub closed pull requests GitHub issues GitHub top language GitHub language count GitHub repo size GitHub repo file count (file type) PyPI - Wheel PyPI - Implementation

Version: 3.1.0

Documentation — Installation, deployment, and usage across the API, CLI, MCP, and A2A agent interfaces are maintained in the official documentation.


Overview

Ansible Tower Mcp is a production-grade Agent and Model Context Protocol (MCP) server designed to interface directly with Ansible Tower MCP Server for Agentic AI!.


Key Features

  • Consolidated Action-Routed MCP Tools: Minimizes token overhead and eliminates tool bloat in LLM contexts by grouping methods into optimized, togglable tool modules.
  • Enterprise-Grade Security: Comprehensive support for Eunomia policies, OIDC token delegation, and granular execution context tracking.
  • Integrated Graph Agent: Built-in Pydantic AI agent supporting the Agent Control Protocol (ACP) and standard Web interfaces (AG-UI).
  • Native Telemetry & Tracing: Out-of-the-box OpenTelemetry exports and native Langfuse tracing.

CLI or API

This agent wraps the Ansible Tower MCP Server for Agentic AI! API. You can interact with it programmatically or via its integrated execution entrypoints.

Detailed instructions on how to use the underlying API wrappers, extended schema bindings, and developer SDK references are maintained in docs/index.md.


MCP

This server utilizes dynamic Action-Routed tools to optimize token overhead and maximize IDE compatibility.

Available MCP Tools

The table below is auto-generated from the live server — do not edit by hand.

Condensed action-routed tools (default — MCP_TOOL_MODE=condensed)

MCP ToolToggle Env VarDescription
ansible_tower_ad_hoc_commandsAD_HOC_COMMANDSTOOLManage ansible tower ad hoc commands operations.
ansible_tower_credentialsCREDENTIALSTOOLManage ansible tower credentials operations.
ansible_tower_groupsGROUPSTOOLManage ansible tower groups operations.
ansible_tower_hostsHOSTSTOOLManage ansible tower hosts operations.
ansible_tower_inventoryINVENTORYTOOLManage ansible tower inventory operations.
ansible_tower_job_templatesJOB_TEMPLATESTOOLManage ansible tower job templates operations.
ansible_tower_jobsJOBSTOOLManage ansible tower jobs operations.
ansible_tower_organizationsORGANIZATIONSTOOLManage ansible tower organizations operations.
ansible_tower_projectsPROJECTSTOOLManage ansible tower projects operations.
ansible_tower_schedulesSCHEDULESTOOLManage ansible tower schedules operations.
ansible_tower_systemSYSTEMTOOLManage ansible tower system operations.
ansible_tower_teamsTEAMSTOOLManage ansible tower teams operations.
ansible_tower_usersUSERSTOOLManage ansible tower users operations.
ansible_tower_workflow_jobsWORKFLOW_JOBSTOOLManage ansible tower workflow jobs operations.
ansible_tower_workflow_templatesWORKFLOW_TEMPLATESTOOLManage ansible tower workflow templates operations.

Verbose 1:1 API-mapped tools (MCP_TOOL_MODE=verbose or both)

MCP ToolToggle Env VarDescription
ansible_tower_add_host_to_groupAPITOOLInvoke the add_host_to_group operation.
ansible_tower_cancel_ad_hoc_commandAPITOOLInvoke the cancel_ad_hoc_command operation.
ansible_tower_cancel_jobAPITOOLInvoke the cancel_job operation.
ansible_tower_cancel_workflow_jobAPITOOLInvoke the cancel_workflow_job operation.
ansible_tower_create_credentialAPITOOLInvoke the create_credential operation.
ansible_tower_create_groupAPITOOLInvoke the create_group operation.
ansible_tower_create_hostAPITOOLInvoke the create_host operation.
ansible_tower_create_inventoryAPITOOLInvoke the create_inventory operation.
ansible_tower_create_job_templateAPITOOLInvoke the create_job_template operation.
ansible_tower_create_organizationAPITOOLInvoke the create_organization operation.
ansible_tower_create_projectAPITOOLInvoke the create_project operation.
ansible_tower_create_scheduleAPITOOLInvoke the create_schedule operation.
ansible_tower_create_teamAPITOOLInvoke the create_team operation.
ansible_tower_create_userAPITOOLInvoke the create_user operation.
ansible_tower_delete_credentialAPITOOLInvoke the delete_credential operation.
ansible_tower_delete_groupAPITOOLInvoke the delete_group operation.
ansible_tower_delete_hostAPITOOLInvoke the delete_host operation.
ansible_tower_delete_inventoryAPITOOLInvoke the delete_inventory operation.
ansible_tower_delete_job_templateAPITOOLInvoke the delete_job_template operation.
ansible_tower_delete_organizationAPITOOLInvoke the delete_organization operation.
ansible_tower_delete_projectAPITOOLInvoke the delete_project operation.
ansible_tower_delete_scheduleAPITOOLInvoke the delete_schedule operation.
ansible_tower_delete_teamAPITOOLInvoke the delete_team operation.
ansible_tower_delete_userAPITOOLInvoke the delete_user operation.
ansible_tower_get_ad_hoc_commandAPITOOLInvoke the get_ad_hoc_command operation.
ansible_tower_get_ansible_versionAPITOOLInvoke the get_ansible_version operation.
ansible_tower_get_credentialAPITOOLInvoke the get_credential operation.
ansible_tower_get_dashboard_statsAPITOOLInvoke the get_dashboard_stats operation.
ansible_tower_get_groupAPITOOLInvoke the get_group operation.
ansible_tower_get_headersBASE_API_CLIENTTOOLGet request headers with authorization.
ansible_tower_get_hostAPITOOLInvoke the get_host operation.
ansible_tower_get_inventoryAPITOOLInvoke the get_inventory operation.
ansible_tower_get_jobAPITOOLInvoke the get_job operation.
ansible_tower_get_job_eventsAPITOOLInvoke the get_job_events operation.
ansible_tower_get_job_stdoutAPITOOLInvoke the get_job_stdout operation.
ansible_tower_get_job_templateAPITOOLInvoke the get_job_template operation.
ansible_tower_get_metricsAPITOOLInvoke the get_metrics operation.
ansible_tower_get_organizationAPITOOLInvoke the get_organization operation.
ansible_tower_get_projectAPITOOLInvoke the get_project operation.
ansible_tower_get_scheduleAPITOOLInvoke the get_schedule operation.
ansible_tower_get_teamAPITOOLInvoke the get_team operation.
ansible_tower_get_tokenBASE_API_CLIENTTOOLAuthenticate and get token using web session approach.
ansible_tower_get_userAPITOOLInvoke the get_user operation.
ansible_tower_get_workflow_jobAPITOOLInvoke the get_workflow_job operation.
ansible_tower_get_workflow_templateAPITOOLInvoke the get_workflow_template operation.
ansible_tower_handle_paginationBASE_API_CLIENTTOOLHandle paginated results from Ansible API.
ansible_tower_launch_jobAPITOOLInvoke the launch_job operation.
ansible_tower_launch_workflowAPITOOLInvoke the launch_workflow operation.
ansible_tower_list_credential_typesAPITOOLInvoke the list_credential_types operation.
ansible_tower_list_credentialsAPITOOLInvoke the list_credentials operation.
ansible_tower_list_groupsAPITOOLInvoke the list_groups operation.
ansible_tower_list_hostsAPITOOLInvoke the list_hosts operation.
ansible_tower_list_inventoriesAPITOOLInvoke the list_inventories operation.
ansible_tower_list_job_templatesAPITOOLInvoke the list_job_templates operation.
ansible_tower_list_jobsAPITOOLInvoke the list_jobs operation.
ansible_tower_list_organizationsAPITOOLInvoke the list_organizations operation.
ansible_tower_list_projectsAPITOOLInvoke the list_projects operation.
ansible_tower_list_schedulesAPITOOLInvoke the list_schedules operation.
ansible_tower_list_teamsAPITOOLInvoke the list_teams operation.
ansible_tower_list_usersAPITOOLInvoke the list_users operation.
ansible_tower_list_workflow_jobsAPITOOLInvoke the list_workflow_jobs operation.
ansible_tower_list_workflow_templatesAPITOOLInvoke the list_workflow_templates operation.
ansible_tower_remove_host_from_groupAPITOOLInvoke the remove_host_from_group operation.
ansible_tower_requestBASE_API_CLIENTTOOLMake a request to the Ansible API.
ansible_tower_run_ad_hoc_commandAPITOOLInvoke the run_ad_hoc_command operation.
ansible_tower_sync_projectAPITOOLInvoke the sync_project operation.
ansible_tower_update_credentialAPITOOLInvoke the update_credential operation.
ansible_tower_update_groupAPITOOLInvoke the update_group operation.
ansible_tower_update_hostAPITOOLInvoke the update_host operation.
ansible_tower_update_inventoryAPITOOLInvoke the update_inventory operation.
ansible_tower_update_job_templateAPITOOLInvoke the update_job_template operation.
ansible_tower_update_organizationAPITOOLInvoke the update_organization operation.
ansible_tower_update_projectAPITOOLInvoke the update_project operation.
ansible_tower_update_scheduleAPITOOLInvoke the update_schedule operation.
ansible_tower_update_teamAPITOOLInvoke the update_team operation.
ansible_tower_update_userAPITOOLInvoke the update_user operation.

15 action-routed tool(s) (default) · 76 verbose 1:1 tool(s). Each is enabled unless its <DOMAIN>TOOL toggle is set false; MCP_TOOL_MODE selects the surface (condensed default · verbose 1:1 · both). Auto-generated — do not edit.

Detailed tool schemas, parameter shapes, and validation constraints are preserved in docs/usage.md.

Dynamic Tool Selection & Visibility

This MCP server supports dynamic toolset selection and visibility filtering at runtime. This allows you to restrict the set of exposed tools in order to prevent blowing up the LLM's context window.

You can configure tool filtering via multiple input channels:

  • CLI Arguments: Pass --tools or --toolsets (or their disabled counterparts --disabled-tools and --disabled-toolsets) during startup.
  • Environment Variables: Define standard environment variables:
    • MCP_ENABLED_TOOLS / MCP_DISABLED_TOOLS
    • MCP_ENABLED_TAGS / MCP_DISABLED_TAGS
  • HTTP SSE Request Headers: Pass custom headers during transport initialization:
    • x-mcp-enabled-tools / x-mcp-disabled-tools
    • x-mcp-enabled-tags / x-mcp-disabled-tags
  • HTTP SSE Request Query Parameters: Append query parameters directly to your transport connection URL:
    • ?tools=tool1,tool2
    • ?tags=tag1

When query strings or parameters are supplied, an LLM-free Knowledge Graph resolution layer (using DynamicToolOrchestrator) matches query intents against known tool tags, names, or descriptions, with safe fallback and automated 24-hour background cache refreshing.


MCP Configuration Examples

Install the connector-focused [mcp] extra. Examples use ansible-tower-mcp[mcp] to add FastMCP / FastAPI through agent-utilities[mcp]; the required Agent Utilities core still carries epistemic-graph[full]. The [agent-runtime] extra additionally enables model orchestration.

stdio Transport (local IDEs — Cursor, Claude Desktop, VS Code)

json
{
  "mcpServers": {
    "ansible-tower-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "ansible-tower-mcp[mcp]",
        "ansible-tower-mcp"
      ],
      "env": {
        "MCP_TOOL_MODE": "intent",
        "AD_HOC_COMMANDSTOOL": "True",
        "ANSIBLE_BASE_URL": "https://ansible.example.com",
        "ANSIBLE_CLIENT_ID": "<YOUR_ANSIBLE_CLIENT_ID>",
        "ANSIBLE_CLIENT_SECRET": "<YOUR_ANSIBLE_CLIENT_SECRET>",
        "ANSIBLE_PASSWORD": "<YOUR_ANSIBLE_PASSWORD>",
        "ANSIBLE_USERNAME": "<YOUR_ANSIBLE_USERNAME>",
        "CREDENTIALSTOOL": "True",
        "DELEGATED_SCOPES": "api",
        "GROUPSTOOL": "True",
        "HOSTSTOOL": "True",
        "INVENTORYTOOL": "True",
        "JOBSTOOL": "True",
        "JOB_TEMPLATESTOOL": "True",
        "ORGANIZATIONSTOOL": "True",
        "PROJECTSTOOL": "True",
        "SCHEDULESTOOL": "True",
        "SYSTEMTOOL": "True",
        "TEAMSTOOL": "True",
        "USERSTOOL": "True",
        "WORKFLOW_JOBSTOOL": "True",
        "WORKFLOW_TEMPLATESTOOL": "True"
      }
    }
  }
}

Runtime references require an alias-aware launcher such as GraphOS. Other launchers must omit those entries and inject the resolved values through their own runtime secret boundary.

Streamable-HTTP Transport (networked / production)

json
{
  "mcpServers": {
    "ansible-tower-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "ansible-tower-mcp[mcp]",
        "ansible-tower-mcp",
        "--transport",
        "streamable-http",
        "--port",
        "8000"
      ],
      "env": {
        "TRANSPORT": "streamable-http",
        "HOST": "127.0.0.1",
        "PORT": "8000",
        "MCP_TOOL_MODE": "intent",
        "AD_HOC_COMMANDSTOOL": "True",
        "ANSIBLE_BASE_URL": "https://ansible.example.com",
        "ANSIBLE_CLIENT_ID": "<YOUR_ANSIBLE_CLIENT_ID>",
        "ANSIBLE_CLIENT_SECRET": "<YOUR_ANSIBLE_CLIENT_SECRET>",
        "ANSIBLE_PASSWORD": "<YOUR_ANSIBLE_PASSWORD>",
        "ANSIBLE_USERNAME": "<YOUR_ANSIBLE_USERNAME>",
        "CREDENTIALSTOOL": "True",
        "DELEGATED_SCOPES": "api",
        "GROUPSTOOL": "True",
        "HOSTSTOOL": "True",
        "INVENTORYTOOL": "True",
        "JOBSTOOL": "True",
        "JOB_TEMPLATESTOOL": "True",
        "ORGANIZATIONSTOOL": "True",
        "PROJECTSTOOL": "True",
        "SCHEDULESTOOL": "True",
        "SYSTEMTOOL": "True",
        "TEAMSTOOL": "True",
        "USERSTOOL": "True",
        "WORKFLOW_JOBSTOOL": "True",
        "WORKFLOW_TEMPLATESTOOL": "True"
      }
    }
  }
}

Alternatively, connect to a pre-deployed Streamable-HTTP instance by url:

json
{
  "mcpServers": {
    "ansible-tower-mcp": {
      "url": "http://localhost:8000/ansible-tower-mcp/mcp"
    }
  }
}

Run a reviewed container image as a least-privilege stdio child (no listener or published port):

bash
docker run -i --rm \
  --read-only \
  --cap-drop=ALL \
  --security-opt=no-new-privileges \
  --pids-limit=256 \
  --tmpfs /tmp:rw,noexec,nosuid,nodev,size=64m \
  -e TRANSPORT=stdio \
  -e MCP_TOOL_MODE=intent \
  -e AD_HOC_COMMANDSTOOL=True \
  -e ANSIBLE_BASE_URL=https://ansible.example.com \
  -e ANSIBLE_CLIENT_ID="<YOUR_ANSIBLE_CLIENT_ID>" \
  -e ANSIBLE_CLIENT_SECRET="<YOUR_ANSIBLE_CLIENT_SECRET>" \
  -e ANSIBLE_PASSWORD="<YOUR_ANSIBLE_PASSWORD>" \
  -e ANSIBLE_USERNAME="<YOUR_ANSIBLE_USERNAME>" \
  -e CREDENTIALSTOOL=True \
  -e DELEGATED_SCOPES=api \
  -e GROUPSTOOL=True \
  -e HOSTSTOOL=True \
  -e INVENTORYTOOL=True \
  -e JOBSTOOL=True \
  -e JOB_TEMPLATESTOOL=True \
  -e ORGANIZATIONSTOOL=True \
  -e PROJECTSTOOL=True \
  -e SCHEDULESTOOL=True \
  -e SYSTEMTOOL=True \
  -e TEAMSTOOL=True \
  -e USERSTOOL=True \
  -e WORKFLOW_JOBSTOOL=True \
  -e WORKFLOW_TEMPLATESTOOL=True \
  registry.example.invalid/ansible-tower-mcp@sha256:<digest> ansible-tower-mcp

For containerized network HTTP, supply an authenticated TLS ingress (or direct server TLS), exact MCP_ALLOWED_HOSTS, and an exact trusted-proxy CIDR policy through the operator-owned deployment profile. The generator does not emit an unauthenticated non-loopback listener.

Auto-generated from the code-read env surface (MCP_TOOL_MODE + package vars) — do not edit.

Additional Deployment Options

ansible-tower-mcp can run as a local stdio process or container, or behind a remote network boundary. The Deployment guide carries the detailed transport contract.

  • Local container — launch a reviewed immutable image as a least-privilege stdio child with no listener or published port.
  • Remote URL — connect through an operator-supplied authenticated HTTPS ingress. Keep its URL, outbound identity references, trust profile, and exact MCP_ALLOWED_HOSTS in AgentConfig.

Environment Variables

Package environment variables

VariableExampleDescription
HOST0.0.0.0
PORT8000
TRANSPORTstdiooptions: stdio, streamable-http, sse
ANSIBLE_BASE_URLhttps://ansible.example.comAnsible Tower / AWX base URL
ANSIBLE_TOWER_TLS_PROFILE—named AgentConfig TLS profile; blank uses the configured default
ANSIBLE_USERNAME<YOUR_ANSIBLE_USERNAME>Path 3: username / password auth
ANSIBLE_PASSWORDsecret-injected
ANSIBLE_CLIENT_ID<YOUR_ANSIBLE_CLIENT_ID>Path 2: OAuth client-credentials auth
ANSIBLE_CLIENT_SECRETsecret-injected
AUDIENCE—token-exchange audience (defaults to ANSIBLE_BASE_URL)
DELEGATED_SCOPESapispace-delimited delegated scopes
ENABLE_OTELTrue
OTEL_EXPORTER_OTLP_ENDPOINThttp://localhost:8080/api/public/otel
OTEL_EXPORTER_OTLP_PUBLIC_KEYsecret-injected
OTEL_EXPORTER_OTLP_SECRET_KEYsecret-injected
OTEL_EXPORTER_OTLP_PROTOCOLhttp/protobuf
EUNOMIA_TYPEnoneoptions: none, embedded, remote
EUNOMIA_POLICY_FILEmcp_policies.json
EUNOMIA_REMOTE_URLhttp://eunomia-server:8000
INVENTORYTOOLTrue
HOSTSTOOLTrue
GROUPSTOOLTrue
JOB_TEMPLATESTOOLTrue
JOBSTOOLTrue
PROJECTSTOOLTrue
CREDENTIALSTOOLTrue
ORGANIZATIONSTOOLTrue
TEAMSTOOLTrue
USERSTOOLTrue
AD_HOC_COMMANDSTOOLTrue
WORKFLOW_TEMPLATESTOOLTrue
WORKFLOW_JOBSTOOLTrue
SCHEDULESTOOLTrue
SYSTEMTOOLTrue

Inherited agent-utilities variables (apply to every connector)

VariableExampleDescription
MCP_TOOL_MODEintentTool surface: intent | condensed | verbose | both
MCP_ENABLED_TOOLS—Comma-separated tool allow-list
MCP_DISABLED_TOOLS—Comma-separated tool deny-list
MCP_ENABLED_TAGS—Comma-separated tag allow-list
MCP_DISABLED_TAGS—Comma-separated tag deny-list
MCP_CLIENT_AUTH—Outbound MCP child auth: oidc-client-credentials | basic | none
OIDC_CLIENT_ID—OIDC client id (service-account auth)
OIDC_CLIENT_SECRET_REFsecret://identity/oidc-client-secretRuntime secret reference for the OIDC service account
MCP_BASIC_AUTH_USERNAME—HTTP Basic username (MCP_CLIENT_AUTH=basic)
MCP_BASIC_AUTH_PASSWORD_REFsecret://identity/mcp-basic-passwordRuntime secret reference for HTTP Basic auth (MCP_CLIENT_AUTH=basic)
DEBUGFalseVerbose logging
PYTHONUNBUFFERED1Unbuffered stdout (recommended in containers)
MCP_URLhttp://localhost:8000/mcpURL of the MCP server the agent connects to
PROVIDERopenaiLLM provider for the agent
MODEL_IDgpt-4oModel id for the agent
ENABLE_WEB_UITrueServe the AG-UI web interface

34 package + 16 inherited variable(s). Auto-generated from .env.example + the shared agent-utilities set — do not edit.

Every variable the server reads, grouped by concern.

Connection & Credentials

VariableDescriptionDefault
ANSIBLE_BASE_URLBase URL of the Ansible Tower / AWX instance—
ANSIBLE_TOWER_TLS_PROFILEOptional runtime TLS profile selector(unset)
ANSIBLE_CLIENT_IDOAuth application client id—
ANSIBLE_CLIENT_SECRETOAuth application client secret—
ANSIBLE_USERNAMEUsername (username/password fallback auth)—
ANSIBLE_PASSWORDPassword (username/password fallback auth)—

Authentication mode

Resolved in priority order (first match wins).

VariableAuth modeNotes
ENABLE_DELEGATION1. OIDC delegation (RFC 8693 token exchange)Set true to flow the caller's IdP token through to Ansible Tower
OIDC_CONFIG_URL / OIDC_CLIENT_ID / OIDC_CLIENT_SECRETOIDC delegation IdP configRequired when delegation is enabled
AUDIENCEOIDC delegation token audienceDefaults to ANSIBLE_BASE_URL
DELEGATED_SCOPESOIDC delegation scopesapi
ANSIBLE_CLIENT_ID (+ ANSIBLE_CLIENT_SECRET)2. OAuth client credentialsUsed when both are set
ANSIBLE_USERNAME (+ ANSIBLE_PASSWORD)3. Username / password (fallback)Native token-based auth

MCP server / transport

VariableDescriptionDefault
TRANSPORTstdio, streamable-http, or ssestdio
HOSTBind host (HTTP transports)0.0.0.0
PORTBind port (HTTP transports)8000
MCP_TOOL_MODETool surface: condensed, verbose, or bothcondensed
MCP_ENABLED_TOOLS / MCP_DISABLED_TOOLSComma-separated tool allow/deny list—
MCP_ENABLED_TAGS / MCP_DISABLED_TAGSComma-separated tag allow/deny list—
DEBUGVerbose loggingFalse
PYTHONUNBUFFEREDUnbuffered stdout (recommended in containers)1

Tool toggles

Each action-routed tool can be disabled individually via its toggle env var (set to false). The full list is in the Available MCP Tools table above (e.g. JOBSTOOL, INVENTORYTOOL, JOB_TEMPLATESTOOL).

Telemetry & governance

VariableDescriptionDefault
ENABLE_OTELEnable OpenTelemetry exportTrue
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint—
OTEL_EXPORTER_OTLP_PUBLIC_KEY / OTEL_EXPORTER_OTLP_SECRET_KEYOTLP auth keys—
OTEL_EXPORTER_OTLP_PROTOCOLOTLP protocol (e.g. http/protobuf)—
EUNOMIA_TYPEAuthorization mode: none, embedded, remotenone
EUNOMIA_POLICY_FILEEmbedded policy filemcp_policies.json
EUNOMIA_REMOTE_URLRemote Eunomia server URL—

Agent CLI (full [agent] runtime only)

VariableDescriptionDefault
MCP_URLURL of the MCP server the agent connects tohttp://localhost:8000/mcp
PROVIDERLLM provider (e.g. openai)openai
MODEL_IDModel id (e.g. gpt-4o)gpt-4o
ENABLE_WEB_UIServe the AG-UI web interfaceTrue

See .env.example for a copy-paste starting point.

Agent

This repository features a fully integrated Pydantic AI Graph Agent. It communicates over the Agent Control Protocol (ACP) and interacts seamlessly with the Agent Web UI (AG-UI) and Terminal interface.

Running the Agent CLI

To start the interactive command-line agent:

bash
# Set credentials

# Run the agent server
ansible-tower-agent --provider openai --model-id gpt-4o

Docker Compose Orchestration

The following docker/agent.compose.yml configures the Agent, Web UI, and Terminal Interface together:

yaml
version: '3.8'

services:
  ansible-tower-mcp-mcp:
    image: example/ansible-tower-mcp:mcp
    container_name: ansible-tower-mcp-mcp
    hostname: ansible-tower-mcp-mcp
    restart: always
    env_file:
      - ../.env
    environment:
      - PYTHONUNBUFFERED=1
      - HOST=0.0.0.0
      - PORT=8000
      - TRANSPORT=streamable-http
    ports:
      - "8000:8000"
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

  ansible-tower-mcp-agent:
    image: example/ansible-tower-mcp@sha256:<digest>
    container_name: ansible-tower-mcp-agent
    hostname: ansible-tower-mcp-agent
    restart: always
    depends_on:
      - ansible-tower-mcp-mcp
    env_file:
      - ../.env
    command: [ "ansible-tower-agent" ]
    environment:
      - PYTHONUNBUFFERED=1
      - HOST=0.0.0.0
      - PORT=9012
      - MCP_URL=http://ansible-tower-mcp-mcp:8000/mcp
      - PROVIDER=${PROVIDER:-openai}
      - MODEL_ID=${MODEL_ID:-gpt-4o}
      - ENABLE_WEB_UI=True
      - ENABLE_OTEL=True
    ports:
      - "9012:9012"
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:9012/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

Detailed graph node architecture explanations, custom skill configurations, and agentic trace guides are available in docs/deployment.md.


Security & Governance

Built directly upon the enterprise-ready agent-utilities core, standard security parameters are fully supported:

Access Control & Policy Enforcement

  • Eunomia Policies: Fine-grained, policy-driven tool authorization. Supports none, local embedded (mcp_policies.json), or centralized remote modes.
  • OIDC Token Delegation: Compliant with RFC 8693 token exchange for flowing authenticating user credentials from Web UI / ACP → Agent → MCP.
  • Scoped Credentials: Execution context runs restricted to the specific caller identity.

Runtime Security Grid

FeatureFunctionalityEnablement
Tool GuardSensitivity inspection with human-in-the-loop validationEnabled by default
Prompt Injection DefenseInput scanning, repetition monitoring, and recursive loop blocksEnabled by default
Context Safety GuardStuck-loop detectors and contextual overflow preemptive alertsEnabled by default

Installation

Pick the extra that matches what you want to run:

ExtraInstallsUse when
ansible-tower-mcp[mcp]Connector-focused MCP server (agent-utilities[mcp] — FastMCP/FastAPI + epistemic-graph[full])You only run the MCP server (smallest install / image)
ansible-tower-mcp[agent]Agent runtime (agent-utilities[agent-runtime,logfire] — model orchestration + epistemic-graph[full])You run the integrated agent
ansible-tower-mcp[all]Everything (mcp + agent + logfire)Development / both surfaces
bash
# Connector-focused MCP server (includes the shared graph engine)
uv pip install "ansible-tower-mcp[mcp]"

# Agent runtime (adds model orchestration to the shared graph engine)
uv pip install "ansible-tower-mcp[agent]"

# Everything (development)
uv pip install "ansible-tower-mcp[all]"      # or: python -m pip install "ansible-tower-mcp[all]"

Container images (:mcp vs :agent)

One multi-stage docker/Dockerfile builds two right-sized images, selected by --target:

Image tagBuild targetContentsEntrypoint
example/ansible-tower-mcp:mcp--target mcpansible-tower-mcp[mcp] — connector-focused, includes epistemic-graph[full]; no model-orchestration stackansible-tower-mcp
example/ansible-tower-mcp@sha256:<digest>--target agent (default)ansible-tower-mcp[agent] — agent runtime, model orchestration + epistemic-graph[full]ansible-tower-agent
bash
docker build --target mcp   -t example/ansible-tower-mcp:mcp    docker/   # connector-focused MCP server
docker build --target agent -t example/ansible-tower-mcp:agent-local docker/   # agent runtime

docker/mcp.compose.yml runs the connector-focused :mcp server; docker/agent.compose.yml runs the agent (immutable agent digest) with a co-located :mcp sidecar.

Knowledge-graph database (epistemic-graph)

Both [mcp] and [agent] carry the epistemic-graph engine through the required Agent Utilities core dependency (epistemic-graph[full]). The [mcp] extra keeps the server connector-focused; [agent] additionally enables model orchestration. Local deployments can use the bundled engine. For production or shared state, run epistemic-graph as a dedicated database service and configure the runtime to use it. Deployment recipes (single-node + Raft HA), connection configuration, and architecture diagrams are documented in the epistemic-graph deployment guide.


Documentation

The complete documentation is published as the official documentation site and is the recommended reference for installation, deployment, and day-to-day operation.

PageContents
Installationpip, source, extras, prebuilt Docker image
Deploymentrun the MCP and agent servers, Compose, Caddy + Technitium, env config
Usagethe MCP tools, the Api client, the CLI
Overviewecosystem role, concept registry, architecture
Conceptsconcept registry (CONCEPT:ANSIBLE-*)

Repository Owners

GitHub followers GitHub User's stars


Contribute

Contributions are welcome! Please ensure code quality by executing local checks before submitting pull requests:

  • Format code using ruff format .
  • Lint code using ruff check .
  • Validate type-safety with mypy .
  • Execute test suites using pytest

Deploy with agent-utilities-deployment

Provision this package with the consolidated agent-utilities-deployment workflow. It selects an installed-package, editable-source, or immutable-container path; records only runtime secret and TLS-profile references in AgentConfig; and runs doctor, registration, policy, observability, and rollback gates. Ask your agent to "deploy ansible-tower-mcp with agent-utilities-deployment".

Install modeCommand
Installed packageuv tool install "ansible-tower-mcp[mcp]", then run ansible-tower-mcp
Editable sourceuv pip install -e ".[agent]", then run ansible-tower-mcp
Immutable containerdeploy registry.example.invalid/ansible-tower-mcp@sha256:<digest> through the operator-selected orchestrator

The repository embeds no deployment profile, credential value, certificate path, or environment-specific endpoint. Supply those at runtime through AgentConfig and the configured secret provider.

Governed capability contract

This package ships a compact canonical skill surface with specialist procedures kept as referenced workflows. The current MCP tools, skill metadata, connector_manifest.yml, ontology, mappings, shapes, fixtures, migrations, tool-schema fingerprints, and certification metadata form one versioned capability contract. Validate them together; do not rely on stale tool names or historical per-task skill wrappers.

Runtime endpoints, credentials, certificate trust, tenant identity, retention, and observability policy are deployment inputs and are never packaged values. See Configuration, trust, and privacy before enabling a network transport, connector ingestion, GraphOS delegation, or trace export.

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "ansible-tower": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "ansible-tower-mcp",
        "ansible-tower-mcp",
        "--transport",
        "http",
        "--host",
        "0.0.0.0",
        "--port",
        "8012"
      ],
      "env": {
        "ANSIBLE_BASE_URL": "https://your-ansible-tower-instance.com",
        "ANSIBLE_USERNAME": "your-username",
        "ANSIBLE_PASSWORD": "your-password",
        "ANSIBLE_TOKEN": "your-api-token",
        "VERIFY": "False"
      },
      "timeout": 200000
    }
  }
}

Dùng MCP Ansible với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Ansible, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Ansible làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Ansible.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "ansible": {
      "command": "npx",
      "args": [
        "-y",
        "ansible-tower-mcp"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Ansible, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Ansible.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Ansible giúp tôi làm việc này không?
Ansible
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Ansible.

Câu hỏi thường gặp

Máy chủ MCP Ansible dùng để làm gì?

Ansible là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Ansible với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Ansible với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Ansible với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Ansible, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Ansible với TypingMind?

Ansible hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Ansible cung cấp những công cụ nào trong TypingMind?

Ansible cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Ansible không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Ansible yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇