Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Mats2208/MCP-Packet-Tracer/llms.txt

Use this file to discover all available pages before exploring further.

By the end of this guide you will have the MCP Packet Tracer server installed, wired up to your AI client of choice, and ready to generate a fully addressed, validated Cisco network topology — complete with IOS CLI configs, DHCP pools, and routing configuration — from a single natural-language prompt. Live deployment into a running Packet Tracer instance is optional and takes one extra step.
1
Clone and install
2
Clone the repository and install the package in editable mode. After this, the packet_tracer_mcp module is importable from any directory — you do not need to keep a terminal open in the repo folder.
3
git clone https://github.com/Mats2208/MCP-Packet-Tracer && cd MCP-Packet-Tracer && pip install -e .
4
The only runtime dependencies (mcp[cli]>=1.0.0 and pydantic>=2.0.0) are installed automatically.
5
Connect your MCP client
6
Most desktop clients support stdio transport: the client spawns the server as a child process on demand, so no background server process is needed. The internal HTTP bridge to Packet Tracer (:54321) still starts automatically inside the spawned process, so live deploy works the same way.
7
Claude Code — one CLI command:
8
claude mcp add --scope user --transport stdio packet-tracer -- python -m packet_tracer_mcp --stdio
9
The --scope user flag registers the server in your global ~/.claude.json so it is available from any directory, not just the repo. Verify the connection:
10
claude mcp list
# packet-tracer: python -m packet_tracer_mcp --stdio - ✓ Connected
11
For other clients (Claude Desktop, VS Code / Copilot, Cursor, OpenAI Codex CLI), see Client Setup. Every client uses the same command and args:
12
FieldValuecommandpythonargs["-m", "packet_tracer_mcp", "--stdio"]transport / typestdio
13
If your client supports streamable-http and you want a persistent server shared across multiple windows, start the server manually with python -m packet_tracer_mcp (no flags) and point your client at http://127.0.0.1:39000/mcp.
14
(Optional) Enable live deploy
15
To have the server stream commands directly into a running Packet Tracer instance — no copy-pasting required — you need to paste a one-time bootstrap snippet into PT’s Builder Code Editor.
16
  • Open Cisco Packet Tracer 8.2+.
  • Go to Extensions → Builder Code Editor.
  • Paste the following script and click Run:
  • 17
    /* PT-MCP Bridge */ window.webview.evaluateJavaScriptAsync("setInterval(function(){var x=new XMLHttpRequest();x.open('GET','http://127.0.0.1:54321/next',true);x.onload=function(){if(x.status===200&&x.responseText){$se('runCode',x.responseText)}};x.onerror=function(){};x.send()},500)");
    
    18
    This injects a polling loop into PT’s PTBuilder webview. Every 500 ms it calls the bridge at :54321/next, picks up any queued command, and executes it in PT’s Script Engine via $se('runCode', ...). You only need to do this once per Packet Tracer session.
    19
    For full setup details and troubleshooting, see Live Deploy Setup.
    20
    The planning, validation, generation, and export tools all work without Packet Tracer open. You can generate scripts and configs and export them to disk even when PT is not running.
    21
    Ask the LLM to build a network
    22
    With the server connected, ask your AI assistant to build a topology in plain English:
    23
    "Create a network with 2 routers, 2 switches, 4 PCs, DHCP and static routing"
    
    24
    The server handles the complete pipeline — planning → validation → generation → deploy — and returns a human-readable summary. Here is what pt_full_build produces for this prompt:
    25
    Devices (8):  R1, R2 (2911), SW1, SW2 (2960-24TT), PC1, PC2, PC3, PC4 (PC-PT)
    Links   (7):  R1<->R2 (cross), R1<->SW1 (straight), R2<->SW2 (straight),
                  SW1<->PC1, SW1<->PC2, SW2<->PC3, SW2<->PC4 (all straight)
    
    IP Plan:
      LAN 1:  192.168.0.0/24 -- R1 Gig0/0: .1, PC1: .2, PC2: .3
      LAN 2:  192.168.1.0/24 -- R2 Gig0/0: .1, PC3: .2, PC4: .3
      Link:   10.0.0.0/30    -- R1 Gig0/1: 10.0.0.1, R2 Gig0/1: 10.0.0.2
    
    DHCP:   Pools on R1 (192.168.0.0/24) and R2 (192.168.1.0/24)
    Routes: Bidirectional static routes on R1 and R2
    
    Generated:  8x addDevice, 7x addLink, 2x configureIosDevice, 4x configurePcIp
    
    26
    If the HTTP bridge is active, calling pt_live_deploy sends all 21 commands through the bridge and the topology appears in Packet Tracer fully configured — devices placed, cables connected, IOS configs applied.

    Two Transport Modes

    stdio (recommended for most users)
    • The MCP client spawns python -m packet_tracer_mcp --stdio as a child process.
    • Zero manual steps — no server to start or stop.
    • Works from any directory after pip install -e ..
    • The internal HTTP bridge to Packet Tracer (:54321) starts automatically inside the spawned process.
    streamable-http (http://127.0.0.1:39000/mcp)
    • You start the server once with python -m packet_tracer_mcp (no --stdio flag).
    • Multiple clients (VS Code windows, Claude Desktop, browser-based tools) can connect to the same instance simultaneously.
    • Server state — including the PT bridge connection — persists across client sessions.
    • Useful for remote or shared scenarios.
    Both modes expose the same 33 tools and 5 resources.

    Next Steps

    How It Works

    Understand the full planning, validation, and live-deploy pipeline.

    Tools Overview

    Browse all 33 tools across 11 groups with descriptions and usage notes.

    Client Setup

    Step-by-step configuration for Claude Desktop, VS Code, Cursor, and Codex CLI.

    Live Deploy

    Set up the HTTP bridge for real-time command streaming into Packet Tracer.

    Build docs developers (and LLMs) love