MCP Packet Tracer
AI-powered Cisco Packet Tracer automation using MCP. Generate, validate and deploy full network topologies (OSPF, DHCP, EIGRP, RIP) from natural language prompts.
Install / Use
/learn @Mats2208/MCP Packet TracerQuality Score
Category
Development & EngineeringSupported Platforms
README
<img src="https://www.netacad.com/skillsforall/img/desktop/cisco_packet_tracer.png" width="36" align="center"/> Packet Tracer MCP Server
Tell your AI "create a network with 3 routers, OSPF and DHCP" — it plans, validates, generates, and deploys the topology directly into Cisco Packet Tracer in real time.
<br/> <table> <tr> <td align="center"><strong>22 MCP Tools</strong></td> <td align="center"><strong>5 MCP Resources</strong></td> <td align="center"><strong>74 Device Models</strong></td> <td align="center"><strong>150 Modules</strong></td> <td align="center"><strong>15 Cable Types</strong></td> </tr> </table> </div>Showcase
<p align="center"> <img src="demo/topology-screenshot.png" alt="3-router OSPF topology deployed to Packet Tracer" width="720"/> </p> <p align="center"><sub>3-router linear topology with OSPF, DHCP, and 6 PCs — planned and deployed via MCP tools</sub></p> <table> <tr> <td width="50%"> <p align="center"><img src="demo/mcp-client.png" alt="MCP tools executing in VS Code" width="100%"/></p> <p align="center"><sub>Full build + live deploy pipeline in VS Code</sub></p> </td> <td width="50%"> <p align="center"><img src="demo/cli-config.png" alt="Generated IOS CLI configs" width="100%"/></p> <p align="center"><sub>Auto-generated IOS CLI configs with OSPF & DHCP</sub></p> </td> </tr> </table> <details> <summary><strong>More screenshots — MCP server in different clients</strong></summary> <br/> <p align="center"> <img src="img/Foto1.png" alt="MCP server connected in OpenAI Codex CLI" width="700"/> </p> <p align="center"><sub>MCP server running — tools and resources exposed in OpenAI Codex CLI</sub></p> <p align="center"> <img src="img/Foto2.png" alt="MCP server connected in Claude Code" width="700"/> </p> <p align="center"><sub>MCP server connected in Claude Code — ready to receive tool calls</sub></p> <p align="center"> <img src="img/LinuxCapture.png" alt="MCP server connected in Claude Code using Arch Linux" width="700"/> </p> <p align="center"><sub>MCP server connected in Claude Code on Arch Linux</sub></p> </details> <p align="center"> <img src="demo/live-deploy.gif" alt="Live deploy demo — from prompt to Packet Tracer in real time" width="720"/> </p> <p align="center"><sub>Live deploy — from natural-language prompt to running topology in Packet Tracer</sub></p>Table of Contents
- What It Does
- Installation
- Quick Start
- How It Works
- MCP Tools (22)
- MCP Resources (5)
- Live Deploy Setup
- Supported Devices (74)
- Cable Types (15)
- Expansion Modules (150)
- IP Addressing
- Routing Protocols
- Topology Templates
- Architecture
- Testing
- Requirements
◈ What It Does
A Model Context Protocol (MCP) server that gives any LLM (GitHub Copilot, Claude, Codex, etc.) full programmatic control over Cisco Packet Tracer. 22 MCP tools and 5 MCP resources cover the complete workflow:
Natural language prompt
│
LLM (GitHub Copilot / Claude)
│ MCP tools
Packet Tracer MCP Server (:39000)
│ HTTP bridge
PTBuilder in Packet Tracer (:54321)
│ Script Engine
Cisco Packet Tracer
── devices created
── cables connected
── IOS configs applied
Key capabilities:
| | Feature | Details |
|---|---------|---------|
| Planning | Natural-language to topology | From a single prompt to a complete TopologyPlan |
| IP Addressing | Automatic /24 LANs + /30 WAN links | Sequential assignment, gateway at .1 |
| DHCP | Auto pool generation | One pool per LAN, gateway excluded |
| Routing | Static / OSPF / EIGRP / RIP | Full IOS command generation |
| Validation | 15 typed error codes + auto-fixer | Wrong cables, missing ports, model upgrades |
| Deploy | Real-time HTTP bridge to Packet Tracer | No copy-paste — commands stream directly |
| Export | Plans, JS scripts, CLI configs to disk | Reusable project files |
| Catalog | 74 devices · 150 modules · 15 cables | 34 categories, 101 aliases |
◈ Installation
git clone https://github.com/Mats2208/MCP-Packet-Tracer
cd MCP-Packet-Tracer
pip install -e .
◈ Quick Start
1 — Start the server
python -m packet_tracer_mcp
This starts two services automatically:
| Service | Endpoint | Purpose |
|---------|----------|---------|
| MCP Server | http://127.0.0.1:39000/mcp | Receives tool calls from your editor/LLM |
| HTTP Bridge | http://127.0.0.1:54321 | Sends commands to PTBuilder inside Packet Tracer |
For stdio mode (debug/legacy):
python -m packet_tracer_mcp --stdio
2 — Connect your MCP client
<details> <summary><img src="https://img.shields.io/badge/VS%20Code-007ACC?style=flat-square&logo=visualstudiocode&logoColor=white" alt="VS Code"/>   <code>.vscode/mcp.json</code></summary>{
"servers": {
"packet-tracer": {
"url": "http://127.0.0.1:39000/mcp"
}
}
}
</details>
<details>
<summary><img src="https://img.shields.io/badge/Claude%20Desktop-D97757?style=flat-square&logo=anthropic&logoColor=white" alt="Claude Desktop"/>   <code>claude_desktop_config.json</code></summary>
{
"mcpServers": {
"packet-tracer": {
"url": "http://127.0.0.1:39000/mcp"
}
}
}
</details>
3 — Ask your LLM to build a network
"Create a network with 2 routers, 2 switches, 4 PCs, DHCP and static routing"
The server handles the rest: planning → validation → generation → deploy.
◈ How It Works
Data Flow
TopologyRequest
│
Orchestrator ─── IPPlanner (assigns /24 LANs + /30 inter-router links)
│
Validator ─── 15 typed error codes, port/cable/IP checks
│
AutoFixer ─── fixes wrong cables, upgrades routers, reassigns ports
│
TopologyPlan (validated, fully addressed)
│
┌──────────────────┬──────────────────────┬──────────────────────┐
▼ ▼ ▼ ▼
addDevice() addModule() addLink() configureIosDevice()
(place device) (HWIC/NIM/NM) (cable) configurePcIp()
│ │ │ │
PTBuilder Script ── sent via HTTP bridge ─▶ Packet Tracer Script Engine
Why Port 39000?
<details> <summary>Design rationale</summary>The server uses streamable-http instead of stdio. This means:
- Persistent — stays running, not restarted per editor session
- Multiple clients — VS Code, Claude Desktop, and others can connect simultaneously
- Shared state — the HTTP bridge to Packet Tracer stays alive across requests
- Debuggable —
curl http://127.0.0.1:39000/mcpor tail logs in the terminal - Decoupled — server lifecycle is independent from the editor
Port 39000 was chosen to avoid collisions with common ports (3000, 5000, 8000, 8080) and the internal bridge at 54321.
</details>◈ MCP Tools
22 tools across 7 groups.
Catalog
| Tool | Description |
|------|-------------|
| pt_list_devices | Lists all 74 supported devices with their port specs |
| pt_list_templates | Lists available topology templates |
| pt_get_device_details | Full port/interface details for a specific model |
Estimation
| Tool | Description |
|------|-------------|
| pt_estimate_plan | Dry-run: counts devices, links, configs without generating the full plan |
Planning
| Tool | Description |
|------|-------------|
| pt_plan_topology | Generates a complete TopologyPlan — devices, links, IPs, DHCP, routes, modules |
pt_plan_topologyreturns machine-readable JSON. Use its output as input for all downstream tools.
Validation & Fixing
| Tool | Description |
|------|-------------|
| pt_validate_plan | Validates a plan against 15 typed error codes |
| pt_fix_plan | Auto-corrects common errors (wrong cables, missing ports, model upgrades) |
| pt_explain_plan | Returns a natural-language explanation of every decision in the plan |
Generation
| Tool | Description |
|------|-------------|
| pt_generate_script | Generates the PTBuilder JavaScript script (addDevice, addModule, addLink) |
| pt_generate_configs | Generates per-device IOS CLI config blocks |
Full Pipeline
| Tool | Description |
|------|-------------|
| pt_full_build | All-in-one: plan + validate + generate + explain + estimate in a single call |
pt_full_buildreturns a human-readable report. It includes the JSON plan at the end for reference but is not intended as direct JSON input for other tools. Usept_plan_topologyfor that.
Live Deploy
| Tool | Description |
|------|-------------|
| pt_deploy | Copies the script to clipboard with paste-in in
Related Skills
node-connect
353.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Hook Development
111.6kThis skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
MCP Integration
111.6kThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.
