mcp-tracer

v0.1.1
io.github.aldoogando03-bit/mcp-tracer Checked 2 days ago Published 27 days ago

Design 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…

ParameterTypeDescription
model *stringPTBuilder model key, e.g. 2911, 2960-24TT, PC-PT. Aliases such as "4331", "WRT300N" or "PC" are resolved.
name *stringUnique device name, e.g. R1, S1, PC1: 1-64 characters: letters, digits, spaces and . _ ( ) / -, starting with a letter or digit. Names are case-insensitive.
xnumberX coordinate on the Packet Tracer logical workspace, -100000 to 100000. Omit both x and y for automatic placement.
ynumberY coordinate on the Packet Tracer logical workspace, -100000 to 100000. Omit both x and y for automatic placement.

remove_device Remove device

Remove a device together with its links, IOS commands and IP configuration.

ParameterTypeDescription
name *stringDevice name, e.g. R1, S1, PC1 (case-insensitive).

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

ParameterTypeDescription
name *stringDevice name, e.g. R1, S1, PC1 (case-insensitive).
new_name *stringNew 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.

ParameterTypeDescription
ios_commands *arrayIOS 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 *stringDevice name, e.g. R1, S1, PC1 (case-insensitive).
replacebooleantrue = 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.

ParameterTypeDescription
name *stringDevice name, e.g. R1, S1, PC1 (case-insensitive).
dhcpbooleantrue = obtain the address by DHCP (ip/mask/gateway are ignored).
dnsstringDNS server IPv4 address (kept with DHCP too).
gatewaystringDefault gateway IPv4 address.
ipstringIPv4 address, e.g. 192.168.1.10 (or 192.168.1.10/24 to include the mask).
maskstringSubnet 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).

ParameterTypeDescription
devices *arrayDevices to create (at most 500).
iosarrayIOS commands per router/switch (global configuration mode).
linksarrayLinks between device ports (at most 2000).
pcsarrayHost 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.

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

ParameterTypeDescription
path *stringFile 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.
overwritebooleantrue = 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.

ParameterTypeDescription
path *stringFile 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.

ParameterTypeDescription
path *stringFile 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.
forcebooleanExport even if validation reports errors.
overwritebooleantrue = replace the file if it already exists.