cisco-pt-mcp

v0.1.8
cisco-pt-mcp Checked 2 days ago Published 4 days ago

MCP 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.

ParameterTypeDescription
deviceModel *stringDevice model. Router: 2911/1941/2811/2901. Switch: 2960-24TT/2950-24/3560-24PS. End device: PC-PT/Server-PT/Laptop-PT/Printer-PT.
deviceName *stringUnique name for the device (must not already exist).
x *numberX coordinate on workspace.
y *numberY 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.

ParameterTypeDescription
deviceName *stringExisting device name.
model *stringModule model, e.g. HWIC-2T (serial), NM-4E (ethernet).
slot *integer | stringSlot path string (e.g. "0/0", "0/1"). An integer or numeric string N auto-tries "N", "0/N", "N/0".

removeDevice

Remove one or more devices from the workspace.

ParameterTypeDescription
deviceNames *arrayArray of existing device names to remove.

configurePcIp

Configure IP settings on a PC or end device.

ParameterTypeDescription
deviceName *stringPC name (must exist).
defaultGatewaystringDefault gateway.
dhcpEnabledbooleanTrue for DHCP, false for static IP.
dnsServerstringDNS server.
ipaddressstringIP address (if static).
subnetMaskstringSubnet 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.

ParameterTypeDescription
commands *stringNewline-separated IOS commands.
deviceName *string
commandTimeoutMsintegerLongest wait for one slow command such as ping or traceroute (default 30000).
savebooleanSave 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.

ParameterTypeDescription
formatstringImage format (default PNG).

getDeviceInfo

Detailed info about one device, including interfaces and incident links.

ParameterTypeDescription
deviceName *string

setSimulationMode

Switch Packet Tracer between simulation mode and realtime mode. Simulation mode is required before sending PDUs or stepping through traffic.

ParameterTypeDescription
toSimMode *booleantrue = 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).

ParameterTypeDescription
direction *string'forward' advances one step, 'backward' goes back one step, 'reset' clears all PDUs and returns to time 0.
stepsintegerNumber 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.

ParameterTypeDescription
destinationDevice *stringName of the destination device.
sourceDevice *stringName of the source device.

renameDevice

Rename an existing device. The new name must be unique in the workspace.

ParameterTypeDescription
deviceName *stringCurrent device name.
newName *stringNew unique name for the device.

moveDevice

Move a device to new coordinates on the logical workspace canvas.

ParameterTypeDescription
deviceName *stringDevice to reposition.
x *numberNew X coordinate.
y *numberNew Y coordinate.

setPower

Power a device on or off.

ParameterTypeDescription
deviceName *stringDevice name.
power *booleantrue = 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.

ParameterTypeDescription
typesarrayOnly 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.

ParameterTypeDescription
deviceNamestringReturn only entries from this device. Omit to return all devices.
limitintegerMaximum 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).

ParameterTypeDescription
command *stringCommand line to execute in the device Command Prompt.
deviceName *stringPC/Laptop/Server name (must exist).
timeoutMsintegerMax 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.

ParameterTypeDescription
devicesarrayDevices to add, in order.
linksarrayCables 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.
pcConfigsarrayOptional PC/end-device IP settings applied after links.
stopOnErrorbooleanIf true (default), stop at the first failed step. If false, continue and report all failures.