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 namerunning_config: Current device configurationintended_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 namerunning_config: Current configurationintended_config: Target configuration
generate_rollback
Generate commands to revert from intended config back to running config.
Parameters:
platform: Network platform namerunning_config: Original configurationintended_config: Configuration to rollback from
predict_config
Predict the configuration state after applying changes.
Parameters:
platform: Network platform namecurrent_config: Current configurationchange_config: Changes to apply
unified_diff_configs
Generate a unified diff between two configurations.
Parameters:
platform: Network platform nameconfig_a: First configurationconfig_b: Second configurationlabel_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):
- Run the prepare release workflow (
Actions→prepare release→Run workflow), picking the branch to release from in the branch dropdown and the version bump type (major,minor,patch, orprerelease). It bumps the version withpoetry version, opens achore(release): prepare X.Y.ZPR against the chosen branch, and creates a draft GitHub release taggedvX.Y.Z. - Merge the release PR.
- 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
Release files for hier-config-mcp 0.1.1a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hier_config_mcp-0.1.1a0.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hier_config_mcp-0.1.1a0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / hier_config_mcp-0.1.1a0.tar.gz
| Download URL | hier_config_mcp-0.1.1a0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
221ae3f39100c64b2891579cd9663c7d38b7eda1feda9fae31e4a4a8933d1b6c
|
|
BLAKE2b-256 checksum How to use checksums |
e7b4dad14787e33d863f541f9e8c5a05de374087e1bf115ec6552f2a7d5e332f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.14 Darwin/25.5.0
|
Release files / hier_config_mcp-0.1.1a0-py3-none-any.whl
| Download URL | hier_config_mcp-0.1.1a0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f92048eddcc43aa318589f52374b2fc4132e1b3056dc9e824561350c8a816c0
|
|
BLAKE2b-256 checksum How to use checksums |
1b8fd2a2497ea71f84344cfb676c2de8f88b5a4fbd126716f4fbd03d28a7657c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.14 Darwin/25.5.0
|