cisco-pt-mcp
v0.1.8MCP server that drives Cisco Packet Tracer through a bridge extension.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
addDevice
Add a single network device to the workspace. For multiple devices plus links/IPs, prefer buildTopology (one round-trip). Call getNetwork first if unsure whether the chosen deviceName is already taken; names must be unique.
| Parameter | Type | Description |
|---|---|---|
deviceModel * | string | Device model. Router: 2911/1941/2811/2901. Switch: 2960-24TT/2950-24/3560-24PS. End device: PC-PT/Server-PT/Laptop-PT/Printer-PT. |
deviceName * | string | Unique name for the device (must not already exist). |
x * | number | X coordinate on workspace. |
y * | number | Y coordinate on workspace. |
addModule
Add an interface module to a device. Powers the device off, installs the module, powers it back on. The slot is a path string — e.g. a WIC/HWIC bay on a 2811 is "0/0" (verified live: installs Serial0/0/0 + Serial0/0/1). If you pass a bare integer N, the paths "N", "0/N" and "N/0" are tried automatically.
| Parameter | Type | Description |
|---|---|---|
deviceName * | string | Existing device name. |
model * | string | Module model, e.g. HWIC-2T (serial), NM-4E (ethernet). |
slot * | integer | string | Slot path string (e.g. "0/0", "0/1"). An integer or numeric string N auto-tries "N", "0/N", "N/0". |
addLink
Connect two devices with a cable. Both interfaces must be free (in_use=false in getNetwork output). If unsure, call getNetwork first.
| Parameter | Type | Description |
|---|---|---|
device1Interface * | string | Free interface on device 1. |
device1Name * | string | |
device2Interface * | string | Free interface on device 2. |
device2Name * | string | |
linkType * | string | Cable type. 'auto' resolves the type from the two port types (recommended default). 'console' uses the hidden ports "RS 232" (PC) and "Console" (router) — they are not listed by getDeviceInfo but co… |
removeDevice
Remove one or more devices from the workspace.
| Parameter | Type | Description |
|---|---|---|
deviceNames * | array | Array of existing device names to remove. |
removeLink
Remove one or more cables. Each entry identifies one endpoint of the link.
| Parameter | Type | Description |
|---|---|---|
links * | array | Array of {device, port} endpoints. |
configurePcIp
Configure IP settings on a PC or end device.
| Parameter | Type | Description |
|---|---|---|
deviceName * | string | PC name (must exist). |
defaultGateway | string | Default gateway. |
dhcpEnabled | boolean | True for DHCP, false for static IP. |
dnsServer | string | DNS server. |
ipaddress | string | IP address (if static). |
subnetMask | string | Subnet mask (if static). |
configureIosDevice
Run IOS commands on a router or switch and return the output of each one. Commands are typed into the device console starting from global config mode, so do not send 'enable' or 'configure terminal'. Exec commands (show, ping, traceroute, write, copy, clear, debug) work from here too: they are run with 'do' automatically. Use this both to configure and to verify, e.g. "show ip interface brief" or "show ip route". A command IOS refuses is reported with rejected=true and its error text, and success is false. The running config is saved afterwards unless save is false.
| Parameter | Type | Description |
|---|---|---|
commands * | string | Newline-separated IOS commands. |
deviceName * | string | |
commandTimeoutMs | integer | Longest wait for one slow command such as ping or traceroute (default 30000). |
save | boolean | Save the running config with 'write memory' when done (default true). Pass false for read-only checks such as show commands. |
getNetwork
Snapshot of the entire workspace: every device, its interfaces (with in_use flags), and every cable. Each interface also reports its link light (light: off, amber, green or blink; a cabled port that is down shows 'off', drawn as a red triangle on the canvas), portUp (status) and protocolUp (line protocol); each connection has up=true only when both ends have port and protocol up. Use these to check whether a link is down, e.g. after shutdown or a powered-off device. Hidden ports (Console, "RS 232", WIC serials) appear in interfaces once a cable uses them. Call this before addLink or removeDevi…
getWorkspaceImage
Screenshot of the Packet Tracer logical workspace, returned as an image: devices, their labels, cables and link-light triangles (green up, red down). Use it to look at the topology the way a student sees it. For exact per-port state prefer getNetwork.
| Parameter | Type | Description |
|---|---|---|
format | string | Image format (default PNG). |
getDeviceInfo
Detailed info about one device, including interfaces and incident links.
| Parameter | Type | Description |
|---|---|---|
deviceName * | string |
setSimulationMode
Switch Packet Tracer between simulation mode and realtime mode. Simulation mode is required before sending PDUs or stepping through traffic.
| Parameter | Type | Description |
|---|---|---|
toSimMode * | boolean | true = simulation mode, false = realtime mode. |
getSimulationStatus
Query the current simulation state: mode (realtime or simulation), elapsed simulation time, PDU frame count, and current frame index.
stepSimulation
Step the simulation forward or backward, or reset it entirely. PT must already be in simulation mode (use setSimulationMode first).
| Parameter | Type | Description |
|---|---|---|
direction * | string | 'forward' advances one step, 'backward' goes back one step, 'reset' clears all PDUs and returns to time 0. |
steps | integer | Number of steps to take (ignored for 'reset'). Defaults to 1. |
sendPdu
Add an ICMP ping PDU between two devices using PT's native Simple PDU mechanism. Automatically enables simulation mode if not already active. Use stepSimulation to advance and getPduResults to check if the ping succeeded.
| Parameter | Type | Description |
|---|---|---|
destinationDevice * | string | Name of the destination device. |
sourceDevice * | string | Name of the source device. |
renameDevice
Rename an existing device. The new name must be unique in the workspace.
| Parameter | Type | Description |
|---|---|---|
deviceName * | string | Current device name. |
newName * | string | New unique name for the device. |
moveDevice
Move a device to new coordinates on the logical workspace canvas.
| Parameter | Type | Description |
|---|---|---|
deviceName * | string | Device to reposition. |
x * | number | New X coordinate. |
y * | number | New Y coordinate. |
setPower
Power a device on or off.
| Parameter | Type | Description |
|---|---|---|
deviceName * | string | Device name. |
power * | boolean | true = power on, false = power off. |
getPduResults
Read the outcome of PDUs in the current simulation — source, destination, traffic type, and status (accepted/dropped/in_transit/etc). Call after stepSimulation to verify connectivity. Use the types filter to show only ICMP, TCP, etc. and hide STP/DTP background noise.
| Parameter | Type | Description |
|---|---|---|
types | array | Only return frames matching these traffic type names (e.g. ["ICMP"], ["ICMP","ARP"]). Omit to return all frames. |
getCommandLog
Read the IOS command history logged by Packet Tracer. Optionally filter by device name and cap the number of returned entries.
| Parameter | Type | Description |
|---|---|---|
deviceName | string | Return only entries from this device. Omit to return all devices. |
limit | integer | Maximum entries to return, newest first. Defaults to 50. |
runPcCommand
Run a command in a PC/Laptop's Command Prompt (e.g. "ping 192.168.1.2", "ipconfig", "telnet 192.168.0.1") and return {success, output, prompt}. Long-running commands are polled until output settles and the C:\> prompt returns, or timeoutMs expires. Requires the current PT extension (verified live on PT 8.0 and 9.0.1).
| Parameter | Type | Description |
|---|---|---|
command * | string | Command line to execute in the device Command Prompt. |
deviceName * | string | PC/Laptop/Server name (must exist). |
timeoutMs | integer | Max wait in ms (default 15000, capped at 60000). |
buildTopology
Build a topology in ONE call: add devices, create links, and optionally configure PC IPs. Prefer this over many sequential addDevice/addLink/configurePcIp calls — it is much faster because it avoids repeated MCP round-trips. Order: devices first, then links, then pcConfigs.
| Parameter | Type | Description |
|---|---|---|
devices | array | Devices to add, in order. |
links | array | Cables to create after devices exist. Same rules as addLink: prefer 'auto'; console uses "RS 232"<->"Console"; serial needs a serial module installed with addModule first. |
pcConfigs | array | Optional PC/end-device IP settings applied after links. |
stopOnError | boolean | If true (default), stop at the first failed step. If false, continue and report all failures. |