Packet Tracer Visual MCP
This server provides programmatic control over Cisco Packet Tracer, enabling automated topology creation, device configuration, fault injection/repair, and network validation — all via MCP tool calls instead of manual GUI interaction.
Read & Inspect
Check bridge connection status
Read all devices, interfaces, and links on the workspace
View command history for a device or the whole workspace
Probe device APIs and Server-PT services (DNS/HTTP/FTP/DHCP) read-only
Build Topologies
Add individual devices (routers, switches, PCs, servers, printers) at specific coordinates
Add devices or links sequentially with delays — ideal for screen recordings/demos
Create links with automatic or manual port assignment
Configure Devices
Set IPv4 address, subnet mask, gateway, DNS, or DHCP on PCs/Servers
Send arbitrary Cisco IOS CLI commands to routers and switches
Run
showcommands and retrieve outputGenerate reusable IOS templates for static routes, RIP, OSPF, EIGRP, DHCP pools, extended ACLs, and NAT/PAT
Campus Network Automation
Preview the built-in campus topology plan (33 devices, 34 links, VLANs, routing, DHCP, ACL, NAT/PAT) without touching Packet Tracer
Build the full campus topology sequentially with device/link placement, IP config, and optional IOS delivery
Generate or one-click apply the complete campus IOS configuration set
Apply custom batches of IOS commands to multiple devices at once
Validation & Troubleshooting
Fast validation: check topology shape, connectivity, and key devices/links without heavy show-command sweeps
Generate structured validation plans (fast/standard/strict) for VLANs, trunks, routing, DHCP, NAT, and ACLs
Fault Injection & Repair
Browse the built-in fault library (OSPF mismatches, ACL misconfigurations, NAT errors, missing trunk VLANs, etc.)
Inject predefined fault scenarios to simulate real-world issues
Generate or apply repair commands to fix any built-in fault
Integrates with Cisco Packet Tracer to automate network topology creation, device configuration, and fault injection for network simulation and education.
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 Visual MCP Build a campus network with VLANs and OSPF, then run fast validation."
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 Visual MCP
这个项目是一个给 Packet Tracer 用的 MCP 工具。
说白了:以前你在 Packet Tracer 里要自己拖设备、连线、配路由、配 VLAN;现在可以让 Codex 通过 MCP 去干这些活。它特别适合计网课设、校园网实验、录屏演示、故障排查演示。
这个项目是独立实现,不是 Cisco 官方项目,也不冒充官方工具。
现在能做什么
读取 Packet Tracer 当前画布。
自动放设备,支持一台一台出现,录屏看起来比较直观。
自动连线,支持一条一条连。
自动分配端口,不用每条线都手写
FastEthernet0/1这种接口。内置一个中小型校园网模板:
33台设备,34条链路。自动生成完整 IOS 配置:
VLAN
Access / Trunk
跨 VLAN 通信
静态路由 / RIP / OSPF / EIGRP
DHCP
ACL
NAT/PAT
可以把 IOS 配置直接下发到 Packet Tracer 设备。
支持故障注入和修复演示,比如 OSPF 区域错误、ACL 误拦截、NAT 配错。
默认有
fast快速验收,不会一上来跑一大堆慢show命令。也能生成标准验收计划,适合最后交课设前慢慢查。
Related MCP server: ptlab
一行安装
目前还没发到 PyPI,所以先用 GitHub 安装最稳:
git clone https://github.com/lyf94697-droid/packet-tracer-visual-mcp.git; cd packet-tracer-visual-mcp; python -m pip install -e .; python scripts\build_script_engine.py然后把 MCP 配到 Codex:
[mcp_servers.packet-tracer-visual-mcp]
command = "pt-visual-mcp"
args = []启动 MCP:
pt-visual-mcpPacket Tracer 里怎么接上
推荐方式是生成并安装 .pts 持久模块,流程见:
docs/create-pts-module.md临时调试时也可以生成单文件 JS:
python scripts\build_script_engine.py然后在 Packet Tracer 里导入并运行:
extension\packet-tracer-visual-mcp-script-engine.js接着打开:
Extensions > PT Visual MCP窗口里显示 connected 就说明接上了。
如果你像旧版 cisco-pt-mcp 一样想走稳定安装,最终应当安装:
E:\mc\packet-tracer-visual-mcp\extension\packet-tracer-visual-mcp.pts这个 .pts 需要用 Packet Tracer 按 docs/create-pts-module.md 导出一次。
默认连接地址是:
ws://127.0.0.1:7541/ws计网课设能覆盖到哪
内置校园网模板就是按常见计网课设来做的:
至少 4 个 VLAN:支持,默认有 VLAN 10/20/30/40/50/99。
Access / Trunk:支持。
跨 VLAN 通信:支持。
静态路由或 OSPF:支持,还额外支持 RIP 和 EIGRP。
DHCP:支持 IOS DHCP 池,也可以做 DHCP relay 方案。
DNS / Web / FTP:服务器位置和地址规划支持,服务开关见下面说明。
NAT/PAT:支持。
ACL:支持,默认有两条允许/拒绝验证案例。
连通性测试、服务测试、NAT 测试、ACL 测试:会自动生成测试清单。
完整调试案例:支持,比如“VLAN30 不能访问 Web,但 DNS 正常”。
Server-PT 图形服务说明
网络侧我已经能自动做:IP、网关、DNS、VLAN、路由、ACL、NAT/PAT 都可以走 MCP。
但 Packet Tracer 的 Server-PT > Services 面板比较特殊。DNS、HTTP、FTP 这些开关和用户添加,取决于 Packet Tracer Script Engine 有没有暴露稳定 API。
所以当前最稳的做法是:
SRV-DNS:Services > DNS > Onwww.campus.local -> 192.168.40.20ftp.campus.local -> 192.168.40.30
SRV-WEB:Services > HTTP > OnSRV-FTP:Services > FTP > On用户:
ftpuser密码:
cisco
后续可以做一个实验功能:
先用
ptv_probeServerServices探测 Server-PT 设备对象到底暴露了哪些服务相关方法。如果有稳定 API,就加
ptv_configureServerServices,自动开 DNS/HTTP/FTP。如果没有稳定 API,就不硬吹自动化;最多提供手动步骤或非默认的 GUI 点击方案。
已经提供的探测工具:
ptv_probeDeviceApi:只读探测任意设备对象暴露了哪些方法。ptv_probeServerServices:只读扫描 Server-PT 上 DNS/HTTP/FTP/DHCP 相关的方法线索。
这两个工具不会改服务配置,只负责判断有没有稳定接口。
常用 MCP 工具
基础操作:
ptv_bridgeStatusptv_getNetworkptv_addDeviceptv_addDevicesTimelineptv_addLinkptv_addLinksTimelineptv_configurePcptv_configureIos
校园网和配置:
ptv_getCampusPlanptv_buildCampusRecordingDemoptv_generateCampusIosConfigptv_applyCampusIosConfigptv_generateIosTemplateptv_applyIosConfigSet
验收和排错:
ptv_validateCampusFastptv_generateCampusValidationPlanptv_getCommandLogptv_runShowCommandsptv_probeDeviceApiptv_probeServerServicesptv_getFaultLibraryptv_injectFaultptv_repairFault
快速录屏推荐参数
想要“看起来很快,但别乱掉”,推荐:
{
"qualityMode": "fast-safe",
"deviceDelayMs": 40,
"linkDelayMs": 20,
"autoAssignPorts": true,
"autoFallback": true,
"validatePlan": true,
"verifyAfterBuild": true,
"configureDevices": false
}如果要顺手下发配置,把 configureDevices 改成 true,但会比单纯摆拓扑慢。
验收模式
fast:默认模式。看拓扑是否建全、构建有没有失败、关键设备和链路是否存在。不跑重型show命令。standard:生成 VLAN、Trunk、路由、DHCP、NAT、ACL 的命令检查计划。strict:更适合最后交付前慢慢验。off:不验收。
录屏和快速生成用 fast,答辩前再用 standard 或 strict。
示例
课程设计示例看这里:
examples/campus-course-design.md常用提示词看这里:
examples/prompts.md本地自检
python -m pip install -e .
python scripts\check_project.py
python -m compileall src scripts
python scripts\build_script_engine.py
node --check extension\source\pt_api.js
node --check extension\source\interface\bridge.js
node --check extension\packet-tracer-visual-mcp-script-engine.js自检通过时会看到类似:
project check passed: 23 tools, 33 devices, 34 links项目结构
packet-tracer-visual-mcp/
src/pt_visual_mcp/ MCP 服务端和 WebSocket 桥接
extension/source/ Packet Tracer 扩展源码
extension/*.js 可导入 Packet Tracer 的脚本
skill/SKILL.md Codex 技能说明
examples/ 示例提示词和课设示例
docs/ 功能说明和开发笔记
scripts/check_project.py 项目自检脚本许可证
MIT License。
如果你基于别人的 MIT 项目继续改,记得保留对方的协议和署名。这个仓库当前定位是一个干净的原创实现,重点是 Packet Tracer 可视化拓扑生成、课程设计预设和 IOS 自动化。
Available Tools
23 toolsptv_addDeviceC
Add one Packet Tracer device at a specific workspace coordinate.
Inputs: name (required), model (required), x (required), y (required).
ptv_addDevicesTimelineB
Add devices one by one inside Packet Tracer with a short delay between real add operations. Use for screen recordings where viewers should see devices appear sequentially.
Inputs: devices (required), delayMs, qualityMode, maxRetries, +5 more.
ptv_addLinkC
Create one link between two existing Packet Tracer interfaces.
Inputs: fromDevice (required), toDevice (required), fromInterface, toInterface, +3 more.
ptv_addLinksTimelineC
Create links one by one with a short delay, optimized for recording a topology being wired.
Inputs: links (required), delayMs, qualityMode, maxRetries, +5 more.
ptv_applyCampusIosConfigC
One-click generation and application of the complete campus IOS configuration set. Requires the Packet Tracer bridge to be connected.
Inputs: prefix, routingProtocol, dhcpMode, includeNatPat, +2 more.
ptv_applyIosConfigSetC
Apply an arbitrary IOS config set made of deviceName plus commands entries.
Inputs: configs (required).
ptv_bridgeStatusA
Check whether the Packet Tracer Visual MCP extension is connected.
Inputs: no named parameters.
ptv_buildCampusRecordingDemoC
Build a visually complex campus topology in Packet Tracer: devices appear sequentially, links are drawn sequentially, PC/server IPs are applied, and IOS commands are optionally sent. Designed for course-design demos and screen recordings.
Inputs: prefix, originX, originY, scale, +12 more.
ptv_configureIosC
Send Cisco IOS commands to one router or switch. Commands may be a string or an array of strings.
Inputs: deviceName (required), commands (required).
ptv_configurePcC
Set a PC or Server IPv4 address, mask, gateway, DNS, or DHCP flag.
Inputs: deviceName (required), dhcp, ip, mask, +2 more.
ptv_generateCampusIosConfigA
Generate a complete IOS configuration set for the built-in campus topology. Supports routingProtocol static/rip/ospf/eigrp, IOS DHCP pools, ACL templates, and NAT/PAT.
Inputs: prefix, routingProtocol, dhcpMode, includeNatPat, +2 more.
ptv_generateCampusValidationPlanB
Generate a campus validation plan. Default validationMode is fast, which avoids show-command sweeps. Use standard or strict only when slower IOS command checks are acceptable.
Inputs: prefix, routingProtocol, dhcpMode, includeNatPat, +2 more.
ptv_generateIosTemplateC
Generate reusable IOS command templates for static routes, RIP, OSPF, EIGRP, DHCP pools, extended ACLs, and NAT/PAT. This does not touch Packet Tracer.
Inputs: template (required), params.
ptv_getCampusPlanA
Generate the built-in campus-network demo plan without touching Packet Tracer. Use this to preview device names, VLANs, links, service steps, and tests.
Inputs: prefix, originX, originY, scale.
ptv_getCommandLogB
Read recent Packet Tracer command history for one device or the whole workspace.
Inputs: deviceName, limit.
ptv_getFaultLibraryA
List built-in fault injection scenarios and their expected symptoms and verification commands.
Inputs: no named parameters.
ptv_getNetworkA
Read the current Packet Tracer logical workspace: devices, interfaces, and links.
Inputs: no named parameters.
ptv_injectFaultC
Generate or apply a built-in fault scenario, such as missing trunk VLAN, OSPF area mismatch, missing static route, overblocking ACL, or broken NAT outside marking.
Inputs: faultId (required), prefix, apply.
ptv_probeDeviceApiA
Read-only probe for Packet Tracer device object APIs. Use it to inspect whether a device exposes service-related methods before implementing Server-PT automation.
Inputs: deviceName (required), maxDepth, maxKeys, includeSafeCalls.
ptv_probeServerServicesB
Read-only probe for Server-PT service automation hints. It scans one Server-PT or all Server-PT devices for DNS/HTTP/FTP/DHCP related API names without changing services.
Inputs: deviceName, maxDepth, maxKeys.
ptv_repairFaultC
Generate or apply the repair commands for a built-in fault scenario.
Inputs: faultId (required), prefix, apply.
ptv_runShowCommandsA
Issue show commands to one IOS device and return command-log confirmation. Packet Tracer does not guarantee full show-output parsing.
Inputs: deviceName (required), commands (required), logLimit.
ptv_validateCampusFastB
Run a speed-preserving campus validation: plan shape, build/apply results, one optional canvas snapshot, and key-device/link checks. It does not run heavy show commands.
Inputs: prefix, originX, originY, scale, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes, but there is some potential confusion between generate/apply campus config tools and between buildCampusRecordingDemo vs. step-by-step add tools. Descriptions help, but overlap exists.
All tools use the consistent 'ptv_verb_noun' pattern. Verbs are descriptive and nouns are specific, making the set predictable and easy to navigate.
23 tools is at the upper bound of reasonable for a complex domain like network simulation, but each tool serves a clear purpose for campus topology building, configuration, and validation.
The tool set covers core workflows: device addition, linking, configuration, validation, and fault injection. However, removal or update operations are missing, and the focus is heavily on a specific campus demo, which may leave gaps for general use.
Maintenance
Related MCP Connectors
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
MCP server for network documentation, generated by doc2mcp.
MCP server for generating rough-draft project plans from natural-language prompts.
Remote MCP server for deterministic educational practice-assessment score conversions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables control of Cisco Packet Tracer 9.0 via natural language, allowing creation of network topologies, device configuration, and simulation launches through an MCP interface.97 npm15MIT
- AlicenseAqualityCmaintenanceEnables headless creation, parsing, and grading of Cisco Packet Tracer .pkt/.pka lab files, including CCNA activity scoring, through MCP tools without requiring Packet Tracer to run.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables external control of Cisco Packet Tracer 9.0 through MCP, allowing users to create network topologies, configure routers, and launch simulations from MCP clients.28 npm1MIT
- 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