# pruok8/h3c architecture

> Architecture diagram of the GitHub repository pruok8/h3c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pruok8/h3c
- Repository: https://github.com/pruok8/h3c

## Overview

dsh-h3c-lab provides two ways to automate H3C/HCL labs: a DSH plugin exposing MCP-backed native tools, and an independently usable command-line skill. The plugin bridges DSH calls through a stdio MCP client to a Python server and device consoles; its settings panel uses a host HTTP route. The skill provides scripts for topology, console operations, verification, memory, and reporting. The tree includes a second MCP server/driver copy. Some skill-stage links are documented only as capabilities, so they are shown as entry points, not an invented execution pipeline.

Main entry points: [`dsh-h3clab/lib/index.js`](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/index.js) (Plugin entry), [`dsh-h3clab/lib/tools.js`](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/tools.js) (Native tools), [`dsh-h3clab/lib/mcp-client.js`](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/mcp-client.js) (stdio MCP client), [`dsh-h3clab/lib/panel.js`](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/panel.js) (Panel API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["DSH plugin"]
  node_dsh_entry["Plugin entry<br/>[index.js]"]
  node_plugin_config["Plugin config<br/>[config.js]"]
  node_native_tools["Native tools<br/>[tools.js]"]
  node_mcp_client["stdio MCP client<br/>[mcp-client.js]"]
  node_panel_route["Panel API<br/>[panel.js]"]
  node_panel_ui["Settings panel<br/>[client.js]"]
end

subgraph group_mcp["MCP runtime"]
  node_dsh_server["Bundled MCP server<br/>[server.py]"]
  node_dsh_driver["Bundled console driver<br/>[hcldrv.py]"]
  node_standalone_server["Standalone MCP server<br/>[server.py]"]
  node_standalone_driver["Standalone console driver<br/>[hcldrv.py]"]
end

subgraph group_skill["Automation skill"]
  node_skill_entry["Skill instructions<br/>[SKILL.md]"]
  node_skill_driver["Skill console driver<br/>[hcldrv.py]"]
end

subgraph group_skill_ops["Skill workflows"]
  node_topology["Topology mapping<br/>[net2map.py]"]
  node_lab_ops["Lab operations<br/>[hcl_lab.py]"]
  node_verification["Verification matrix<br/>[verify.py]"]
  node_memory["Memory retrieval<br/>[remember.py]"]
  node_report["Report synthesis<br/>[report.py]"]
  node_other_skill_scripts["Other skill scripts"]
end

node_agent(("DSH agent"))
node_operator(("Lab operator"))
node_consoles(("HCL device consoles"))

node_agent -->|"invokes plugin"| node_dsh_entry
node_dsh_entry -->|"resolves settings"| node_plugin_config
node_dsh_entry -->|"registers tools"| node_native_tools
node_native_tools -->|"calls tools"| node_mcp_client
node_dsh_entry -->|"starts client"| node_mcp_client
node_mcp_client -->|"launches server"| node_dsh_server
node_dsh_server -->|"uses driver"| node_dsh_driver
node_dsh_driver -->|"connects by telnet"| node_consoles
node_dsh_entry -->|"registers route"| node_panel_route
node_panel_ui -->|"calls API"| node_panel_route
node_panel_route -->|"executes tools"| node_native_tools
node_operator -->|"uses skill"| node_skill_entry
node_skill_entry -->|"guides operations"| node_other_skill_scripts
node_operator -->|"maps topology"| node_topology
node_operator -->|"drives lab"| node_lab_ops
node_operator -->|"checks results"| node_verification
node_operator -->|"retrieves memory"| node_memory
node_operator -->|"creates report"| node_report
node_lab_ops -->|"uses driver"| node_skill_driver
node_verification -->|"uses driver"| node_skill_driver
node_skill_driver -->|"connects by telnet"| node_consoles
node_report -->|"uses mapping"| node_topology
node_standalone_server -->|"imports driver"| node_standalone_driver
node_standalone_driver -->|"connects by telnet"| node_consoles

click node_dsh_entry "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/index.js"
click node_plugin_config "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/config.js"
click node_native_tools "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/tools.js"
click node_mcp_client "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/mcp-client.js"
click node_panel_route "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/panel.js"
click node_panel_ui "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/client.js"
click node_dsh_server "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/scripts/server.py"
click node_dsh_driver "https://github.com/pruok8/h3c/blob/main/dsh-h3clab/scripts/hcldrv.py"
click node_standalone_server "https://github.com/pruok8/h3c/blob/main/mcp-server/server.py"
click node_standalone_driver "https://github.com/pruok8/h3c/blob/main/mcp-server/hcldrv.py"
click node_skill_entry "https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/SKILL.md"
click node_skill_driver "https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/hcldrv.py"
click node_topology "https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/net2map.py"
click node_lab_ops "https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/hcl_lab.py"
click node_verification "https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/verify.py"
click node_memory "https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/remember.py"
click node_report "https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/report.py"
click node_other_skill_scripts "https://github.com/pruok8/h3c/tree/main/skills/h3c-lab-automation/scripts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dsh_entry,node_plugin_config,node_native_tools,node_mcp_client,node_panel_route,node_panel_ui toneBlue
class node_dsh_server,node_dsh_driver,node_standalone_server,node_standalone_driver toneAmber
class node_skill_entry,node_skill_driver toneMint
class node_topology,node_lab_ops,node_verification,node_memory,node_report,node_other_skill_scripts toneRose
class node_agent,node_operator,node_consoles toneIndigo
```

## Components

### DSH plugin

- [Plugin entry](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/index.js): `dsh-h3clab/lib/index.js`
- [Plugin config](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/config.js): `dsh-h3clab/lib/config.js`
- [Native tools](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/tools.js): `dsh-h3clab/lib/tools.js`
- [stdio MCP client](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/mcp-client.js): `dsh-h3clab/lib/mcp-client.js`
- [Panel API](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/panel.js): `dsh-h3clab/lib/panel.js`
- [Settings panel](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/lib/client.js): `dsh-h3clab/lib/client.js`

### MCP runtime

- [Bundled MCP server](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/scripts/server.py): `dsh-h3clab/scripts/server.py`
- [Bundled console driver](https://github.com/pruok8/h3c/blob/main/dsh-h3clab/scripts/hcldrv.py): `dsh-h3clab/scripts/hcldrv.py`
- [Standalone MCP server](https://github.com/pruok8/h3c/blob/main/mcp-server/server.py): `mcp-server/server.py`
- [Standalone console driver](https://github.com/pruok8/h3c/blob/main/mcp-server/hcldrv.py): `mcp-server/hcldrv.py`

### Automation skill

- [Skill instructions](https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/SKILL.md): `skills/h3c-lab-automation/SKILL.md`
- [Skill console driver](https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/hcldrv.py): `skills/h3c-lab-automation/scripts/hcldrv.py`

### Skill workflows

- [Topology mapping](https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/net2map.py): `skills/h3c-lab-automation/scripts/net2map.py`
- [Lab operations](https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/hcl_lab.py): `skills/h3c-lab-automation/scripts/hcl_lab.py`
- [Verification matrix](https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/verify.py): `skills/h3c-lab-automation/scripts/verify.py`
- [Memory retrieval](https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/remember.py): `skills/h3c-lab-automation/scripts/remember.py`
- [Report synthesis](https://github.com/pruok8/h3c/blob/main/skills/h3c-lab-automation/scripts/report.py): `skills/h3c-lab-automation/scripts/report.py`
- [Other skill scripts](https://github.com/pruok8/h3c/tree/main/skills/h3c-lab-automation/scripts): `skills/h3c-lab-automation/scripts`

### Other components

- **DSH agent**
- **Lab operator**
- **HCL device consoles**

## Connections

- DSH agent → Plugin entry: invokes plugin (evidence: `README.md`)
- Plugin entry → Plugin config: resolves settings (evidence: `dsh-h3clab/lib/index.js`)
- Plugin entry → Native tools: registers tools (evidence: `dsh-h3clab/lib/index.js`)
- Native tools → stdio MCP client: calls tools (evidence: `dsh-h3clab/lib/tools.js`)
- Plugin entry → stdio MCP client: starts client (evidence: `dsh-h3clab/lib/index.js`)
- stdio MCP client → Bundled MCP server: launches server (evidence: `README.md`)
- Bundled MCP server → Bundled console driver: uses driver (evidence: `dsh-h3clab/scripts/server.py`)
- Bundled console driver → HCL device consoles: connects by telnet (evidence: `README.md`)
- Plugin entry → Panel API: registers route (evidence: `dsh-h3clab/lib/index.js`)
- Settings panel → Panel API: calls API (evidence: `dsh-h3clab/lib/panel.js`)
- Panel API → Native tools: executes tools (evidence: `dsh-h3clab/lib/panel.js`)
- Lab operator → Skill instructions: uses skill (evidence: `README.md`)
- Skill instructions → Other skill scripts: guides operations (evidence: `README.md`)
- Lab operator → Topology mapping: maps topology (evidence: `README.md`)
- Lab operator → Lab operations: drives lab (evidence: `README.md`)
- Lab operator → Verification matrix: checks results (evidence: `README.md`)
- Lab operator → Memory retrieval: retrieves memory (evidence: `README.md`)
- Lab operator → Report synthesis: creates report (evidence: `README.md`)
- Lab operations → Skill console driver: uses driver (evidence: `skills/h3c-lab-automation/scripts/hcl_lab.py`)
- Verification matrix → Skill console driver: uses driver (evidence: `skills/h3c-lab-automation/scripts/verify.py`)
- Skill console driver → HCL device consoles: connects by telnet (evidence: `README.md`)
- Report synthesis → Topology mapping: uses mapping (evidence: `skills/h3c-lab-automation/scripts/report.py`)
- Standalone MCP server → Standalone console driver: imports driver (evidence: `mcp-server/server.py`)
- Standalone console driver → HCL device consoles: connects by telnet (evidence: `mcp-server/hcldrv.py`)
