Content
# Tool List
## eNSP Automation MCP
An MCP service for eNSP topology generation, VRP configuration issuance, and experimental acceptance.
It helps agents generate network topologies, output Huawei VRP configurations, issue configurations in batches, and provide acceptance commands and debugging cases. The goal is clear: **to save the repetitive work of building topologies, writing configurations, and organizing verification commands in eNSP.**
> This is not an official Huawei tool or eNSP plugin. It is an open-source MCP project based on `.topo` engineering and Telnet/Console CLI automation.
## Current Capabilities
Currently, two campus network example templates are built-in. They are not universal templates but relatively complete starting points: with partitions, routing, exits, services, and security policies, making it convenient for experiments, demo recording, and organizing verification evidence.
`showcase` is the default template, with more devices and connections, suitable for screen recording and creating a complete topology diagram. It roughly looks like this:
- 6 VLANs: Teacher, Student, Laboratory, Server, Management, Guest.
- Over 30 devices, over 40 connections, resembling a complete campus network rather than just two switches connected.
- Access entry via Access, Trunk between switches.
- Inter-VLAN communication using AR sub-interfaces.
- Routing part uses OSPF area 0, and the exit is configured with a default route.
- DHCP address pool placed on the core routing side.
- DNS, Web, FTP services with clear addresses and test steps.
- Exit with NAT/PAT.
- ACL with two typical restrictions:
- Students cannot access the management area.
- Guests cannot access the campus intranet but can access the simulated extranet.
- Generates acceptance commands, test points, and a debugging case for easy screenshot and report writing.
`standard` is a streamlined template, retaining key network functions but with fewer devices and connections, more suitable for defense explanations, classroom demonstrations, and quick verification:
- 13 devices, 12 connections.
- 6 VLANs: Teacher, Student, Laboratory, Server, Management, Guest.
- 1 ISP router, 1 exit router, 1 core switch, 1 access switch.
- 3 servers (DNS, Web, FTP) and 5 types of test terminals.
- Exit router responsible for inter-VLAN gateway, DHCP, static default routing, NAT/PAT, and ACL.
## Important Limitations
eNSP, unlike Packet Tracer, does not have a stable, publicly available `addDevice/addLink` canvas control interface. Therefore, this project adopts a more stable approach:
1. Generate `.topo` topology engineering.
2. Open the topology in eNSP and start devices.
3. MCP scans eNSP-exposed Telnet/Console ports.
4. MCP issues VRP configurations in batches and saves them.
Some eNSP versions may not stably load the `vrpcfg.zip` generated in the engineering. If devices still show `<Huawei>`, the project is not invalid; directly use the batch configuration issuance tool.
PC/Server IPs and DNS/Web/FTP graphical services may not be stably restored from `.topo`. It is recommended to manually confirm before report acceptance.
## Quick Installation
```powershell
git clone https://github.com/<your-name>/ensp-automation-mcp.git
cd ensp-automation-mcp
pip install -e . --no-deps --no-build-isolation
```
If your local machine can normally install MCP dependencies, you can directly:
```powershell
pip install -e .
```
## MCP Client Configuration
General MCP JSON configuration example:
```json
{
"mcpServers": {
"ensp-automation-mcp": {
"command": "ensp-automation-mcp",
"args": []
}
}
}
```
Codex-style TOML configuration example:
```toml
[mcp_servers.ensp-automation-mcp]
command = "ensp-automation-mcp"
args = []
```
After configuring, restart your agent/MCP client.
## Tool List
| Tool | Purpose |
| --- | --- |
| `ensp_getCampusPlan` | View built-in campus network plans |
| `ensp_generateCampusProject` | Generate `.topo`, configurations, service steps, test plans |
| `ensp_generateCampusConfigs` | Output all VRP configurations |
| `ensp_getVerificationPlan` | Output acceptance commands, business tests, debugging cases |
| `ensp_scanTelnetPorts` | Scan eNSP device Telnet/Console ports |
| `ensp_telnetConnect` | Connect to a single eNSP device |
| `ensp_telnetExecute` | Execute commands on a single device |
| `ensp_telnetApplyConfig` | Issue configurations to a single device in batch |
| `ensp_applyCampusConfigsByPortRange` | Issue the entire campus network configuration with one click according to the default port mapping |
| `ensp_saveCampusConfigsByPortRange` | Save the entire campus network configuration with one click according to the default port mapping |
| `ensp_telnetListSessions` | View current Telnet sessions |
| `ensp_telnetDisconnect` | Disconnect Telnet sessions |
## Recommended Usage Process
1. Call `ensp_generateCampusProject` to generate the project. The default is `showcase`; if you need a streamlined version, pass `template: "standard"`.
2. Open the generated `.topo` in eNSP.
3. Start devices, recommended to start in batches: routers first, then core/aggregation switches, access switches, and finally PCs/servers.
4. Call `ensp_scanTelnetPorts` to confirm port online status.
5. Call `ensp_applyCampusConfigsByPortRange` to issue configurations in batch.
6. Call `ensp_saveCampusConfigsByPortRange` to save device configurations.
7. Call `ensp_getVerificationPlan` to verify according to commands and screenshots.
Default port mapping starts from 2000:
```text
showcase:
AR-ISP 2000
AR-EDGE 2001
AR-CORE-A 2002
AR-CORE-B 2003
LSW-CORE1 2004
...
LSW-IOT-ACC 2019
standard:
AR-ISP 2000
AR-EDGE 2001
LSW-CORE 2002
LSW-ACCESS 2003
```
## Manual Server Services
If eNSP Server graphical services are not automatically restored, manually set:
```text
SRV-DNS
IP: 192.168.40.10/24
Gateway: 192.168.40.1
DNS: On
www.campus.local -> 192.168.40.20
ftp.campus.local -> 192.168.40.30
SRV-WEB
IP: 192.168.40.20/24
Gateway: 192.168.40.1
HTTP: On
SRV-FTP
IP: 192.168.40.30/24
Gateway: 192.168.40.1
FTP: On
User: ftpuser / cisco
```
## Applicable Scenarios
If you are doing these things, this project will be handy:
- eNSP network experiments, not wanting to drag devices from scratch or write repetitive configurations.
- Network engineering demonstrations needing a complete, configurationally sound topology.
- Letting MCP-supported agents generate topologies, issue configurations, and list acceptance commands.
- Researching eNSP engineering files and VRP configuration automation.
## Clarification on Limitations
- It is not for managing real production networks.
- It is not an official Huawei tool; eNSP version differences may lead to compatibility issues.
- It cannot bypass eNSP's own limitations, such as sometimes needing manual server graphical service settings.
- It is not "open topology and 100% automatic configuration recovery." If devices still show `<Huawei>`, use Telnet batch configuration issuance.
## Development
```powershell
python -m py_compile (Get-ChildItem -Path .\src\ensp_automation_mcp -Filter *.py | ForEach-Object { $_.FullName })
python -c "from ensp_automation_mcp.tools import TOOLS; print(len(TOOLS)); print([t['name'] for t in TOOLS])"
```
## License
MIT License. See [LICENSE](LICENSE).