Skip to main content

Ansible Knowledge MCP Server — module and role discovery, documentation, and skill generation for AI agents

Project description

Ansible Know MCP Server

Module discovery, documentation search, and skill generation for AI agents via the Model Context Protocol.

What It Does

Ansible Know is the foundational "learn" layer for AI agents working with Ansible. It provides:

  • Galaxy collection discovery — search 2000+ collections on Ansible Galaxy by keyword, ranked by download count
  • Module discovery — search and explore Ansible modules across installed collections
  • Module documentation — get structured parameter specs, examples, and metadata (falls back to Galaxy if not installed locally)
  • Documentation search — find conceptual guides from Ansible's AI-friendly docs
  • Skill generation — create ready-to-use skill packages that teach agents how to use specific modules
  • Collection bootstrapping — auto-install collections from Galaxy for the current session
  • Collection manifests — get collection-level overviews with per-module summaries
  • Resources — browse skills and doc sources as MCP resources
  • Prompts — pre-built templates for playbook review, module explanation, and role generation

Together with Ansible Devtools MCP (build) and AAP MCP (deploy), this enables the full autonomous cycle: learn -> build -> deploy.

 Agent's MCP servers:

 +-----------------------+  +-------------------+  +---------------+
 | Ansible Know          |  | Ansible Devtools  |  |   AAP MCP     |
 | (this project)        |  |                   |  |               |
 |                       |  |                   |  |               |
 | search_collections    |  | ansible_lint      |  | controller.*  |
 | search_modules        |  | ansible_navigator |  | eda.*         |
 | get_module_doc        |  | ansible_create_*  |  | gateway.*     |
 | get_role_doc          |  | build_ee          |  | galaxy.*      |
 | get_collection_       |  | zen_of_ansible    |  |               |
 |   manifest            |  | setup_environment |  |               |
 | search_docs           |  | environment_info  |  |               |
 | ensure_collection     |  |                   |  |               |
 | generate_skill        |  |                   |  |               |
 | generate_role_skill   |  |                   |  |               |
 | generate_collection   |  |                   |  |               |
 | list_skills           |  |                   |  |               |
 | get_skill             |  |                   |  |               |
 |                       |  |                   |  |               |
 | LEARN                 |  | BUILD             |  | DEPLOY        |
 +-----------------------+  +-------------------+  +---------------+

Installation

Using uvx (recommended):

uvx ansible-know-mcp

Using pip:

pip install ansible-know-mcp

Runtime requirement: ansible-core must be installed in the same environment (for ansible-doc).

Usage

With Claude Code

claude mcp add ansible-know -- uvx ansible-know-mcp

To make it available in all projects:

claude mcp add --scope user ansible-know -- uvx ansible-know-mcp

With VS Code / Cursor

Add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "ansible-know": {
      "command": "uvx",
      "args": ["ansible-know-mcp"],
      "type": "stdio"
    }
  }
}

With any MCP client

The server runs over stdio by default:

uvx ansible-know-mcp

Full stack configuration

{
  "mcpServers": {
    "ansible-know":     { "command": "uvx", "args": ["ansible-know-mcp"] },
    "ansible-devtools": { "command": "ade", "args": ["mcp"] },
    "aap":              { "command": "aap-mcp-server" }
  }
}

Tools

Discovery (read-only)

Tool Description
search_collections(query, tags?) Search Ansible Galaxy for collections by keyword. Returns results ranked by download count.
search_modules(keyword, namespace?) Find modules by keyword in name or description. Returns up to 50 matches.
get_module_doc(module_name) Get full structured docs: params, examples, API detection. Falls back to Galaxy if not installed locally.
get_role_doc(role_name) Get role documentation with three-tier resolution: local ansible-doc, Galaxy README, or graceful degradation.
search_docs(query, source?, topic?, audience?, core_only?) Search documentation manifests for conceptual guides. Returns up to 20 matches.
get_collection_manifest(collection_namespace) Get collection-level manifest with per-module and per-role summaries.

Collection management

Tool Description
ensure_collection(collection_namespace, version?) Install a collection to a temporary directory for this session.

Skill management

Tool Description
list_skills() List all generated skills (read-only).
get_skill(skill_name) Read a skill's SKILL.md content (read-only).
generate_skill(module_name, install_to?) Generate a skill package for one module. Returns SKILL.md inline.
generate_role_skill(role_name, install_to?) Generate a skill package for one role. Returns SKILL.md inline.
generate_collection_skills(collection_namespace, install_to?) Batch generate skills for an entire collection.

Resources

URI Description
skills://list List all generated skill packages
skills://{skill_name} Read a skill's SKILL.md content by FQCN
galaxy://installed List collections installed in this session
docs://sources List configured documentation manifest sources

Prompts

Prompt Description
review_playbook(playbook_yaml) Review a playbook against module docs and best practices
explain_module(module_name) Get a detailed module explanation with usage examples
generate_role(role_purpose, modules) Generate a role skeleton using specified modules
find_collection(platform_or_use_case) Guide through search, install, and explore workflow

Upgrading

The server exposes its version via the MCP protocol. To upgrade to the latest release:

Installation method Upgrade command
uvx uvx --upgrade ansible-know-mcp
pip pip install --upgrade ansible-know-mcp
Claude Code (claude mcp add) uvx --upgrade ansible-know-mcp then restart Claude Code
VS Code / Cursor uvx --upgrade ansible-know-mcp then reload window
Local dev git pull && uv sync

Note: uvx caches the installed version. It does not auto-upgrade on new releases. To always run the latest version at the cost of slower startup, register with: claude mcp add ansible-know -- uvx --upgrade ansible-know-mcp

Development

git clone https://github.com/leogallego/ansible-know-mcp.git
cd ansible-know-mcp
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
pytest

Configuration

Environment Variable Description Default
ANSIBLE_KNOWLEDGE_SKILLS_DIR Where to write generated skills ./skills/
ANSIBLE_KNOWLEDGE_DOC_SOURCES JSON dict of doc manifest sources Built-in ansible-core source
ANSIBLE_KNOWLEDGE_GALAXY_URL Galaxy API base URL https://galaxy.ansible.com

License

GPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ansible_know_mcp-0.3.2.tar.gz (216.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ansible_know_mcp-0.3.2-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file ansible_know_mcp-0.3.2.tar.gz.

File metadata

  • Download URL: ansible_know_mcp-0.3.2.tar.gz
  • Upload date:
  • Size: 216.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ansible_know_mcp-0.3.2.tar.gz
Algorithm Hash digest
SHA256 624144ddb65bf57ce396b29589a2bd482f79391799cc0808b1afc6892074915d
MD5 4854489d7a6063a2887976355ab9fe18
BLAKE2b-256 e2fc143b04bd7df936e27e4b86d2c9e8797e123c314efe207029e3d5a9f02107

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansible_know_mcp-0.3.2.tar.gz:

Publisher: publish.yml on leogallego/ansible-know-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ansible_know_mcp-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_know_mcp-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ab32324343b7613608c4163e09e9e14fb3165dd1330ef667a413af8800d336e7
MD5 5bd11854254de9cee9cbedd3c7e93fc2
BLAKE2b-256 dc357beaa5ee84ddc55cef97911be69cadecfae4c0fbf0fe84f51b12a95fdb1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansible_know_mcp-0.3.2-py3-none-any.whl:

Publisher: publish.yml on leogallego/ansible-know-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page