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