Packet Tracer MCP — Node.js port
Provides tools for planning, validating, and auto-fixing Cisco Packet Tracer network topologies, generating Packet Tracer JavaScript/CLI, and deploying configurations into a running Cisco Packet Tracer instance via a local HTTP bridge or file-mailbox fallback.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Packet Tracer MCP — Node.js port build a small office topology with 2 routers, 2 switches, and 4 PCs, then validate it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Packet Tracer MCP Node
Bangun topologi jaringan. Validasi rancangannya. Siapkan konfigurasi Cisco IOS.
Hubungkan client AI yang mendukung Model Context Protocol (MCP) dengan alur kerja Cisco Packet Tracer鈥攎ulai dari perencanaan hingga deployment melalui bridge lokal.
Mulai dalam 3 langkah銆�路銆�Fitur銆�路銆�Hubungkan Packet Tracer銆�路銆�Pengembangan
Apa yang bisa dilakukan
Related MCP server: Packet Tracer MCP
Mulai cepat
1. Pastikan prasyarat
Kebutuhan | Keterangan |
Node.js | Versi 20 atau lebih baru, beserta npm |
Client MCP | Client yang mendukung MCP, misalnya Claude Code |
Packet Tracer | Opsional untuk perencanaan; versi 8.2 atau lebih baru dan extension MCP Control Center diperlukan untuk operasi langsung |
2. Clone dan pasang dependensi
git clone https://github.com/Lannnnnzzzzzzzzzzz/packet-tracer-mcp-node.git
cd packet-tracer-mcp-node
npm install3. Daftarkan server ke Claude Code
Ganti path contoh dengan lokasi folder hasil clone di komputer Anda:
claude mcp add packet-tracer -- node "/path/to/packet-tracer-mcp-node/src/index.js" --stdioAtau tambahkan konfigurasi project berikut ke file .mcp.json pada folder project client:
{
"mcpServers": {
"packet-tracer": {
"command": "node",
"args": ["/path/to/packet-tracer-mcp-node/src/index.js", "--stdio"]
}
}
}Di Windows, gunakan path absolut, misalnya C:\\Users\\Nama\\packet-tracer-mcp-node\\src\\index.js. Dalam file JSON, setiap backslash harus ditulis dua kali. Lihat panduan setup Windows untuk petunjuk lengkap, termasuk instalasi extension dan troubleshooting.
Pilih cara menjalankan
Cara | Perintah | Cocok untuk |
stdio |
| Client MCP lokal; transport default untuk konfigurasi di atas |
Streamable HTTP |
| Akses melalui HTTP lokal pada |
Untuk menjalankan mode stdio secara eksplisit, gunakan node src/index.js --stdio.
Hubungkan ke Packet Tracer
Koneksi langsung menggunakan extension MCP Control Center dan bridge lokal.
Token bridge dikelola otomatis鈥攖idak perlu menyalin atau memasangkannya secara manual. Bridge Packet Tracer memakai port 54321; Streamable HTTP memakai 39400. Untuk detail lokasi file berdasarkan sistem operasi, lihat panduan setup Windows atau source extension di extension/.
Alur kerja yang disarankan
Mulailah dengan memeriksa katalog perangkat dan port agar rancangan memakai model serta koneksi yang benar-benar tersedia.
pt_list_devices
鈫�
pt_plan_topology
鈫�
pt_validate_plan
鈫�
pt_fix_plan jika ditemukan masalah
鈫�
pt_generate_configs atau pt_generate_script
鈫�
pt_live_deploy jika Packet Tracer terhubungUntuk memeriksa detail sebelum merancang:
pt_list_devices鈥� lihat perangkat dan model yang tersedia.pt_get_device_details鈥� periksa detail model tertentu.pt_list_templates鈥� lihat template topologi.pt_list_modules鈥� periksa modul ekspansi sebelum digunakan.
Untuk alur terpadu, gunakan pt_full_build guna merencanakan, memvalidasi, menghasilkan artefak, dan menyiapkan deployment. Operasi langsung memerlukan Packet Tracer yang terhubung melalui extension.
Contoh permintaan
Rancang topologi dengan tiga router berantai dan satu LAN di setiap lokasi. Siapkan DHCP dan OSPF, lalu periksa model serta port yang tersedia sebelum membuat rancangan.
Client MCP akan memilih tools yang sesuai untuk memeriksa katalog, merencanakan dan memvalidasi topologi, lalu menghasilkan konfigurasi atau menerapkan perubahan jika bridge aktif.
Direktori kerja
Secara default, ekspor, screenshot, dan proyek disimpan di ~/PacketTracerMCP. Atur PT_MCP_WORKDIR untuk menggunakan lokasi lain:
PT_MCP_WORKDIR="$HOME/Documents/PacketTracerMCP" npm startPengembangan
npm testTest menggunakan Node.js Test Runner. Untuk status porting dan catatan kompatibilitas, lihat PORTING_STATUS.md.
src/ Server MCP, tools, domain, dan integrasi bridge
extension/ Source extension MCP Control Center
scripts/ Skrip pembanding dan pengujian
test/ Test otomatisBatas kompatibilitas: operasi yang memerlukan otomasi antarmuka native Windows (Win32/UIA) belum memiliki backend FFI pada port Node.js ini. Kemampuan lainnya bergantung pada tool yang dipanggil dan status bridge Packet Tracer.
Lisensi
Proyek ini menggunakan lisensi MIT. Extension dalam repositori ini merupakan bagian dari proyek; atribusi komponen pihak ketiga mengikuti pemberitahuan pada file lisensi.
Available Tools
98 toolspt_add_deviceA
Add a single device to Packet Tracer with validation. Checks: name not empty, model exists in catalog, no duplicate name.
Parameters:
name: device name (e.g. "R1", "SW-Core", "PC-Admin")
model: PT model type (e.g. "2911", "2960-24TT", "PC-PT", "Server-PT")
x: X coordinate on canvas (default 200)
y: Y coordinate on canvas (default 200)
Inputs: name (required), model (required), x, y.
pt_add_linkA
Create a link between two devices in Packet Tracer with full validation. Checks: both devices exist, both ports exist, ports are free, cable type is valid. If cable_type is omitted, it is inferred from the device categories.
Parameters:
device1: first device name
port1: port on device1 (e.g. "GigabitEthernet0/0", "FastEthernet0/1")
device2: second device name
port2: port on device2
cable_type: cable type (straight, cross, serial, fiber, console, roll, auto, etc.) Common aliases accepted: "crossover"→"cross", "rollover"→"roll"
Inputs: port1 (required), port2 (required), device1 (required), device2 (required), +1 more.
pt_add_moduleA
Installs an expansion module on a device in the active topology.
PT powers the device off, installs the module and powers it back on (with skipBoot). A restart reloads the startup-config, so routers/switches are saved first (write memory); the reply says whether the device restarted and was saved.
Parameters:
device_name: exact device name in PT (e.g. "R1"). Use pt_query_topology to list valid names.
slot: the slot identifier as a STRING. The format depends on the device's slot type:
HWIC on 2911/2901 → "0/0".."0/3" · on 1941 ONLY "0/0" and "0/1" (verified against PT 9.0.1: the 1941 has 2 slots, not 4) (chassis-slot/hwic-subslot)
NM on 2811/2620XM/Router-PT → "1"
NIM on ISR4321/4331 → "0/1", "0/2" (chassis/subslot — NOT "0"/"1")
Cloud-PT/Server-PT/PCs → "0", "1", ... depending on the available slot An integer is accepted too and converted to a string.
module_name: exact module name, e.g. "HWIC-2T", "NM-4A/S", "NIM-2T", "HWIC-1GE-SFP". Use pt_list_modules to discover them.
dry_run: if True, validates and returns the JS payload without sending it.
Example: add 2 serial ports to R1 in HWIC slot 0: pt_add_module(device_name="R1", slot="0/0", module_name="HWIC-2T")
Inputs: slot (required), device_name (required), module_name (required), dry_run.
pt_add_noteA
Writes a text note on PT's canvas.
Use it to document the topology on the diagram itself: label a subnet, mark an OSPF area, name a trunk link. Returns the note's id, which can be used to delete it later.
The coordinates are the same logical-canvas ones that pt_add_device and pt_move_device use: routers ~y=100, switches ~y=250, hosts ~y=400.
The font size is NOT configurable: PT fixes it and uses that parameter for the stacking order, which the tool computes by itself.
Parameters:
x, y: position on the canvas.
text: the note's content.
Example: pt_add_note(x=300, y=100, text="LAN 192.168.0.0/24")
Inputs: x (required), y (required), text (required).
pt_apply_aclA
Applies an ACL to a router in PT's active topology: validates (ranges, types, IPs/wildcards, unreachable rules), checks router/interface against PT, generates IOS CLI and sends it through configureIosDevice.
router: device name in PT (see pt_query_topology).
name_or_number: 1-99/1300-1999 standard, 100-199/2000-2699 extended, any word = named ACL.
acl_type: "standard" (source only) or "extended" (source, destination, protocol, ports).
entries: list of dicts: action "permit"|"deny" (required); protocol "ip"|"icmp"|"tcp"|"udp"|... (default "ip"); source "any" | "host A.B.C.D" | "A.B.C.D wildcard" (required); destination (extended); source_port_op/source_port, dest_port_op/dest_port/dest_port_end (TCP/UDP, e.g. "eq"/80); icmp_type ("echo", "echo-reply", ...); tcp_flags (["established"]); log (bool); remark.
binding_interface: apply the ACL to this interface; empty = only define it.
binding_direction: "in" (default) or "out"; used only with binding_interface.
dry_run: validate and return the CLI/JS without sending.
Example entry: {"action": "deny", "protocol": "icmp", "source": "192.168.1.0 0.0.0.255", "destination": "192.168.0.0 0.0.0.255", "icmp_type": "echo"}. Full example: resource pt://guide, "Tool notes".
Inputs: router (required), entries (required), acl_type (required), name_or_number (required), +3 more.
pt_apply_acl_objectA
Applies an ACL using PT's object API (AclProcess.addAcl/addStatement) instead of CLI through configureIosDevice.
Same input as pt_apply_acl. It is faster (no CLI parsing) and less prone to raising modal popups that break the bridge if a line goes wrong.
Limitation: binding only works on the catalog's physical ports (e.g. GigabitEthernet0/0). For sub-interfaces (G0/0/1.20) use pt_apply_acl (CLI), since port.setAclInID only applies to the base port and not the sub-interface.
Pipeline: validate the plan → generate statements (without the "access-list NAME " prefix) → run addAcl + addStatement one by one + optional binding.
Inputs: router (required), entries (required), acl_type (required), name_or_number (required), +4 more.
pt_apply_bgpA
Configures BGP on a router through IOS CLI, each line verified (router bgp,
neighbor <ip> remote-as, network <net> mask <mask>). Measured on a 2911 in PT 9.
router: router name in PT.
asn: local AS, 1-65535 (4-byte ASNs were not measured).
neighbors: [{"ip": "10.0.0.2", "remote_as": 65002}]; remote_as == asn is iBGP. With PT connected, a neighbor off every connected subnet is a warning.
networks: CIDR list, host bits zero, e.g. ["192.168.1.0/24"]. BGP only advertises a network that is in the routing table with that exact mask.
show running-configprints a classful one withoutmask.dry_run: validate and return the CLI/payload without sending.
Example: pt_apply_bgp(router="R1", asn=65001, neighbors=[{"ip": "10.0.0.2", "remote_as": 65002}], networks=["192.168.1.0/24"]) Check: pt_cli(device="R1", commands=["show ip bgp summary"]).
Inputs: asn (required), router (required), dry_run, networks, +1 more.
pt_apply_etherchannelA
Bundles switch ports into an EtherChannel (Port-channel) through IOS CLI, each line verified. Measured on a 2960-24TT in PT 9; other models are not verified.
switch: switch name in PT.
ports: 2-8 full port names of one speed, e.g. ["FastEthernet0/10", "FastEthernet0/11"]. A contiguous run is sent as
interface range FastEthernet0/10 - 11.group: channel-group number (1-6 on a 2960).
mode: "active"|"passive" (LACP), "desirable"|"auto" (PAgP) or "on" (static). At least one side must be active/desirable: passive+passive or auto+auto never forms. Configure the peer switch the same way (same group mode family, same ports count).
trunk: True puts Port-channel in
switchport mode trunk.allowed_vlans: trunk only, e.g. [10, 20] (
switchport trunk allowed vlan).dry_run: validate and return the CLI/payload without sending.
Check it with pt_cli(device=switch, commands=["show etherchannel summary"]). Example: pt_apply_etherchannel(switch="SW1", ports=["FastEthernet0/10", "FastEthernet0/11"], group=1, mode="active", trunk=True)
Inputs: ports (required), switch (required), mode, group, +3 more.
pt_apply_hardeningA
Hardens a router/switch in the active topology.
Applies via CLI: hostname, MOTD banner, enable secret, local users, SSH
(domain-name + RSA keys + ip ssh version), service password-encryption, and
restricts the vty lines to SSH with local login.
Parameters:
device: device name in PT.
hostname: new hostname (optional).
banner_motd: MOTD banner text (without the '#' character).
enable_secret: enable password (it is encrypted).
users: list of {username, secret, privilege?}. Needed for SSH/local login.
ssh: dict {domain?, modulus?, version?, enable?} to enable SSH. Requires at least one user. modulus<768 raises a warning.
service_password_encryption: applies
service password-encryption(default True).dry_run: if True, only validates and returns the CLI/payload.
Example: full hardening of R1 with SSH: pt_apply_hardening(device="R1", hostname="R1", enable_secret="cisco123", users=[{"username":"admin","secret":"adminpass","privilege":15}], ssh={"domain":"lab.local","modulus":1024}, dry_run=True)
Inputs: device (required), ssh, users, dry_run, +4 more.
pt_apply_hsrpA
Configures one HSRP group on a router interface through IOS CLI, each line verified
(standby version, standby <g> ip|priority|preempt). Measured on a 2911 in PT 9.
router / interface: e.g. "R1", "GigabitEthernet0/0" (pt_query_topology).
group: 0-4095 with version 2. Both routers use the same group and virtual_ip.
virtual_ip: the hosts' gateway. With PT connected it must be a free host address in the interface's live subnet, not the interface's own IP.
priority: 0-255, default 100; the higher one becomes active.
preempt: take over again when this router comes back (default True).
version: 2 (measured). 1 is accepted but NOT verified.
dry_run: validate and return the CLI/payload without sending.
Example (active router; repeat on R2 with priority=100): pt_apply_hsrp(router="R1", interface="GigabitEthernet0/0", group=1, virtual_ip="192.168.1.254", priority=110) Check: pt_cli(device="R1", commands=["show standby brief"]).
Inputs: group (required), router (required), interface (required), virtual_ip (required), +4 more.
pt_apply_interface_tuningA
Tunes the parameters of a router interface in the active topology.
Parameters (all optional except router/interface):
router: router name in PT.
interface: interface to tune (e.g. "Serial0/0/0", "GigabitEthernet0/0").
clock_rate: ONLY on Serial interfaces (DCE end). E.g. 64000, 2000000. Applying clock_rate to a non-serial interface is a validation error.
bandwidth: bandwidth in kbps (
bandwidth N).ospf_cost / ospf_priority: per-interface OSPF knobs.
ospf_hello_interval / ospf_dead_interval: OSPF timers. They must match the neighbour's or the adjacency won't form; the IOS convention is dead = 4 x hello, and dead <= hello is rejected.
ospf_md5_key + ospf_md5_key_id: OSPF message-digest authentication (recommended). The id must match the neighbour's.
ospf_auth_key: plain-text OSPF authentication. It works, but the key travels readable across the network — a warning is emitted.
delay: interface delay (affects the EIGRP metric), in tens of microseconds.
ospf_network: "point-to-point" (only type PT accepts), for /30 links. An ASBR's default route is re-originated (PT drops it on the change).
dry_run: if True, only validates and returns the CLI/payload.
Example: authenticate OSPF with MD5 between R1 and its neighbour: pt_apply_interface_tuning(router="R1", interface="GigabitEthernet0/0", ospf_md5_key_id=1, ospf_md5_key="s3cr3t")
Inputs: router (required), interface (required), delay, dry_run, +10 more.
pt_apply_natA
Applies NAT or PAT to a router in PT's active topology (IOS CLI through the bridge).
router: device name in PT (e.g. "R1"; see pt_query_topology).
mode: "static" (1:1 fixed mapping, e.g. a server reachable from outside), "dynamic" (pool of public IPs) or "pat" (overload: many hosts share one public IP, the usual case).
inside_interface / outside_interface: LAN-side and WAN-side interfaces.
static_mappings: static only. [{"inside_local": "192.168.1.10", "inside_global": "200.1.1.5"}]
inside_networks: dynamic/pat. "network wildcard" strings, e.g. ["192.168.1.0 0.0.0.255"] (not CIDR); emitted as an inline access-list.
acl_number: ACL number or name for the inside hosts (default "1").
pool_name, pool_start, pool_end, pool_netmask ("255.255.255.0" form): the public pool (dynamic, or pat without interface overload).
use_interface_overload: pat only. True = use outside_interface's IP instead of a pool.
dry_run: validate and return the payload without sending.
Typical PAT: mode="pat", inside_networks=["192.168.1.0 0.0.0.255"], use_interface_overload=True. Mode guidance and a full example: resource pt://guide, "Tool notes".
Inputs: mode (required), router (required), inside_interface (required), outside_interface (required), +9 more.
pt_apply_netflowA
Configures a NetFlow exporter on a PT device.
Unlike the rest of the advanced features, NetFlow does NOT go through CLI: it is configured directly and read back to verify it was applied. If the name already exists, it is reconfigured instead of duplicated. The exported FLOWS are not read: no way to read them was measured on PT 9 (the exporter manager has no exporter or monitor count either).
Parameters:
device: router where the exporter lives.
name: exporter name (e.g. "COLLECTOR-1").
destination_ip: the collector's IP. Without it the exporter is inert.
udp_port: the collector's UDP port (default 2055).
version: 9 (templates, recommended) or 5 (fixed format).
source_port: source interface; empty = PT picks it.
monitors: names of the monitors to associate.
remove: if True, deletes the exporter
nameinstead of creating it.dry_run: if True, only validates and returns the payload without touching PT.
Example: export to a collector at 192.168.0.50: pt_apply_netflow(device="R1", name="COLLECTOR-1", destination_ip="192.168.0.50")
Inputs: name (required), device (required), remove, dry_run, +5 more.
pt_apply_port_securityA
Configures port-security on a switch's access port.
Parameters:
switch: switch name in PT.
port: access port (e.g. "FastEthernet0/1").
max_mac: maximum number of allowed MACs (default 1).
violation: "shutdown" (default) | "restrict" | "protect".
sticky: if True, learns sticky MACs (
mac-address sticky).static_macs: static MACs in IOS aaaa.bbbb.cccc format.
dry_run: if True, only validates and returns the CLI/payload.
Example: max 2 sticky MACs on SW1's Fa0/1: pt_apply_port_security(switch="SW1", port="FastEthernet0/1", max_mac=2, dry_run=True)
Inputs: port (required), switch (required), sticky, dry_run, +3 more.
pt_apply_qosA
Configures QoS (MQC) on a router through IOS CLI, each line verified: one
class-map match-any per class, a policy-map whose class-default gets
fair-queue, and service-policy output on the interface. Measured on a 2911.
router / interface: e.g. "R1", "GigabitEthernet0/1" (the WAN side).
policy_name: one word, e.g. "WAN-OUT".
classes: [{"name", "match_dscp"?, "match_protocol"?, "priority_kbps"|"bandwidth_kbps"}]. At least one match per class (both = match-any); exactly one action. Measured: match_protocol "rtp", match_dscp "ef", priority_kbps. Other DSCP values, other protocols and bandwidth_kbps are accepted but NOT verified (warning).
direction: "output" only (queuing actions are outbound in IOS).
dry_run: validate and return the CLI/payload without sending.
Example: pt_apply_qos(router="R1", interface="GigabitEthernet0/1", policy_name="WAN-OUT", classes=[{"name": "VOICE", "match_protocol": "rtp", "match_dscp": "ef", "priority_kbps": 512}]) Check: pt_read_qos(device="R1").
Inputs: router (required), classes (required), interface (required), policy_name (required), +2 more.
pt_apply_stpA
Configures Spanning-Tree on a switch in the active topology.
Parameters:
switch: switch name in PT (e.g. "SW1").
mode: "rapid-pvst" (default) or "pvst".
root_primary_vlans: list of VLANs where this switch is root primary (generates
spanning-tree vlan N root primary).priority: dict {vlan_id: priority}. The priority must be 0-61440 and a multiple of 4096.
portfast_ports: access ports with
spanning-tree portfast.bpduguard_ports: ports with
spanning-tree bpduguard enable.dry_run: if True, only validates and returns the CLI/payload.
Example: SW1 root for VLAN 10 + portfast on Fa0/1: pt_apply_stp(switch="SW1", root_primary_vlans=[10], portfast_ports=["FastEthernet0/1"], dry_run=True)
Inputs: switch (required), mode, dry_run, priority, +3 more.
pt_apply_vlanA
Applies VLANs / trunks / inter-VLAN routing to the active PT topology through IOS CLI: switch side (VLANs, access ports, trunks) and optionally router side (.1q subinterfaces, router-on-a-stick). Use pt_query_topology for the real names/ports.
switch: switch name (e.g. "SW1"). router: only for subinterfaces.
vlans: [{"vlan_id": 10, "name": "SALES"}] (name optional).
access_ports: [{"switch": "SW1", "port": "FastEthernet0/1", "vlan_id": 10}].
trunks: [{"switch", "port", "allowed_vlans"?, "native_vlan"?, "encapsulation"?}]. A 2960 (dot1q only) gets no
switchport trunk encapsulation; a 3560 does.subinterfaces: [{"router": "R1", "parent_port": "GigabitEthernet0/0", "vlan_id": 10, "ip_cidr": "192.168.10.1/24"}].
dry_run: validate and return the CLI/payload without sending.
Router-on-a-stick example: resource pt://guide, "Tool notes".
Inputs: vlans, router, switch, trunks, +3 more.
pt_apply_voiceA
Cisco CME voice (IP phones) through IOS CLI, each line verified. The router MUST be
a 2811 (PT's 2911 rejects telephony-service even with the uck9 license).
Measured end to end on PT 9 (2811 + 3560-24PS + two 7960): CME, DHCP option 150
and real registration (show ephone: REGISTERED). Not measured: ephone + mac,
switchport voice vlan (the reply warns).
source_ip: the router's IP on the phones' LAN (checked against PT).
extensions: ["1001", "1002"] or [{"number": "1001", "mac"?: "0001.4321.ABCD"}].
max_ephones 1-36, max_dn 1-144. auto_assign:
auto assign 1 to N.voice_vlan + switch + access_ports:
switchport voice vlanon those ports.dhcp_pool:
option 150 ip <source_ip>; dhcp_network ("10.10.10.0/24") also sets network + default-router.restart_phones: power-cycle every IP phone, then fast-forward (default True); phones already on keep 0.0.0.0 otherwise.
dry_run: validate and return the CLI/payload without sending.
Example: pt_apply_voice(router="R1", source_ip="10.10.10.1", extensions=["1001","1002"], dhcp_pool="VOICE", dhcp_network="10.10.10.0/24") Check: pt_cli(device="R1", commands=["show ephone"]).
Inputs: router (required), source_ip (required), extensions (required), max_dn, +9 more.
pt_audit_securityA
Audits the REAL security posture of the live devices in PT.
It does not read the plan: it reads the effective configuration of each router/switch
on the canvas and reports findings with a severity (high/medium/low). Detects
a missing enable secret, credentials stored reversibly
(type 7), service password-encryption off, no local
users, a missing MOTD banner and config-register at 0x2142 (which discards
the startup-config on the next reboot).
Passwords and hashes NEVER leave the device: only the label of the algorithm they are stored with is transmitted.
Hosts (PC/Server/Laptop) are skipped: they have no IOS configuration.
Parameters:
device: if given, audits only that device; empty = all of them.
Example: audit the whole topology: pt_audit_security()
Inputs: device.
pt_auto_layoutA
Rearrange the devices on the canvas by topology and fit them to the visible view.
Reads the live devices and links: routers form the core (2 or a chain: a row with the end LANs pointing outward, middle LANs alternating down/up; a ring: a polygon; a hub: a star), each LAN hangs off its router away from the core (switch, then its hosts side by side), a WAN cloud takes the free side. Moves everything in one call and reads each position back.
Use it after building by hand, after adding devices, or when a lab looks crowded. pt_full_build / pt_plan_topology already plan with this layout.
Parameters:
apply: False only returns the new positions without moving anything.
Inputs: apply.
pt_backup_configA
Backs up a PT device's startup configuration.
Returns the real startup-config (the one the device rereads on restart), plus its serial number, config-register, boot images and uptime. Use it to save a known state before touching something, or to compare two devices.
Parameters:
device: name of the router or switch in PT.
include_xml: if True, adds the device's full XML dump (topology + config + modules). It is tens of thousands of characters: useful for archiving, heavy to read.
Example: pt_backup_config(device="R1")
Inputs: device (required), include_xml.
pt_bridge_statusA
Checks which channel Packet Tracer is connected through.
There are two: HTTP (when the MCP Control Center window is open) and file (when it is closed but PT is still open with the extension). With either one, deployment works.
Inputs: no named parameters.
pt_canvas_infoA
Size of PT's visible logical view and where the devices are, so you know which x/y range to use before pt_add_device / pt_move_device / pt_add_note.
Returns view [width, height] in canvas px (depends on the screen and the window: 1512x599 on a 14" MacBook, about 1900x700 on a maximised 1920x1080), zoom (0 = 100 %), the device count and their bbox [x0, y0, x1, y1]. x/y of a device is the top-left corner of its icon (about 50x40 px, labels below): keep x within [40, width-90] and y within [40, height-90] so everything is visible.
Inputs: no named parameters.
pt_clear_annotationsA
Removes the canvas annotations: text notes and drawings.
It does NOT touch devices or links, only the graphic elements.
PT leaves orphan note ids that it never releases — with no text and that it
refuses to delete. They are not a failure: the canvas is visually clean
anyway, and they are reported separately as stale_ids.
Parameters:
kind: "all" (default) removes notes and drawings; "notes" only the notes.
Example: pt_clear_annotations()
Inputs: kind.
pt_cliA
Types commands into a router/switch console (CLI tab) and returns each one's output. Same as typing in the IOS CLI: enable, configure terminal, interface..., show ip route, ping, copy run start...
Without taking the screen: it goes through PT's API, and what is typed shows up in the device's real CLI tab.
Parameters:
device: exact name (pt_query_topology).
commands: a list of commands, or a block of text with one per line. Typed in order, waiting for the prompt between them.
timeout: maximum seconds per command, up to 300 (ping/traceroute take a while). When it runs out the command is aborted with Ctrl+Shift+6.
auto_confirm: presses Enter on "[confirm]" and "Destination filename [..]?". [yes/no] and Password: questions are NOT answered automatically: put the answer as the next command (e.g. ["reload", "no", ""]).
show: True/False opens (or not) the device's window on the CLI tab. None = per pt_ui_mode.
capture: saves a PNG of the window when done (implies show).
Each command comes back marked: ok, ERROR (% Invalid input...), UNKNOWN COMMAND (IOS took it as a hostname: the DNS lookup is aborted), WAITING FOR ANSWER or TIMEOUT. A freshly created router is primed automatically (answers 'no' to the initial dialog).
Inputs: device (required), commands (required), show, capture, +3 more.
pt_configure_dhcp_serverA
Creates or edits a DHCP pool on a Server-PT (GUI: Services > DHCP), validated against
its subnet, switches the service on and reads every pool back. No CLI (a Server-PT has none).
Router DHCP: plan with dhcp=True or CLI ip dhcp pool. Exclusions or showing the page on
screen: pt_server_dhcp (same JS backend, server_dhcp_js).
The server needs a static IP inside the pool's subnet (else warning DHCP_SERVER_NO_IP). PT never leases the server's own IP but DOES lease the gateway's if the range covers it.
device: the Server-PT.
network / mask: pool subnet ("192.168.10.0", "255.255.255.0"). No network = read-only.
gateway / dns: what clients receive (empty dns = left alone).
start_ip: first IP handed out; empty = after a .1 gateway, else the first host.
max_users: number of IPs; 0 = to the end of the subnet.
pool_name: default "serverPool" (the factory pool the GUI shows); another name creates or edits that pool, never duplicates.
port: serving port (default FastEthernet0). enabled: service On/Off.
drop_factory_pool: with a custom pool_name, delete the factory serverPool if it was never configured (it would hand out .1, the gateway).
remove: delete pool_name instead. dry_run: validate and return the JS only.
Example: pt_configure_dhcp_server(device="DHCP-A", network="192.168.10.0", gateway="192.168.10.1", dns="8.8.8.8", start_ip="192.168.10.3")
Inputs: device (required), dns, mask, port, +9 more.
pt_delete_deviceA
Delete a device from the active topology in Packet Tracer. Uses getLogicalWorkspace().removeDevice() and verifies the device is gone.
Parameters:
device_name: exact device name (e.g. "R1", "PC3", "Laptop-WAN")
Inputs: device_name (required).
pt_delete_linkA
Delete the link connected to a specific interface on a device in PT.
Reads both ends back: verified is true only when this port AND the
far-end port no longer have a link. Reports the far end and the cable.
Parameters:
device_name: device name (e.g. "R1")
interface_name: interface name (e.g. "GigabitEthernet0/0", "FastEthernet0/1")
Inputs: device_name (required), interface_name (required).
pt_deployA
Deploys a plan to Packet Tracer: copies the script to the Windows clipboard, exports the configuration files, and generates step-by-step instructions.
Usage: after pt_full_build or pt_plan_topology, pass the plan JSON here to prepare everything for Packet Tracer.
Parameters:
plan_json: plan JSON (output of pt_plan_topology or pt_full_build)
project_name: project name
output_dir: folder inside the MCP's working directory (PT_MCP_WORKDIR); a path that points elsewhere is reduced to a folder name there.
Inputs: plan_json (required), output_dir, project_name.
pt_device_powerA
Powers a device in PT on or off, with a verification read.
Useful to simulate equipment failure and see how routing reacts, or to restart a router so it rereads its startup-config.
Works on every model, PCs included. Hosts have no IOS boot,
so when powering them on booting comes back null; on a router
or switch the boot is skipped so as not to wait for the full start-up.
Parameters:
device: device name in PT.
on: True powers on (default), False powers off.
Example: simulate R2 going down: pt_device_power(device="R2", on=False)
Inputs: device (required), on.
pt_diffA
Compares a plan (JSON from pt_plan_topology) against PT's LIVE topology.
Reports: plan devices missing from PT, extra devices in PT, and per-interface IP mismatches. Useful to reconcile after a deploy. Requires a connected bridge.
Inputs: plan_json (required).
pt_email_clientA
A host's Desktop > Email.
action="configure": name, address (alice@lab.com), username, password, smtp_server, pop3_server (IP or name of the Server running EMAIL).
action="send": to, subject, body (uses the configured account).
action="receive": asks the POP3 server for mail (it shows in the window; PT does not expose the mailbox through the API). Server accounts are created with pt_server_service(service="email"). The server's Domain Name and SMTP/POP3 switches are set with pt_server_service(server, "email", domain=..., smtp=..., pop3=...).
Inputs: device (required), to, body, name, +10 more.
pt_estimate_planA
Quick estimate (dry-run) without generating a full plan. Shows how many devices, links and subnets will be created.
Parameters:
routers: Number of routers (1-20)
pcs_per_lan: PCs per LAN
laptops_per_lan: Laptops per LAN (Laptop-PT)
switches_per_router: Switches per router
servers: Servers
access_points: Access Points (AccessPoint-PT)
has_wan: Include WAN
dhcp: Configure DHCP
routing: static, ospf, eigrp, rip, none
Inputs: dhcp, has_wan, routers, routing, +5 more.
pt_explain_planB
Explains the plan's decisions in natural language. Useful to understand why certain models, IPs, etc. were chosen.
Parameters:
plan_json: plan JSON
Inputs: plan_json (required).
pt_exportB
Exports the plan to files: JS script, CLI configs and JSON.
Parameters:
plan_json: plan JSON
project_name: project name
output_dir: folder inside the MCP's working directory (PT_MCP_WORKDIR); a path that points elsewhere is reduced to a folder name there.
Inputs: plan_json (required), output_dir, project_name.
pt_export_topologyA
Export a detailed snapshot of the full topology currently in Packet Tracer. Returns devices (name, model, x/y position, interfaces with IPs) and links (endpoints, ports, and the REAL cable type PT reports for each link: straight, cross, serial, fiber...). This gives a complete picture of what is deployed so the LLM can reason about the topology.
Inputs: no named parameters.
pt_fast_forwardA
Realtime's "Fast Forward Time" button: moves PT's clock ahead at once.
Use it after cabling or changing switch links: STP needs ~30 s to put a new port in forwarding, and fast-forwarding gets there immediately, so a ping right after it works (measured on PT 9.0). Realtime only (in Simulation use pt_simulation_step). The network is not reset. pt_live_deploy and pt_verify_connectivity already do this themselves.
Inputs: no named parameters.
pt_fix_planB
Tries to fix the plan's errors automatically. Fixes cables, upgrades routers that lack ports, reassigns ports.
Parameters:
plan_json: JSON of the plan to fix
Inputs: plan_json (required).
pt_full_buildA
Full pipeline: plans, validates, generates, explains, estimates and deploys.
deploy=True (default): with a channel to PT the topology is REALLY created (same path as pt_live_deploy, with verification and reconcile) and project files are exported; with no channel it falls back to manual mode (script to clipboard + step-by-step instructions).
Parameters:
routers (1-20), pcs_per_lan, laptops_per_lan (Laptop-PT), switches_per_router, servers, access_points (AccessPoint-PT, one per LAN), has_wan, dhcp.
routing: static, ospf, eigrp, rip, none. ospf_process_id (1-65535, default 1), eigrp_as (1-65535, default 100), floating_routes (static only: backup routes, AD 254).
router_model: 1941, 2901, 2911, ISR4321. switch_model: 2960-24TT, 3560-24PS.
template: single_lan, multi_lan, multi_lan_wan, star, hub_spoke, branch_office, router_on_a_stick, three_router_triangle, custom.
vlans: router_on_a_stick only; VLANs spread across the PCs (0 = default 2).
dual_stack: add IPv6 (routers via CLI, hosts via SLAAC); ipv6_base (default "2001:db8::/32").
wireless_laptops: laptops connect over WiFi (wireless NIC + AP).
Inputs: dhcp, vlans, deploy, has_wan, +16 more.
pt_generate_configsC
Generates the CLI (IOS) configurations for every router and switch.
Parameters:
plan_json: plan JSON
Inputs: plan_json (required).
pt_generate_scriptC
Generates the PTBuilder JavaScript script.
Parameters:
plan_json: plan JSON
include_configs: if True, includes the CLI configs as comments
Inputs: plan_json (required), include_configs.
pt_get_device_detailsB
Shows the details of a specific device model.
Accepts either the exact model name (e.g. '2911', '2960-24TT') or a catalog alias (e.g. 'router', 'switch', 'firewall').
Parameters:
model_name: model name or alias
Inputs: model_name (required).
pt_health_checkA
Health sweep of PT's LIVE topology.
Reports: down links (cabled but not up), cabled ports without an IP (possibly an unfinished DHCP), and duplicate IPs. Requires a connected bridge.
Inputs: no named parameters.
pt_host_commandA
Runs a command in a PC/Laptop/Server's Desktop > Command Prompt (ping, ipconfig, ipconfig /all, ipconfig /renew, tracert, arp -a, nslookup, netstat, telnet, ssh -l user ip, ftp...) and returns the output.
Parameters:
device: the host's name.
command: the line to run (e.g. "ping 192.168.1.1").
inputs: answers to whatever the command asks afterwards, in order (e.g. a telnet/ssh password, then commands for the remote device).
timeout: maximum seconds per line, up to 300 (a failing ping takes ~15 s).
show / capture / output_dir: as in pt_cli; opens Desktop > Command Prompt.
Inputs: device (required), command (required), show, inputs, +3 more.
pt_host_firewallB
A host's Desktop > Firewall / IPv6 Firewall: switches the inbound firewall on or off (True/False; None = leave alone). Individual rules have no API in PT; edit them in the window (pt_ui_open(host, app="firewall")).
Inputs: device (required), ipv4, ipv6, show, +3 more.
pt_host_ip_configA
Desktop > IP Configuration (and Config > Global) of a PC/Laptop/Server: static IP or DHCP, mask, gateway, DNS, IPv6 (automatic or static).
Parameters (empty = leave alone):
mode: "static" | "dhcp". With "dhcp" a lease is requested and the tool waits up to wait_dhcp_s seconds (0-120) for it.
ip, mask: IPv4 and mask ("255.255.255.0" or "24").
gateway, dns: IPv4. "0.0.0.0" to clear.
interface: port (default: the first Ethernet, or Wireless0).
ipv6_mode: "auto" (SLAAC) | "off".
ipv6_address: static IPv6 with its prefix, "2001:db8:0:1::10/64". Added to the port (it does not remove other addresses) and read back.
ipv6_gateway, ipv6_dns.
show / capture: opens Desktop > IP Configuration (per pt_ui_mode).
For routers/switches use pt_cli (ip address ... on the interface).
Inputs: device (required), ip, dns, mask, +11 more.
pt_inspect_portsA
Real state of each port of a live device in PT.
Reads the device, not the plan: line/protocol status, MAC, IP/mask, duplex, bandwidth, MTU, delay, CDP, DHCP client, NAT mode, applied ACLs and, on a cabled port, the real cable type (straight, cross, serial...) and the far end ("SW1:FastEthernet0/1"). Flags anomalies (cable connected with the port down, line up with protocol down).
It is the DETAIL view of one device; for the sweep of the whole topology (down links, duplicate IPs) use pt_health_check.
Parameters:
device: device name; empty = all (verbose on large topologies).
only_linked: if True, returns only ports with a cable connected.
Example: see why one of R1's links won't come up: pt_inspect_ports(device="R1", only_linked=True)
Inputs: device, only_linked.
pt_install_modules_batchA
Installs N modules in a single runCode JS — save → power-off → addModule×N → power-on.
Useful when several serial modules (HWIC-2T, NIM-2T, etc.) have to go into several routers at once. PREFER this tool over multiple calls to pt_add_module: each individual power cycle can pause PT's script engine for > 5s and kill the bridge bootstrap's polling.
Parameters:
modules: list of dicts with {device, slot, module}. Example for RTR-4 with 4 serial ports on a 2911 (which does NOT accept NM-4A/S): [ {"device": "RTR-4", "slot": "0/0", "module": "HWIC-2T"}, {"device": "RTR-4", "slot": "0/1", "module": "HWIC-2T"} ] → gives Serial0/0/0..0/0/1, Serial0/1/0..0/1/1.
dry_run: if True, validates and returns the JS payload without sending it.
Slot rules (string): HWIC on 2911/2901 → "0/0".."0/3" · on 1941 ONLY "0/0" and "0/1" NIM on ISR4321/4331 → "0/1", "0/2" (chassis/subslot — NOT "0"/"1") NM on 2811/Router-PT → "1" Cloud-PT / hosts → "0".."7"
Returns JSON with summary and per-module status (installed or not). The JS (js_payload) is only included with dry_run; once sent it is dropped.
Inputs: modules (required), dry_run.
pt_list_devicesA
Lists every device available in Packet Tracer with its ports. Use this to know which models, ports and cables you can use.
Inputs: no named parameters.
pt_list_modulesA
Lists the expansion modules available in the PT catalog.
Without filters it returns ALL modules. Useful to find the exact names before calling pt_add_module.
Parameters:
router_model: if given (e.g. "2911", "ISR4321"), filters to modules compatible with that router. Includes generic modules (no compatible_with list) and the ones that list that model.
category: filters by category (e.g. "router_hwic", "router_nm", "router_nim", "router_wic"). Empty = all.
Returns JSON with: name, description, category, ports_added, compatible_with.
Inputs: category, router_model.
pt_list_projectsC
Lists the saved projects.
Parameters:
output_dir: projects folder inside the MCP's working directory (PT_MCP_WORKDIR)
Inputs: output_dir.
pt_list_templatesA
Lists every available topology template with its description.
Inputs: no named parameters.
pt_live_deployA
Sends commands directly to Packet Tracer in real time.
Requires PT open with the MCP Control Center extension installed. With the window open HTTP is used; if you close it, the file channel (Script Engine) takes over. The bridge starts by itself inside the MCP server.
Parameters:
plan_json: plan JSON (output of pt_plan_topology or pt_full_build)
plan_path: instead of plan_json, a .json file with the plan. Use it for large hand-written designs (dozens of sites);
extra_cliin the plan carries per-device IOS lines (summaries, hardening, NAT...).command_delay: delay between BATCHES in seconds (default 0.0). Commands are no longer sent one by one: they go in batches that PT runs in a single runCode, where each one carries its own try/catch. Measured against PT 9.0, creating 10 devices + links + configuring IOS in one go takes ~100 ms and the config is applied. Raise it only if your installation chokes.
Inputs: plan_json, plan_path, command_delay.
pt_load_projectC
Loads a saved project.
Parameters:
project_name: project name
output_dir: projects folder inside the MCP's working directory (PT_MCP_WORKDIR)
Inputs: project_name (required), output_dir.
pt_move_deviceA
Move a device to new coordinates on the Packet Tracer canvas.
Reads the position back: verified is true when PT reports exactly (x, y).
Parameters:
device_name: device name
x: X coordinate (logical view, e.g. 100-800)
y: Y coordinate (logical view, e.g. 100-600)
Inputs: x (required), y (required), device_name (required).
pt_open_projectA
Opens a .pkt file in Packet Tracer.
WARNING: it replaces the topology currently open. If it has unsaved changes, save them first with pt_save_project.
Parameters:
path: full path to an existing .pkt file (any folder: opening the user's own labs is the point). A relative path is looked up inside the MCP's working directory and may not leave it.
Inputs: path (required).
pt_plan_topologyB
Generates a complete network topology plan for Packet Tracer.
Parameters:
routers: Number of routers (1-20)
pcs_per_lan: PCs per LAN
laptops_per_lan: Laptops per LAN (Laptop-PT)
switches_per_router: Switches per router (0-4)
servers: Number of servers
access_points: Number of Access Points (AccessPoint-PT), one per LAN
has_wan: Include a WAN connection (Cloud)
dhcp: Configure DHCP automatically
routing: Routing protocol (static, ospf, eigrp, rip, none)
router_model: Router model (1941, 2901, 2911, ISR4321; 2811 for CME voice)
switch_model: Switch model (2960-24TT, 3560-24PS)
template: Template (single_lan, multi_lan, multi_lan_wan, star, hub_spoke, branch_office, router_on_a_stick, three_router_triangle, custom)
floating_routes: If True with routing=static, adds backup routes with AD=254 over alternative paths (needs a topology with multiple paths)
ospf_process_id: OSPF process ID (1-65535, default 1)
eigrp_as: EIGRP AS number (1-65535, default 100)
vlans: router_on_a_stick template only. Number of VLANs to spread across the PCs (0 = default 2).
dual_stack: If True, adds IPv6 addressing (routers via CLI, hosts via SLAAC).
ipv6_base: Base IPv6 prefix for dual-stack (default "2001:db8::/32").
wireless_laptops: If True, laptops connect over WiFi (wireless NIC + an AP auto-associated per LAN) instead of a cable.
Returns the full plan JSON.
Inputs: dhcp, vlans, has_wan, routers, +15 more.
pt_project_metadataA
Reads (and optionally writes) the metadata of the project open in PT.
Returns the saved file, the PT version that wrote it and the project description, together with the device and link counts. Useful to know what you are working with before changing anything.
Parameters:
description: if given, REPLACES the project description. Empty = read only.
Example: pt_project_metadata()
Inputs: description.
pt_query_topologyA
Query current devices in Packet Tracer. Returns name, model, and port/IP info for each device in the active topology, then every link with its real cable type (read from the link itself). Requires bridge connected (use pt_bridge_status to verify).
Inputs: no named parameters.
pt_read_aclA
Reads the REAL ACLs of a router: each ACL with its commands, and which ports have an ACL applied in which direction.
Flags ports that reference an ACL that does not exist. Use it to check a pt_apply_acl.
Parameters:
device: router name; empty = every device with ACLs.
Example: pt_read_acl(device="R1")
Inputs: device.
pt_read_arpA
Reads the REAL ARP table (IP -> MAC -> port) of a device, router or host.
Parameters:
device: device name; empty = every device.
Example: did PC1 resolve its gateway? pt_read_arp(device="PC1")
Inputs: device.
pt_read_cdpA
Reads the REAL CDP neighbour table: who is cabled to which port.
Per neighbour: device id, local and remote port, platform, capability. CDP announces every 60 s: right after a deploy the table is empty.
Parameters:
device: device name; empty = every device.
Example: pt_read_cdp(device="SW1")
Inputs: device.
pt_read_device_panelB
Reads what a device's tabs show, in one go (read-only): model, power, whether it is a host, DHCP, the host's default gateway, per port IP/mask/MAC/state/IPv6/firewall/ bandwidth, and on servers which services (DHCP, DNS, HTTP, TFTP, FTP, SYSLOG, EMAIL, NTP) are on.
Inputs: device (required).
pt_read_dhcp_leasesA
Reads the REAL DHCP leases a server handed out: per pool, each lease's IP, MAC, port and lease time.
Router pools (ip dhcp pool) come from its DhcpServerProcess (measured
on a 2911); a Server-PT's from each port's DHCP process. A pool whose
leases this PT build cannot read says lease_api: false: unknown, not
zero. Use it to check that hosts got their address from the right pool.
Parameters:
device: router or server name; empty = every DHCP server.
Example: pt_read_dhcp_leases(device="R1")
Inputs: device.
pt_read_mac_tableA
Reads a switch's REAL MAC address table, per VLAN: MAC, port, dynamic or static.
Parameters:
switch: switch name; empty = every switch.
vlan: VLAN number; 0 = every VLAN.
Example: where did SW1 learn PC1's MAC? pt_read_mac_table(switch="SW1")
Inputs: vlan, switch.
pt_read_natA
Reads a router's REAL NAT state: the translation table, NAT counters (inside source lists, statics, pools) and inside/outside interfaces.
Flags a router with NAT but without both an inside and an outside interface. Use it to check a pt_apply_nat.
Parameters:
device: router name; empty = every router with NAT.
Example: pt_read_nat(device="R1")
Inputs: device.
pt_read_ospfA
Reads OSPF's REAL state: router-id, areas and neighbours per process.
Each neighbour comes with its state by name (FULL, 2WAY, INIT...), its role (DR/BDR/DROTHER, null on point-to-point), local port and address. Flags neighbours not FULL (2WAY between DROTHERs is normal), duplicate router-ids and routers with OSPF but no neighbours.
Parameters:
device: router name; empty = every router.
Example: pt_read_ospf(device="R1")
Inputs: device.
pt_read_packet_traceA
Reads the simulation's event list: what each packet did and WHY.
Besides the path (device, ingress/egress port, source, destination, traffic type and outcome) it returns the decision log that PT generates per OSI layer — the same text as the "PDU Details" panel of its GUI. That is where the real cause of a failing ping shows up, for example: "The next-hop IP address is not in the ARP table."
Requires Simulation mode with generated traffic (pt_simulation_mode(on=True) and then a ping, or pt_simulation_step so the events move on).
Parameters:
limit: maximum frames to return (1-200, default 20).
device: if given, only the frames that went through that device.
include_decisions: if False, omits the per-layer log (shorter reply).
Example: see why a ping is dropped: pt_read_packet_trace(limit=10)
Inputs: limit, device, include_decisions.
pt_read_qosA
Reads a device's REAL QoS configuration: class-maps and policy-maps.
Read only (PT's API cannot create class/policy-maps): to CONFIGURE QoS use pt_apply_qos. This tool checks that it was applied.
Returns, per class-map, its match type and CLI; per policy-map, its classes in order, each with its name, priority (kbps), bandwidth (kbps), fair-queue and whether it is class-default. PT does not give a class its name, so names come from the running-config, matched by position.
Parameters:
device: router name in PT.
Example: pt_read_qos(device="R1")
Inputs: device (required).
pt_read_routesA
Reads the REAL routing table of a live device (or of every router).
What show ip route shows, read from the device's RoutingProcess:
per route its prefix, protocol letter and name (C connected, L local,
S static, O OSPF, D EIGRP, R RIP), next hop, interface, AD and metric.
Across several routers it lists convergence_gaps: prefixes a router
running a dynamic protocol lacks while the others know them.
Parameters:
device: device name; empty = every device with a routing table.
Example: did OSPF converge? pt_read_routes()
Inputs: device.
pt_read_stpA
Reads Spanning Tree's REAL state per VLAN: who the root bridge is.
Per switch and VLAN: whether it is the root, the root ID (priority and MAC), and where available its bridge ID, priority, root path cost and root port. Across switches it flags VLANs where they disagree on the root (not converged). PT 9 does not expose per-port STP state or role.
Parameters:
switch: switch name; empty = every switch.
vlans: VLAN numbers to read; empty = every VLAN in the switch.
Example: pt_read_stp(vlans=[1, 10])
Inputs: vlans, switch.
pt_read_vlansA
Reads a switch's REAL VLAN database in PT.
Returns each VLAN with its number, name, whether it is one of PT's factory ones (1, 1002-1005) and its access ports; plus the trunk ports (with native VLAN), the ports with port security, and access ports left in a VLAN missing from the database. Use it to confirm that a pt_apply_vlan was applied, or to discover a topology you didn't build.
Parameters:
switch: switch name in PT.
Example: pt_read_vlans(switch="SW1")
Inputs: switch (required).
pt_remove_aclA
Removes an ACL applied on a router.
If binding_interface is given, it first removes the binding from the interface (no ip access-group ...) and then deletes the whole ACL (no access-list ...).
Parameters:
router: device name in PT
name_or_number: identifier of the ACL to remove
binding_interface: optional, interface where it was applied
binding_direction: "in" or "out" (only with binding_interface)
dry_run: if True, returns the payload without sending it
Inputs: router (required), name_or_number (required), dry_run, binding_direction, +1 more.
pt_remove_acl_objectA
Removes an ACL using the object API (AclProcess.removeAcl + Port.setAclInID="").
Alternative to pt_remove_acl (CLI). If binding_interface is given, it first clears the port's AclInID/AclOutID and then removes the ACL.
Parameters:
router: device name in PT
name_or_number: identifier of the ACL to remove
binding_interface: optional, interface where the binding was
binding_direction: "in" or "out" (only with binding_interface)
dry_run: if True, returns the payload without sending it
Inputs: router (required), name_or_number (required), dry_run, binding_direction, +1 more.
pt_remove_moduleA
Removes the module installed in a slot (Physical tab). Powers the device off, removes it and powers it back on, like pt_add_module (routers/switches are saved first with write memory); skipped when PT reports the module as hot-swappable. The reply says whether it restarted and was saved.
slot: STRING, same format as pt_add_module ("0/0", "1", "0"...).
Inputs: slot (required), device (required), dry_run.
pt_remove_natA
Removes the NAT/PAT configuration from a router.
Removes the ip nat inside/outside marks from the interfaces and deletes the associated translations, pool and access-list.
Parameters:
router: device name in PT
mode: "static" | "dynamic" | "pat"
inside_interface: interface marked as ip nat inside
outside_interface: interface marked as ip nat outside
acl_number: number/name of the access-list used (default "1")
pool_name: name of the NAT pool to remove (only dynamic/pat with a pool)
static_mappings: mode="static" only. List of dicts with inside_local/inside_global to generate the "no ip nat inside source static ..." commands
dry_run: if True, returns the payload without sending it
Inputs: mode (required), router (required), inside_interface (required), outside_interface (required), +4 more.
pt_rename_deviceA
Rename a device in the active Packet Tracer topology.
Reads the result back: verified is true only when the new name resolves
to the device and the old name no longer does.
Parameters:
old_name: current device name
new_name: new name to assign
Inputs: new_name (required), old_name (required).
pt_save_projectA
Saves Packet Tracer's active topology as a .pkt file.
Closes the loop: until now the MCP built the topology but saving it needed Ctrl+S by hand.
Parameters:
filename: file name (.pkt is added if missing)
directory: destination folder. Empty = PT's save folder (on Linux, where PT reports a folder that does not exist, ~/pt/saves). An absolute path must be an existing folder (the user's choice of where labs live); a relative one is a folder inside the MCP's working directory.
overwrite: replace an existing file (default False: an existing file is an error).
Inputs: filename (required), directory, overwrite.
pt_screenshotA
Captures PT's logical canvas and saves it as an image.
Returns the file's PATH, not the image: a capture weighs tens of thousands of bytes and dumping it in the reply would fill the context without anyone being able to see it.
PNG compresses a diagram much better than JPG (measured: 33 KB versus 105 KB for the same canvas), so it is the default.
Parameters:
filename: file name, without extension. It is sanitised.
fmt: PNG (default) | JPG | JPEG | BMP.
output_dir: destination folder, relative to the project root.
Example: pt_screenshot(filename="lab-ospf")
Inputs: fmt, filename, output_dir.
pt_send_pduA
The GUI's "Add Simple PDU": an ICMP echo from one device to another.
Parameters:
source, destination: device names (pt_query_topology).
simulation: True (default) switches PT to Simulation first, so the PDU waits in the event list; False switches to Realtime, where PT delivers it at once.
steps: in Simulation, how many events to step forward right away (0-100). With steps > 0 the reply includes the packet trace (path, drops and PT's per-layer reason), like pt_read_packet_trace.
The first PDU between two devices can die at a router waiting on ARP, exactly like the first ping: send it again.
Example: pt_send_pdu("PC1", "PC4", steps=10)
Inputs: source (required), destination (required), steps, simulation.
pt_send_rawA
Send arbitrary JavaScript to Packet Tracer via bridge. Useful for exploring the IPC API or running custom commands.
If wait_result=True, reportResult() is auto-injected into scope. Just call reportResult(data) in your code — no need to define it. Examples: pt_send_raw("reportResult(getDevices('router'))", wait_result=True) pt_send_raw("addDevice('TestR','2911',500,300)")
Parameters:
js_code: JavaScript to execute in PT's Script Engine
wait_result: if True, waits for a response via reportResult()
Inputs: js_code (required), wait_result.
pt_server_dhcpA
A Server-PT's Services > DHCP: creates or edits a pool and switches it on.
pool: name ("serverPool" is the factory one: editing it is the most common case). Touched only if a pool field below is given; if it doesn't exist it is created with those values.
gateway, dns, start_ip, mask ("255.255.255.0" or "24"), max_users, tftp, wlc: empty/0 = leave alone. PT's script API has no TFTP/WLC setter, so tftp/wlc always come back in not_applied (set them in the GUI). Every field is read back: any PT does not hold comes back in not_applied, with ok=false.
enable: True = Service On (default), False = Off, None = leave alone.
remove_pool: deletes that pool (alone, it creates nothing).
exclude: ranges to exclude, ["192.168.1.1-192.168.1.9"]; they apply to the port's DHCP server, never create or edit a pool.
interface: the server's port (default: the first one). Hosts use it with pt_host_ip_config(mode="dhcp").
Inputs: device (required), dns, wlc, mask, +12 more.
pt_server_dnsA
A Server-PT's Services > DNS: adds/removes records and switches the service on.
records: [{"name": "www.lab.com", "type": "A", "value": "192.168.1.20"}, {"name": "web.lab.com", "type": "CNAME", "value": "www.lab.com"}]
remove: same shape, to delete.
enable: True = On (default), False = Off, None = leave alone. The reply's
storedsays whether each added record is in the server's database. Check resolution with pt_host_command(host, "nslookup www.lab.com").
Inputs: device (required), show, enable, remove, +3 more.
pt_server_httpA
A Server-PT's Services > HTTP: switches HTTP/HTTPS and edits pages.
pages: {"index.html": "..."} replaces the content of pages that ALREADY exist on the server (a Server-PT has index.html). New pages cannot be created: PT 9.0.0 answers "File not exist" (9.0.1 unverified). Such a page comes back in not_applied with ok=false; the other pages and switches are still applied.
enable / https_enable: True/False/None (None = leave alone); enable defaults to True.
PT 9.0.0 hangs and crashes if one call turns HTTP/HTTPS on or writes pages while both are off, so such a call changes nothing and returns ok=false: turn one on in the server's Services > HTTP tab first. Turning things off is always allowed. Check it with pt_web_browser(host, "http://").
Inputs: device (required), show, pages, enable, +3 more.
pt_server_serviceA
A Server-PT's Services > TFTP / FTP / SYSLOG / EMAIL.
service: "tftp" | "ftp" | "syslog" | "email"
enable: True/False (None = leave alone). On EMAIL it switches SMTP and POP3 together.
domain, smtp, pop3: EMAIL only. The Domain Name ("lab.com"; empty = leave alone) and each protocol On/Off; all three are read back.
users: accounts for ftp/email: [{"username": "alice", "password": "secret", "permissions": "RWDNL"}] (permissions FTP only: Read Write Delete reName List). SYSLOG also returns how many messages it received (
entries) and the newest 200 as PT serializes them (messages; fields not mapped).
Inputs: device (required), service (required), pop3, show, +6 more.
pt_set_portA
Sets low-level attributes of a port on a live device in PT.
Only applies the attributes passed explicitly (parameters with
sentinel defaults). Useful for adjustments the CLI doesn't expose easily, or
that you want to apply without entering configure terminal.
Parameters:
device: device name in PT (e.g. "R1")
interface: interface name (e.g. "GigabitEthernet0/0")
bandwidth: bandwidth in kbps (>0 to apply; 0 = don't change)
bandwidth_auto: 1 enables BW auto-negotiation, 0 disables it, -1 doesn't change
full_duplex: 1 full duplex, 0 half duplex, -1 doesn't change
duplex_auto: 1 enables duplex auto-negotiation, 0 disables, -1 doesn't change
description: descriptive text (empty = doesn't change)
mac_address: MAC in "AABB.CCDD.EEFF" format (empty = doesn't change)
power: 1 powers the port on, 0 off, -1 doesn't change
zone_member: name of the port's security zone, for Zone-Based Firewall (empty = doesn't change). Router interfaces only.
proxy_arp: 1 enables Proxy ARP, 0 disables it, -1 doesn't change. Turning it off is common hardening: with Proxy ARP the router answers ARPs that are not its own and leaks information about the topology.
ike: 1 enables IKE on the interface (IPsec VPN), 0 disables it, -1 doesn't change.
Returns which attributes were applied (those with a method available in
the port's API). If some setXxx does not exist on the device's model,
it is silently ignored and only what took effect is reported.
Inputs: device (required), interface (required), ike, power, +8 more.
pt_simulation_modeA
Switches PT between Realtime and Simulation mode.
In Simulation mode packets do NOT move on their own: they stay queued in the event list and have to be moved with pt_simulation_step. That is what allows reading the path packet by packet with pt_read_packet_trace.
Parameters:
on: True enters Simulation (default), False goes back to Realtime.
Example: pt_simulation_mode(on=True)
Inputs: on.
pt_simulation_stepA
Steps the simulation forward, back, or resets it.
Requires Simulation mode (pt_simulation_mode(on=True)). Each step moves the packets one event; after stepping, read the result with pt_read_packet_trace.
Parameters:
action: "forward" (default) | "back" | "reset".
times: how many steps to take (1-100, ignored for "reset").
Example: step 5 events forward: pt_simulation_step(action="forward", times=5)
Inputs: times, action.
pt_terminalA
Desktop > Terminal of a PC connected by a CONSOLE cable (RS 232) to a router/switch: types on that device's console, as from the PC's Terminal. This is how labs configure a device "over the console".
device: the PC (or Laptop) that has the console cable.
commands, timeout, auto_confirm: as in pt_cli.
show/capture: shows the PC's Terminal app (its 9600 8N1 settings window is accepted automatically).
Inputs: device (required), commands (required), show, capture, +3 more.
pt_ui_captureA
Saves a PNG of a device's window as it looks in PT (or of the main window if device is empty). Works even when the window is covered. Returns the file's PATH, not the image.
Open the tab/app you want first with pt_ui_open (or show=True on the tool you ran). For the logical canvas without the interface there is pt_screenshot.
Inputs: device, filename, output_dir.
pt_ui_closeA
Closes a device's window in PT, or all of them if device is empty.
Inputs: device.
pt_ui_modeA
Headless vs UI: decides whether the device-panel tools also SHOW what they do in Packet Tracer's window.
"headless" (default): everything through the API, no window opens.
"ui": pt_cli, pt_host_command, pt_host_ip_config, pt_server_*... open the device's window on the matching tab/app (CLI, Desktop > Command Prompt, Desktop > IP Configuration, Services > DHCP...) so it can be watched or captured.
"status": shows the current mode.
The mode is saved and survives server restarts. Every tool also accepts show=True/False for a single call. Use it when the user says "show it in PT", "I want screenshots", "use the tabs" (→ "ui") or "do it in the background" (→ "headless").
Inputs: mode.
pt_ui_openA
Opens a device's window in PT on a tab/app/section, without moving the mouse or typing (UI Automation + PT's API).
tab: Physical | Config | CLI | Desktop | Services | Programming | Attributes
app (Desktop): ip_configuration, command_prompt, terminal, web_browser, pc_wireless, email, text_editor, firewall, ipv6_firewall, vpn, traffic_generator, mib_browser, pppoe_dialer, dial_up, ip_communicator, tftp, ssh_client, bluetooth, iot_monitor... (implies tab=Desktop)
section: an entry in the tab's left-hand list: in Config "Settings" or an interface ("FastEthernet0"); in Services "DHCP", "DNS", "HTTP", "TFTP", "EMAIL", "FTP"...
Works in headless mode too: it is an explicit request to show. Requires Windows and the [ui] extra (comtypes).
Inputs: device (required), app, tab, section, +1 more.
pt_validate_planA
Validates a topology plan. Returns typed errors and warnings.
Parameters:
plan_json: plan JSON (output of pt_plan_topology)
plan_path: instead of plan_json, a .json file with the plan (large designs)
Inputs: plan_json, plan_path.
pt_verify_connectivityA
Runs a REAL ping from a device in PT and returns the result.
Unlike validations that are only printed as "check it by
hand", this runs ping on the device's console and parses the real
output: how many packets arrived. Use it to confirm that a freshly
deployed topology really has connectivity.
Works with hosts (PC/Server/Laptop, format "Packets: Sent=..") and with IOS devices (router/switch, format "Success rate is N percent").
Parameters:
from_device: name of the device the ping starts from
to_ip: destination IP
count: reserved; PT uses its default per type (PC 4, IOS 5). A "-n" flag would break on IOS, so it is not forced for now.
timeout_s: maximum wait (default 45s: on a topology deployed moments ago, switch ports spend ~30s in STP before forwarding). A FAILED ping takes longer than a successful one: each packet waits for its own timeout before being declared lost (~13s measured for 4 lost packets).
Inputs: to_ip (required), from_device (required), count, timeout_s.
pt_web_browserA
A host's Desktop > Web Browser: opens a URL (http://IP, http://name with DNS, https://...) and returns the text of the page it received. If the browser still shows its previous page (failed or slow load), the reply is ok=false with a warning, not that old page; re-opening the URL it last loaded returns the page again. timeout: up to 120 s.
In UI mode (or show=True) the window's own browser does the navigation, so the capture shows the rendered page.
Inputs: url (required), device (required), show, capture, +2 more.
pt_wireless_apA
An access point's wireless settings (AccessPoint-PT Config > Port 1), applied and read back. With no settings it only reads.
Parameters (empty/None = leave alone):
ssid: network name (up to 32 bytes). Clients on another SSID drop off; giving each AP its own SSID keeps clients off the APs you rename.
broadcast: SSID broadcast on/off.
mac_filter: MAC filtering on/off.
allow_listed: True = only listed MACs may associate, False = listed MACs are denied.
mac_list: REPLACES the filter list ("0001.63BE.8468", "00:01:63:BE:84:68").
reset_associations: after a change, drop every client so they re-associate against the new settings (default True; without it, clients already associated may keep the old association).
dry_run: only read and report what would change.
A dropped client's port still reads up/linked: confirm with a ping (pt_host_command) or its address, not the port state. WPA/WEP are not settable: clients need a matching profile, and PT's client profile API is broken.
Inputs: device (required), ssid, dry_run, mac_list, +4 more.
pt_workspace_optionsA
Reads and adjusts PT workspace options that affect how it behaves.
Without arguments it is read-only. The flags are tri-state: 1 enables, 0 disables, -1 (default) leaves alone.
Parameters:
auto_cabling: PT's auto-cabling picks the cable and the port for you. Turn it off before building topologies by script if you want exact control over which port is used.
external_network_access: lets PT reach the machine's REAL network. Off by default; turning it on takes traffic out of the simulator.
show_port_labels / show_link_lights / show_device_labels: what is shown on the canvas. It matters for a capture to be readable.
Example: turn auto-cabling off before a scripted deploy: pt_workspace_options(auto_cabling=0)
Inputs: auto_cabling, show_link_lights, show_port_labels, show_device_labels, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 98 tools
Most feature areas (VLANs, STP, ACLs, NAT, QoS, voice, etc.) are clearly distinct and the descriptions often cross-reference each other (e.g. pt_inspect_ports vs pt_health_check). However, the plan/deploy pipeline has heavy overlap (pt_plan_topology, pt_full_build, pt_live_deploy, pt_deploy, pt_export) and the topology-read tools (pt_query_topology, pt_export_topology, pt_read_device_panel, pt_inspect_ports) are easy to confuse. With 98 tools, even good descriptions leave real misselection risk.
All names share a `pt_` prefix and snake_case, which is a strong baseline. But the verb_noun pattern is not consistent: many are noun-only or noun_verb (pt_cli, pt_screenshot, pt_diff, pt_export, pt_deploy, pt_device_power, pt_project_metadata, pt_canvas_info, pt_workspace_options). The result is readable but mixed in convention.
98 tools is far beyond the typical 3–15 range and imposes a heavy selection and context burden. The Packet Tracer domain is genuinely broad, so each tool has some justification, but the set is over-scoped and would benefit from consolidation (especially the plan/deploy pipeline and read-only topology snapshots).
The surface is remarkably comprehensive: planning, validation, deployment, device/link/module management, VLAN/STP/ACL/NAT/QoS/voice/BGP/HSRP, server services, host configuration, simulation, packet tracing, UI automation, and project lifecycle. Minor gaps exist—no dedicated pt_apply_ospf/eigrp/rip tools (routing is configured via plans or raw CLI) and some PT API limitations are acknowledged—but agents can work around these with pt_cli.
Maintenance
Related MCP Connectors
Routed, editable network diagrams from CDP/LLDP output, CSV or Graphviz DOT, as draw.io files
AI network lab: build and validate real multi-vendor router and switch labs from a prompt.
Create, inspect, validate, and save editable 3D building scenes with Pascal's MCP server.
18 Net/Web/Media MCP tools: IPv4/IPv6 CIDR, MAC, SDP, WebSocket, HAR, SEO, a11y, subtitles.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to plan, validate, generate, and deploy Cisco Packet Tracer network topologies from natural-language prompts, including routing, switching, DHCP, VLANs, security, IPv6, wireless, live deployment, verification, and .pkt project management.3MIT
- AlicenseAqualityBmaintenanceEnables controlling Cisco Packet Tracer through its native PTMP/IPC interface to create devices and links, configure IOS and PC addresses, run real ping tests, save .pkt files, and export topology as PNG.141MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to plan, create, and control Cisco Packet Tracer network topologies in real time, including deploying devices and cabling, configuring IPs and IOS CLI, and querying or clearing topologies through an HTTP bridge.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to plan and validate Cisco network topologies, generate IOS CLI configurations, deploy devices and cabling live in Cisco Packet Tracer, and run connectivity diagnostics such as ping and packet capture.3MIT