Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

hier-config-mcp

An MCP (Model Context Protocol) server that exposes hier_config's network configuration comparison and remediation capabilities to AI assistants like Claude.

Features

  • Configuration Parsing: Parse network device configurations into hierarchical structures
  • Configuration Comparison: Compare running vs intended configurations
  • Remediation Generation: Generate commands to bring devices into compliance
  • Rollback Generation: Generate commands to revert changes
  • Future State Prediction: Predict configuration state after applying changes
  • Unified Diff: Generate diffs between configurations

Supported Platforms

  • CISCO_IOS - Cisco IOS (classic IOS for routers and switches)
  • CISCO_NXOS - Cisco NX-OS (Nexus switches)
  • CISCO_XR - Cisco IOS-XR (carrier-grade routers)
  • ARISTA_EOS - Arista EOS (data center switches)
  • ARUBA_AOSCX - Aruba AOS-CX
  • HP_COMWARE5 - HP Comware 5
  • HP_PROCURVE - HP ProCurve
  • HUAWEI_VRP - Huawei VRP
  • JUNIPER_JUNOS - Juniper Junos
  • NOKIA_SRL - Nokia SR Linux
  • VYOS - VyOS
  • FORTINET_FORTIOS - Fortinet FortiOS
  • GENERIC - Platform-agnostic parsing

Installation

# Clone the repository
git clone https://github.com/jtdub/hier-config-mcp.git
cd hier-config-mcp

# Install dependencies with Poetry
poetry install

Usage

Running the Server

# Run the MCP server
poetry run hier-config-mcp

# Or use the MCP development server with inspector
poetry run mcp dev hier_config_mcp/server.py

Claude Desktop Configuration

Add to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "hier-config": {
      "command": "poetry",
      "args": [
        "-C",
        "/path/to/hier-config-mcp",
        "run",
        "hier-config-mcp"
      ]
    }
  }
}

Available Tools

list_platforms

List all supported network platforms.

parse_config

Parse network device configuration text into a hierarchical format.

Parameters:

  • platform: Network platform name (e.g., "CISCO_IOS")
  • config: Configuration text to parse

compare_configs

Compare running configuration against intended configuration and generate both remediation and rollback commands.

Parameters:

  • platform: Network platform name
  • running_config: Current device configuration
  • intended_config: Desired configuration

Returns: Object with remediation and rollback commands

generate_remediation

Generate commands to transform running config to intended config.

Parameters:

  • platform: Network platform name
  • running_config: Current configuration
  • intended_config: Target configuration

generate_rollback

Generate commands to revert from intended config back to running config.

Parameters:

  • platform: Network platform name
  • running_config: Original configuration
  • intended_config: Configuration to rollback from

predict_config

Predict the configuration state after applying changes.

Parameters:

  • platform: Network platform name
  • current_config: Current configuration
  • change_config: Changes to apply

unified_diff_configs

Generate a unified diff between two configurations.

Parameters:

  • platform: Network platform name
  • config_a: First configuration
  • config_b: Second configuration
  • label_a: Label for first config (optional)
  • label_b: Label for second config (optional)

Documentation

Full documentation — user, administrator, developer, and maintainer guides — lives in docs/ and is built with mkdocs:

poetry run mkdocs serve

Development

This repo follows the same development standards as hier_config: ruff (select = ["ALL"], preview, line length 88), mypy strict, pyright strict, pylint, yamllint, and flynt, with a 95% test coverage floor. All checks run in parallel via scripts/build.py.

Docker Development Environment

A Docker-based workflow modeled on Nautobot app development is available via invoke — see docs/dev/docker-development.md:

invoke build     # build the dev image
invoke start     # start the dev container
invoke tests     # run everything CI runs, inside the container
invoke destroy   # tear down

Lint and Test

# Full lint + test suite (what CI runs)
poetry run python scripts/build.py lint-and-test

# Lint only
poetry run python scripts/build.py lint

# Auto-fix formatting and fixable lint findings
poetry run python scripts/build.py lint --fix

# Tests with coverage (95% required)
poetry run python scripts/build.py pytest --coverage

# Tests directly
poetry run pytest

Pre-commit Hook

# One-time setup; the hook runs the full lint suite before each commit
poetry run pre-commit install

Releasing

Releases are driven by two GitHub Actions workflows (admin permission required):

  1. Run the prepare release workflow (Actionsprepare releaseRun workflow), picking the branch to release from in the branch dropdown and the version bump type (major, minor, patch, or prerelease). It bumps the version with poetry version, opens a chore(release): prepare X.Y.Z PR against the chosen branch, and creates a draft GitHub release tagged vX.Y.Z.
  2. Merge the release PR.
  3. Publish the draft release. Publishing triggers the release workflow, which builds and publishes the package to PyPI automatically (poetry publish --build).

Project Structure

hier-config-mcp/
├── pyproject.toml
├── README.md
├── mkdocs.yml
├── docs/
│   ├── index.md
│   ├── user/
│   ├── admin/
│   └── dev/
├── hier_config_mcp/
│   ├── __init__.py
│   ├── py.typed
│   └── server.py
└── tests/
    ├── __init__.py
    └── test_server.py

License

MIT

Download files

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

Source Distribution

hier_config_mcp-0.1.1a0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

hier_config_mcp-0.1.1a0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file hier_config_mcp-0.1.1a0.tar.gz.

File metadata

  • Download URL: hier_config_mcp-0.1.1a0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.14 Darwin/25.5.0

File hashes

Hashes for hier_config_mcp-0.1.1a0.tar.gz
Algorithm Hash digest
SHA256 221ae3f39100c64b2891579cd9663c7d38b7eda1feda9fae31e4a4a8933d1b6c
MD5 07ef27c35a5958a479d2c74f567d1da1
BLAKE2b-256 e7b4dad14787e33d863f541f9e8c5a05de374087e1bf115ec6552f2a7d5e332f

See more details on using hashes here.

File details

Details for the file hier_config_mcp-0.1.1a0-py3-none-any.whl.

File metadata

  • Download URL: hier_config_mcp-0.1.1a0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.14 Darwin/25.5.0

File hashes

Hashes for hier_config_mcp-0.1.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f92048eddcc43aa318589f52374b2fc4132e1b3056dc9e824561350c8a816c0
MD5 15adea652c9ac69d96885694412534c7
BLAKE2b-256 1b8fd2a2497ea71f84344cfb676c2de8f88b5a4fbd126716f4fbd03d28a7657c

See more details on using hashes here.

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