mcp-tracer
v0.1.1Design Cisco Packet Tracer topologies with AI agents and generate ready-to-run PTBuilder scripts.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
add_device Add device
Add a device to the topology. `model` must be a PTBuilder model key; common aliases are resolved and the result shows the canonical key ("4331" -> ISR4331, "WRT300N" -> Linksys-WRT300N, "ASA5505" -> 5505, "IP Phone 7960" -> 7960, "PC" -> PC-PT). Routers: 1841, 1941, 2811, 2901, 2911, ISR4321, ISR4331. Switches: 2950-24, 2950T-24, 2960-24TT. Multilayer switches: 3560-24PS (preferred), 3650-24PS (ships without a power supply in PT). Hosts: PC-PT, Server-PT, Laptop-PT, Printer-PT. Other: Hub-PT, Cloud-PT, AccessPoint-PT, Linksys-WRT300N, 5505, 5506-X, 7960. The pt://catalog resource lists every a…
| Parameter | Type | Description |
|---|---|---|
model * | string | PTBuilder model key, e.g. 2911, 2960-24TT, PC-PT. Aliases such as "4331", "WRT300N" or "PC" are resolved. |
name * | string | Unique device name, e.g. R1, S1, PC1: 1-64 characters: letters, digits, spaces and . _ ( ) / -, starting with a letter or digit. Names are case-insensitive. |
x | number | X coordinate on the Packet Tracer logical workspace, -100000 to 100000. Omit both x and y for automatic placement. |
y | number | Y coordinate on the Packet Tracer logical workspace, -100000 to 100000. Omit both x and y for automatic placement. |
add_link Add link
Connect two device ports with a cable. Use Packet Tracer interface names; abbreviations are expanded (Gi0/0 -> GigabitEthernet0/0, Fa0/1 -> FastEthernet0/1, Se0/0/0 -> Serial0/0/0). Each port can belong to only one link, and the two ends must be on different devices. Onboard ports: 1841: FastEthernet0/0-1; 1941: GigabitEthernet0/0-1; 2811: FastEthernet0/0-1; 2901: GigabitEthernet0/0-1; 2911: GigabitEthernet0/0-2; ISR4321: GigabitEthernet0/0/0-1 (unverified); ISR4331: GigabitEthernet0/0/0-2 (unverified); 2950-24: FastEthernet0/1-24 (unverified); 2950T-24: FastEthernet0/1-24, GigabitEthernet0/1-…
| Parameter | Type | Description |
|---|---|---|
dev1 * | string | Device name, e.g. R1, S1, PC1 (case-insensitive). |
dev2 * | string | Device name, e.g. R1, S1, PC1 (case-insensitive). |
port1 * | string | Interface name, e.g. GigabitEthernet0/0, FastEthernet0/1, FastEthernet0 (abbreviations such as Gi0/0 are expanded). |
port2 * | string | Interface name, e.g. GigabitEthernet0/0, FastEthernet0/1, FastEthernet0 (abbreviations such as Gi0/0 are expanded). |
cable | string | Cable type. Omit it to let the server infer the right one (recommended). "auto" is passed to PT as-is and its behaviour is unverified. |
remove_device Remove device
Remove a device together with its links, IOS commands and IP configuration.
| Parameter | Type | Description |
|---|---|---|
name * | string | Device name, e.g. R1, S1, PC1 (case-insensitive). |
remove_link Remove link
Remove the link that uses the given device port (a port belongs to at most one link).
| Parameter | Type | Description |
|---|---|---|
device * | string | Device name, e.g. R1, S1, PC1 (case-insensitive). |
port * | string | Interface name, e.g. GigabitEthernet0/0, FastEthernet0/1, FastEthernet0 (abbreviations such as Gi0/0 are expanded). |
rename_device Rename device
Rename a device; its links, IOS commands and IP configuration follow. IOS `hostname` commands are not changed (use configure_device with replace: true to update them).
| Parameter | Type | Description |
|---|---|---|
name * | string | Device name, e.g. R1, S1, PC1 (case-insensitive). |
new_name * | string | New unique device name, e.g. R1, S1, PC1: 1-64 characters: letters, digits, spaces and . _ ( ) / -, starting with a letter or digit. Names are case-insensitive. |
configure_device Configure IOS device
Add IOS configuration commands to a router, switch or multilayer switch (not PCs, servers, ASAs, access points or wireless routers). Commands run in GLOBAL CONFIGURATION MODE: do not send `enable`, `configure terminal`, `end` or `write memory` (PTBuilder saves automatically); such lines are dropped and reported. Leave sub-modes (interface, router ospf, line) with `exit`. Use full interface names (interface GigabitEthernet0/0). Commands are appended to earlier ones; set replace: true to overwrite the device's previous commands. Invalid commands fail silently in PT.
| Parameter | Type | Description |
|---|---|---|
ios_commands * | array | IOS commands in global configuration mode, one per item, e.g. ["hostname R1", "interface GigabitEthernet0/0", "ip address 192.168.1.1 255.255.255.0", "no shutdown", "exit"]. At most 2000 items of 512… |
name * | string | Device name, e.g. R1, S1, PC1 (case-insensitive). |
replace | boolean | true = discard this device's previous commands first. |
configure_pc Configure host IP
Set the IPv4 configuration of a host: PC-PT and Server-PT (Laptop-PT and Printer-PT are accepted but unverified). PTBuilder configures only the FastEthernet0 interface. dhcp: true enables DHCP (ip, mask and gateway are ignored; dns is kept). Otherwise ip and mask are required; mask accepts 255.255.255.0 or /24. Replaces the host's previous IP configuration. For routers and switches use configure_device instead.
| Parameter | Type | Description |
|---|---|---|
name * | string | Device name, e.g. R1, S1, PC1 (case-insensitive). |
dhcp | boolean | true = obtain the address by DHCP (ip/mask/gateway are ignored). |
dns | string | DNS server IPv4 address (kept with DHCP too). |
gateway | string | Default gateway IPv4 address. |
ip | string | IPv4 address, e.g. 192.168.1.10 (or 192.168.1.10/24 to include the mask). |
mask | string | Subnet mask, e.g. 255.255.255.0 or /24. |
build_topology Build topology
Replace the whole topology in one call. Atomic: if any device, link, IOS block or host IP entry is invalid, nothing changes and the error names the failing item. Same rules as add_device, add_link, configure_device and configure_pc (models are resolved, ports normalized, cables inferred when omitted, IOS commands run in global configuration mode).
| Parameter | Type | Description |
|---|---|---|
devices * | array | Devices to create (at most 500). |
ios | array | IOS commands per router/switch (global configuration mode). |
links | array | Links between device ports (at most 2000). |
pcs | array | Host IP configurations (as configure_pc). |
get_topology Get topology
Return the current topology as JSON: devices (with the position that will be emitted; autoPlaced: true when the auto layout computed it), links (with the cable that will be emitted), IOS commands and host IP configurations.
validate_config Validate topology
Check the topology before generate_script. Errors mean the PTBuilder script would fail or abort (e.g. PORT_KIND_MISMATCH, CABLE_INCOMPATIBLE, DUPLICATE_PORT, IOS_ON_NON_IOS) and block generate_script; warnings mean it may not work as intended in Packet Tracer (e.g. UNVERIFIED_PORT, CABLE_SUSPICIOUS, GATEWAY_NOT_IN_SUBNET, ISOLATED_DEVICE). Each issue has a code and a fix.
generate_script Generate PTBuilder script
Generate the PTBuilder JavaScript for the current topology. Tell the user to open a new, empty Packet Tracer workspace (File > New), open Extensions > Builder Code Editor, paste the script and click Run. Runs validation first: errors block generation unless force: true. The script is the first text block; warnings, if any, are a second text block.
| Parameter | Type | Description |
|---|---|---|
force | boolean | Generate even if validation reports errors. |
reset_topology Reset topology
Delete every device, link and configuration.
save_topology Save topology
Save the current topology (devices, links, IOS commands, host IP configurations) to a JSON file that load_topology can read back. Use an absolute path: relative paths resolve against $MCP_TRACER_DIR if set, else the server's working directory (now /tmp), which MCP clients often set arbitrarily. "~" is the user's home directory. Missing folders are created. Refuses to replace an existing file unless overwrite: true. The result shows the absolute path written.
| Parameter | Type | Description |
|---|---|---|
path * | string | File to write, e.g. C:\labs\vlans.json or /home/me/labs/vlans.json. Only .json file names are accepted; .json is added when the file name has no extension. Absolute path recommended. |
overwrite | boolean | true = replace the file if it already exists. |
load_topology Load topology
Replace the current topology with one read from a file written by save_topology (a bare get_topology JSON object is accepted too). Use an absolute path: relative paths resolve against $MCP_TRACER_DIR if set, else the server's working directory (now /tmp), which MCP clients often set arbitrarily. "~" is the user's home directory. Atomic: the file is fully parsed and validated (models, ports, links, IOS and host IP rules) before anything changes; on any error the current topology is kept. Max 5 MB.
| Parameter | Type | Description |
|---|---|---|
path * | string | File to read. Only .json file names are accepted; .json is added when the file name has no extension. Absolute path recommended. |
export_script Export PTBuilder script
Write the PTBuilder script for the current topology to a file, for users who prefer a file to copying from chat. Use an absolute path: relative paths resolve against $MCP_TRACER_DIR if set, else the server's working directory (now /tmp), which MCP clients often set arbitrarily. "~" is the user's home directory. Same validation as generate_script: errors block the export unless force: true. Refuses to replace an existing file unless overwrite: true. The user then copies the whole file into Extensions > Builder Code Editor in a new, empty Packet Tracer workspace and clicks Run.
| Parameter | Type | Description |
|---|---|---|
path * | string | File to write, e.g. C:\labs\vlans.js. Only .js or .txt file names are accepted; .js is added when the file name has no extension. Absolute path recommended. |
force | boolean | Export even if validation reports errors. |
overwrite | boolean | true = replace the file if it already exists. |