MCP server that drives Cisco Packet Tracer through a bridge extension.
Project description
cisco-pt-mcp
An MCP server that lets any MCP-aware client (Claude Desktop, Cursor, Backboard, VS Code, ...) drive a running Cisco Packet Tracer instance.
flowchart LR
client["MCP client"]
server["cisco-pt-mcp<br/>server (Python)"]
pt["Packet Tracer<br/>+ cisco-pt-mcp.pts<br/>bridge extension"]
client <-- "stdio MCP" --> server
server <-- "Socket.IO<br/>127.0.0.1:7531" --> pt
The PT extension shows a small bridge window (Extensions → Packet Tracer MCP) with a connection-status pill and a tool-call activity log — purely diagnostic.
Layout
cisco-pt-mcp/
├─ pyproject.toml # console_script: cisco-pt-mcp = mcp_server.server:main
├─ mcp_server/
│ ├─ __main__.py # python -m mcp_server entrypoint
│ ├─ server.py # MCP stdio server, registers tools, forwards to bridge
│ ├─ bridge.py # PTBridge: Socket.IO server on 127.0.0.1:7531
│ └─ tools.py # 9 tool schemas (single source of truth)
├─ extension/source/ # packaged into cisco-pt-mcp.pts
│ ├─ main.js # PT lifecycle, Extensions menu item
│ ├─ window.js # webview controller (this-sm:index.html)
│ ├─ runcode.js # $se('runCode') eval host
│ ├─ userfunctions.js # the 9 tool implementations (PT scripting host)
│ ├─ devices.js / links.js / modules.js # PT type-id lookup tables
│ └─ interface/ # webview, browser context
│ ├─ index.html # status pill + activity log
│ ├─ interface.js # Socket.IO client, $se dispatcher
│ └─ socket.io.min.js # vendored client
└─ tests/test_smoke.py # 6 offline smoke tests
The split between extension/source/*.js (PT scripting host: ipc.network(),
webViewManager, $se) and extension/source/interface/* (webview browser
context: DOM, socket.io, talks to PT only via $se('runCode', ...)) is
load-bearing — see Cisco's own Cisco-Agent extension for the same pattern.
Install
1. Server
The server is published on PyPI. No cloning or venv setup required — uvx handles
everything in an isolated environment. Install uv
if you don't have it yet (single command on any platform), then register the server
with your MCP client:
| Client | One-line registration |
|---|---|
| Claude Code | claude mcp add cisco-pt-mcp --scope user -- uvx cisco-pt-mcp |
| Claude Desktop | %APPDATA%\Claude\claude_desktop_config.json — JSON below |
| Cursor | %USERPROFILE%\.cursor\mcp.json (or .cursor/mcp.json per project) — same JSON |
| VS Code | .vscode/mcp.json — JSON below (note different key name) |
| Codex CLI | %USERPROFILE%\.codex\config.toml — TOML below |
| Backboard CLI | backboard config add-mcp '{"name": "cisco-pt-mcp", "command": "uvx", "args": ["cisco-pt-mcp"]}' |
Claude Desktop / Cursor (mcpServers):
{
"mcpServers": {
"cisco-pt-mcp": { "command": "uvx", "args": ["cisco-pt-mcp"] }
}
}
VS Code (servers):
{
"servers": {
"cisco-pt-mcp": { "command": "uvx", "args": ["cisco-pt-mcp"] }
}
}
Codex CLI (TOML):
[mcp_servers.cisco-pt-mcp]
command = "uvx"
args = ["cisco-pt-mcp"]
Backboard CLI (one-shot command, persists to ~/.backboard/config.json):
backboard config add-mcp "{\"name\": \"cisco-pt-mcp\", \"command\": \"uvx\", \"args\": [\"cisco-pt-mcp\"]}"
Verify with backboard config list-mcp. Toggle off/on later with
backboard config disable-mcp cisco-pt-mcp / enable-mcp cisco-pt-mcp.
Fallback: If
uvxisn't available, install the package manually and point directly at the binary:{ "mcpServers": { "cisco-pt-mcp": { "command": "C:\\path\\to\\.venv\\Scripts\\cisco-pt-mcp.exe" } } }
For remote use, expose this server through mcp-remote; HTTP transport
is intentionally not built in.
2. Extension
- Download
cisco-pt-mcp.ptsfrom the repo: github.com/muhammadbalawal/cisco-pt-mcp/raw/main/extension/cisco-pt-mcp.pts (or grab the latest.ptsfrom the Releases page). - In Packet Tracer: Extensions → Extensions Manager → Install Extension…
- Select the downloaded
cisco-pt-mcp.pts. - Restart Packet Tracer when prompted.
Extensions → Packet Tracer MCP now shows in the menu — click it to open the bridge window.
Prefer to drop it in by hand? The per-user extensions directory is
%USERPROFILE%\Cisco Packet Tracer <version>\extensions\cisco-pt-mcp\.
To rebuild after editing extension/source/*.js, use PT's
Extensions → Scripting workflow to re-package the source folder
into a new .pts, then reinstall via the Extensions Manager.
Run
- Launch Packet Tracer; click Extensions → Packet Tracer MCP. The
bridge window opens with status
connectingthenoffline. - Launch your MCP client. It spawns
cisco-pt-mcp.exeas a subprocess; within a second the bridge window flips toconnected. - Ask the model to do something. Tool calls show up in the bridge window's Activity log.
Tools exposed
| Tool | Purpose |
|---|---|
addDevice |
Drop a router/switch/PC on the canvas |
addModule |
Install an interface module in a device slot |
addLink |
Connect two devices with a cable |
removeDevice |
Delete one or more devices |
removeLink |
Delete one or more cables |
configurePcIp |
Set IP / DHCP / gateway / DNS on a PC |
configureIosDevice |
Run IOS CLI commands on a router/switch |
getNetwork |
Snapshot of all devices, interfaces, cables |
getDeviceInfo |
Detail view of a single device |
All tool calls return JSON {success, ...}; errors come back as
{success: false, error: "..."} so the model can recover.
Configuration
| Variable | Default | Meaning |
|---|---|---|
CISCO_PT_MCP_TOOL_TIMEOUT |
60 |
Seconds to wait for a tool result |
CISCO_PT_MCP_LOG_LEVEL |
INFO |
Server log level |
The bridge endpoint is hard-coded to 127.0.0.1:7531 (both ends are
local). To retarget, edit MCP_URL in extension/source/interface/interface.js
and the constants in mcp_server/bridge.py, then rebuild the .pts.
Tests
pip install -e .[dev]
pytest tests\ -v
Offline tests — no Packet Tracer required.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cisco_pt_mcp-0.1.1.tar.gz.
File metadata
- Download URL: cisco_pt_mcp-0.1.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f8816b35355ab323e6bf8610e4fd25b178835f6be11d170b74e3b7fdd7426f
|
|
| MD5 |
1cc3b45f29b9ae6bff306c7ac130c769
|
|
| BLAKE2b-256 |
9496ecad611340462860e0a96ea67f5344e2c786ae9d081e9dd3c5d440debbd8
|
Provenance
The following attestation bundles were made for cisco_pt_mcp-0.1.1.tar.gz:
Publisher:
publish.yml on muhammadbalawal/cisco-pt-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cisco_pt_mcp-0.1.1.tar.gz -
Subject digest:
a0f8816b35355ab323e6bf8610e4fd25b178835f6be11d170b74e3b7fdd7426f - Sigstore transparency entry: 1501400483
- Sigstore integration time:
-
Permalink:
muhammadbalawal/cisco-pt-mcp@2cbcc5dccb8c7a84e28503f2da12e829f1165ddc -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/muhammadbalawal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cbcc5dccb8c7a84e28503f2da12e829f1165ddc -
Trigger Event:
push
-
Statement type:
File details
Details for the file cisco_pt_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cisco_pt_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40d232048c84a623338f5a815c71eda2597e1a33a3c23dac1c43e5e95fb56474
|
|
| MD5 |
cb512a151536f34bea926d9bb558db19
|
|
| BLAKE2b-256 |
36ee7f2c9e617d3f0e61fba87bef6710f741d3a2cff6c47765bf00bdd8ee33be
|
Provenance
The following attestation bundles were made for cisco_pt_mcp-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on muhammadbalawal/cisco-pt-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cisco_pt_mcp-0.1.1-py3-none-any.whl -
Subject digest:
40d232048c84a623338f5a815c71eda2597e1a33a3c23dac1c43e5e95fb56474 - Sigstore transparency entry: 1501400584
- Sigstore integration time:
-
Permalink:
muhammadbalawal/cisco-pt-mcp@2cbcc5dccb8c7a84e28503f2da12e829f1165ddc -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/muhammadbalawal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cbcc5dccb8c7a84e28503f2da12e829f1165ddc -
Trigger Event:
push
-
Statement type: