CML Node Operations
MCP Server
- Command:
cml-mcp (pip-installed, stdio transport)
- Requires:
CML_URL, CML_USERNAME, CML_PASSWORD environment variables
- Optional:
cml-mcp[pyats] for CLI execution via pyATS
Available Tools
Node Lifecycle
| Tool |
Parameters |
What It Does |
start_node |
lab_id/lab_title, node_id/node_label |
Start (boot) a single node |
stop_node |
lab_id/lab_title, node_id/node_label |
Stop (shutdown) a single node |
get_node |
lab_id/lab_title, node_id/node_label |
Get node details: state, CPU, RAM, interfaces, config |
get_nodes |
lab_id/lab_title |
List all nodes with their current states |
wipe_node |
lab_id/lab_title, node_id/node_label |
Wipe a node's configuration (reset to default) |
Configuration Management
| Tool |
Parameters |
What It Does |
set_node_config |
lab_id/lab_title, node_id/node_label, config |
Set a node's startup configuration |
get_node_config |
lab_id/lab_title, node_id/node_label |
Get a node's current configuration |
download_lab_configs |
lab_id/lab_title |
Download all node configs from a running lab |
Console & CLI Access
| Tool |
Parameters |
What It Does |
get_node_console |
lab_id/lab_title, node_id/node_label |
Get console connection details (URL, protocol) |
get_node_console_log |
lab_id/lab_title, node_id/node_label, lines? |
Retrieve console log output from a running node |
execute_command |
lab_id/lab_title, node_id/node_label, command |
Execute a CLI command on a running node (requires pyATS) |
Node States
| State |
Meaning |
DEFINED_ON_CORE |
Node exists but is not running |
BOOTING |
Node is in the process of booting |
BOOTED |
Node has finished booting and is reachable |
STOPPED |
Node has been shut down |
Workflow: Configure and Boot a Node
When a user wants to configure a specific node:
- Check node state:
get_node to see current state
- Set startup config:
set_node_config with the full configuration
- Start the node:
start_node to boot it
- Wait for boot: Nodes take 30-120 seconds depending on type
- Verify:
execute_command to run show version or show ip int brief
- Report: Tell the user the node is ready
Workflow: Collect Running Configs
When a user wants to back up or review configs:
- Ensure lab is running:
get_lab to check state
- Download all configs:
download_lab_configs gets everything at once
- Or target specific nodes:
get_node_config for individual nodes
- Optionally commit to GitHub: Use github-ops skill to commit configs to a repo
Workflow: Console Log Troubleshooting
When a user needs to see what happened during boot or troubleshoot a node:
- Check node state:
get_node — node must be BOOTED or BOOTING
- Get console log:
get_node_console_log to retrieve recent console output
- Analyze output: Look for error messages, boot failures, config errors
- Common issues to spot:
%PARSER-4-BADCFG — invalid configuration commands
%LINK-3-UPDOWN — interface state changes
%OSPF-5-ADJCHG — OSPF adjacency changes
%BGP-5-ADJCHANGE — BGP neighbor state changes
%SYS-5-RESTART — system restart messages
- Boot failures, license errors, memory allocation errors
- Report: Summarize the console log findings
Workflow: Execute CLI Commands
When a user wants to run show commands or make live changes:
- Verify node is BOOTED:
get_node to check state
- Execute command:
execute_command with the CLI command
- Parse output: Present the results in a readable format
- Multiple commands: Run them sequentially, one
execute_command per command
Common commands to execute:
show ip interface brief
show ip ospf neighbor
show ip bgp summary
show running-config
show cdp neighbor
show version
show ip route
show interfaces status
Workflow: Reset and Reconfigure
When a user wants to start fresh with a node:
- Stop the node:
stop_node
- Wipe the config:
wipe_node resets to factory default
- Set new config:
set_node_config with the new startup configuration
- Start the node:
start_node
- Verify: Execute show commands to confirm the new config took effect
Startup Configuration Templates
IOSv Router (Basic OSPF)
hostname {HOSTNAME}
!
interface Loopback0
ip address {LOOPBACK_IP} 255.255.255.255
!
interface GigabitEthernet0/0
ip address {MGMT_IP} {MASK}
no shutdown
!
interface GigabitEthernet0/1
ip address {P2P_IP} {MASK}
no shutdown
!
router ospf 1
router-id {LOOPBACK_IP}
network {LOOPBACK_IP} 0.0.0.0 area 0
network {P2P_NETWORK} {WILDCARD} area 0
!
line con 0
logging synchronous
line vty 0 4
login local
transport input ssh
!
end
IOSv Router (Basic BGP)
hostname {HOSTNAME}
!
interface Loopback0
ip address {LOOPBACK_IP} 255.255.255.255
!
interface GigabitEthernet0/1
ip address {PEER_IP} {MASK}
no shutdown
!
router bgp {LOCAL_AS}
bgp router-id {LOOPBACK_IP}
bgp log-neighbor-changes
neighbor {NEIGHBOR_IP} remote-as {REMOTE_AS}
!
address-family ipv4
network {LOOPBACK_IP} mask 255.255.255.255
neighbor {NEIGHBOR_IP} activate
exit-address-family
!
end
NX-OS Switch (Basic VXLAN Leaf)
hostname {HOSTNAME}
!
feature ospf
feature bgp
feature nv overlay
feature vn-segment-vlan-based
!
interface loopback0
ip address {LOOPBACK_IP}/32
!
interface Ethernet1/1
description To-Spine1
no switchport
ip address {P2P_IP}/30
no shutdown
!
router ospf 1
router-id {LOOPBACK_IP}
!
router bgp {AS}
router-id {LOOPBACK_IP}
neighbor {SPINE_IP} remote-as {AS}
update-source loopback0
address-family l2vpn evpn
send-community extended
!
end
IOS-XR Router (Basic IS-IS)
hostname {HOSTNAME}
!
interface Loopback0
ipv4 address {LOOPBACK_IP} 255.255.255.255
!
interface GigabitEthernet0/0/0/0
ipv4 address {P2P_IP} {MASK}
no shutdown
!
router isis CORE
is-type level-2-only
net 49.0001.{SYSTEM_ID}.00
address-family ipv4 unicast
metric-style wide
!
interface Loopback0
passive
address-family ipv4 unicast
!
!
interface GigabitEthernet0/0/0/0
address-family ipv4 unicast
!
!
!
end
Important Rules
- Check node state before operations — don't start an already-booted node or stop an already-stopped one
- Wait for boot — IOSv takes ~60s, NX-OS ~90s, IOS-XR ~120s to boot
execute_command requires pyATS — the cml-mcp[pyats] extra must be installed
- Set configs BEFORE starting —
set_node_config sets the startup config; apply it before boot
- Use labels not IDs — labels like "R1" are more human-readable than UUIDs
- Record in GAIT — log all configuration changes and CLI commands for audit trail
Environment Variables
CML_URL — CML server URL
CML_USERNAME — CML username
CML_PASSWORD — CML password
CML_VERIFY_SSL — Verify SSL certificate (true/false)
1---2name: cml-node-operations3description: CML node operations — start, stop, console access, CLI execution, config management, node details. Use when starting or stopping a CML node, running show commands on a lab router, setting startup configs, or reading console logs.4license: Apache-2.05---6
7# CML Node Operations
8
9## MCP Server
10
11- **Command**: `cml-mcp` (pip-installed, stdio transport)
12- **Requires**: `CML_URL`, `CML_USERNAME`, `CML_PASSWORD` environment variables
13- **Optional**: `cml-mcp[pyats]` for CLI execution via pyATS
14
15## Available Tools
16
17### Node Lifecycle
18
19| Tool | Parameters | What It Does |
20|------|-----------|-------------|
21| `start_node` | `lab_id`/`lab_title`, `node_id`/`node_label` | Start (boot) a single node |
22| `stop_node` | `lab_id`/`lab_title`, `node_id`/`node_label` | Stop (shutdown) a single node |
23| `get_node` | `lab_id`/`lab_title`, `node_id`/`node_label` | Get node details: state, CPU, RAM, interfaces, config |
24| `get_nodes` | `lab_id`/`lab_title` | List all nodes with their current states |
25| `wipe_node` | `lab_id`/`lab_title`, `node_id`/`node_label` | Wipe a node's configuration (reset to default) |
26
27### Configuration Management
28
29| Tool | Parameters | What It Does |
30|------|-----------|-------------|
31| `set_node_config` | `lab_id`/`lab_title`, `node_id`/`node_label`, `config` | Set a node's startup configuration |
32| `get_node_config` | `lab_id`/`lab_title`, `node_id`/`node_label` | Get a node's current configuration |
33| `download_lab_configs` | `lab_id`/`lab_title` | Download all node configs from a running lab |
34
35### Console & CLI Access
36
37| Tool | Parameters | What It Does |
38|------|-----------|-------------|
39| `get_node_console` | `lab_id`/`lab_title`, `node_id`/`node_label` | Get console connection details (URL, protocol) |
40| `get_node_console_log` | `lab_id`/`lab_title`, `node_id`/`node_label`, `lines?` | Retrieve console log output from a running node |
41| `execute_command` | `lab_id`/`lab_title`, `node_id`/`node_label`, `command` | Execute a CLI command on a running node (requires pyATS) |
42
43## Node States
44
45| State | Meaning |
46|-------|---------|
47| `DEFINED_ON_CORE` | Node exists but is not running |
48| `BOOTING` | Node is in the process of booting |
49| `BOOTED` | Node has finished booting and is reachable |
50| `STOPPED` | Node has been shut down |
51
52## Workflow: Configure and Boot a Node
53
54When a user wants to configure a specific node:
55
561. **Check node state**: `get_node` to see current state
572. **Set startup config**: `set_node_config` with the full configuration
583. **Start the node**: `start_node` to boot it
594. **Wait for boot**: Nodes take 30-120 seconds depending on type
605. **Verify**: `execute_command` to run `show version` or `show ip int brief`
616. **Report**: Tell the user the node is ready
62
63## Workflow: Collect Running Configs
64
65When a user wants to back up or review configs:
66
671. **Ensure lab is running**: `get_lab` to check state
682. **Download all configs**: `download_lab_configs` gets everything at once
693. **Or target specific nodes**: `get_node_config` for individual nodes
704. **Optionally commit to GitHub**: Use github-ops skill to commit configs to a repo
71
72## Workflow: Console Log Troubleshooting
73
74When a user needs to see what happened during boot or troubleshoot a node:
75
761. **Check node state**: `get_node` — node must be BOOTED or BOOTING
772. **Get console log**: `get_node_console_log` to retrieve recent console output
783. **Analyze output**: Look for error messages, boot failures, config errors
794. **Common issues to spot**:
80 - `%PARSER-4-BADCFG` — invalid configuration commands
81 - `%LINK-3-UPDOWN` — interface state changes
82 - `%OSPF-5-ADJCHG` — OSPF adjacency changes
83 - `%BGP-5-ADJCHANGE` — BGP neighbor state changes
84 - `%SYS-5-RESTART` — system restart messages
85 - Boot failures, license errors, memory allocation errors
865. **Report**: Summarize the console log findings
87
88## Workflow: Execute CLI Commands
89
90When a user wants to run show commands or make live changes:
91
921. **Verify node is BOOTED**: `get_node` to check state
932. **Execute command**: `execute_command` with the CLI command
943. **Parse output**: Present the results in a readable format
954. **Multiple commands**: Run them sequentially, one `execute_command` per command
96
97Common commands to execute:
98```
99show ip interface brief
100show ip ospf neighbor
101show ip bgp summary
102show running-config
103show cdp neighbor
104show version
105show ip route
106show interfaces status
107```
108
109## Workflow: Reset and Reconfigure
110
111When a user wants to start fresh with a node:
112
1131. **Stop the node**: `stop_node`
1142. **Wipe the config**: `wipe_node` resets to factory default
1153. **Set new config**: `set_node_config` with the new startup configuration
1164. **Start the node**: `start_node`
1175. **Verify**: Execute show commands to confirm the new config took effect
118
119## Startup Configuration Templates
120
121### IOSv Router (Basic OSPF)
122```
123hostname {HOSTNAME}
124!
125interface Loopback0
126 ip address {LOOPBACK_IP} 255.255.255.255
127!
128interface GigabitEthernet0/0
129 ip address {MGMT_IP} {MASK}
130 no shutdown
131!
132interface GigabitEthernet0/1
133 ip address {P2P_IP} {MASK}
134 no shutdown
135!
136router ospf 1
137 router-id {LOOPBACK_IP}
138 network {LOOPBACK_IP} 0.0.0.0 area 0
139 network {P2P_NETWORK} {WILDCARD} area 0
140!
141line con 0
142 logging synchronous
143line vty 0 4
144 login local
145 transport input ssh
146!
147end
148```
149
150### IOSv Router (Basic BGP)
151```
152hostname {HOSTNAME}
153!
154interface Loopback0
155 ip address {LOOPBACK_IP} 255.255.255.255
156!
157interface GigabitEthernet0/1
158 ip address {PEER_IP} {MASK}
159 no shutdown
160!
161router bgp {LOCAL_AS}
162 bgp router-id {LOOPBACK_IP}
163 bgp log-neighbor-changes
164 neighbor {NEIGHBOR_IP} remote-as {REMOTE_AS}
165 !
166 address-family ipv4
167 network {LOOPBACK_IP} mask 255.255.255.255
168 neighbor {NEIGHBOR_IP} activate
169 exit-address-family
170!
171end
172```
173
174### NX-OS Switch (Basic VXLAN Leaf)
175```
176hostname {HOSTNAME}
177!
178feature ospf
179feature bgp
180feature nv overlay
181feature vn-segment-vlan-based
182!
183interface loopback0
184 ip address {LOOPBACK_IP}/32
185!
186interface Ethernet1/1
187 description To-Spine1
188 no switchport
189 ip address {P2P_IP}/30
190 no shutdown
191!
192router ospf 1
193 router-id {LOOPBACK_IP}
194!
195router bgp {AS}
196 router-id {LOOPBACK_IP}
197 neighbor {SPINE_IP} remote-as {AS}
198 update-source loopback0
199 address-family l2vpn evpn
200 send-community extended
201!
202end
203```
204
205### IOS-XR Router (Basic IS-IS)
206```
207hostname {HOSTNAME}
208!
209interface Loopback0
210 ipv4 address {LOOPBACK_IP} 255.255.255.255
211!
212interface GigabitEthernet0/0/0/0
213 ipv4 address {P2P_IP} {MASK}
214 no shutdown
215!
216router isis CORE
217 is-type level-2-only
218 net 49.0001.{SYSTEM_ID}.00
219 address-family ipv4 unicast
220 metric-style wide
221 !
222 interface Loopback0
223 passive
224 address-family ipv4 unicast
225 !
226 !
227 interface GigabitEthernet0/0/0/0
228 address-family ipv4 unicast
229 !
230 !
231!
232end
233```
234
235## Important Rules
236
237- **Check node state before operations** — don't start an already-booted node or stop an already-stopped one
238- **Wait for boot** — IOSv takes ~60s, NX-OS ~90s, IOS-XR ~120s to boot
239- **`execute_command` requires pyATS** — the `cml-mcp[pyats]` extra must be installed
240- **Set configs BEFORE starting** — `set_node_config` sets the startup config; apply it before boot
241- **Use labels not IDs** — labels like "R1" are more human-readable than UUIDs
242- **Record in GAIT** — log all configuration changes and CLI commands for audit trail
243
244## Environment Variables
245
246- `CML_URL` — CML server URL
247- `CML_USERNAME` — CML username
248- `CML_PASSWORD` — CML password
249- `CML_VERIFY_SSL` — Verify SSL certificate (true/false)