cisco-pt-mcp
cisco-pt-mcp 🚀
基于 AI 的 Cisco Packet Tracer 自动化 - 让 AI 客户端通过自然语言控制 Packet Tracer。开源 MCP 服务器,集成 Gemini AI。

✨ 特性
🤖 AI 网络生成 - 用自然语言描述网络,即可得到可运行的拓扑
🎨 可视化构建器界面 - 基于网页的代码编辑器,支持语法高亮
📦 现成模板 - 校园、分公司、VLAN、路由配置
🔌 MCP 协议 - 兼容 Claude Desktop、Cursor 及其他 MCP 客户端
⚡ 实时控制 - 直接桥接正在运行的 Packet Tracer 实例
🛠️ 完整工具集 - 20+ 个工具,用于设备管理、配置和测试
Related MCP server: packet-tracer-mcp
📥 快速安装
1. 安装 MCP 服务器
# Clone or download this repository
cd cisco-pt-mcp
# Install with AI support
pip install -e ".[ai]"
# Configure Gemini API (optional, for AI features)
python setup_config.py2. 安装 Packet Tracer 扩展
打开 Cisco Packet Tracer
Extensions → Scripting → Configure PT Script Modules
点击 Add → 选择
extension/cisco-pt-mcp.pts重新启动 Packet Tracer
3. 启动并连接
# Start the MCP server
python -m mcp_server在 Packet Tracer 中:
点击 Extensions → Packet Tracer MCP
状态应显示 “MCP Connected”
📖 详细说明请参阅 QUICKSTART.md
🎯 使用模式
模式 1:AI 生成器(自然语言)
打开 Packet Tracer 中的 PTBuilder 界面,并使用 AI Generator 标签页:
"Create a corporate network with 1 edge router, 1 core switch,
2 department switches, and 3 PCs per department. Configure VLANs."点击 Generate → 网络就会出现在工作区中!
模式 2:代码编辑器(JavaScript)
直接编写 PTBuilder 代码:
addDevice("R1", "2911", 150, 150);
addDevice("S1", "2960-24TT", 350, 150);
addLink("R1", "GigabitEthernet0/0", "S1", "GigabitEthernet0/1", "straight");
configureIosDevice("R1", "interface Gi0/0\nip address 192.168.1.1 255.255.255.0");模式 3:MCP 客户端(Claude/Cursor)
配置你的 MCP 客户端:
Claude Desktop(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"cisco-pt-mcp": {
"command": "python",
"args": ["-m", "mcp_server"],
"cwd": "/path/to/cisco-pt-mcp",
"env": {
"GEMINI_API_KEY": "your_key_here"
}
}
}
}然后与 Claude 对话:
“创建一个使用 3 台路由器测试 OSPF 路由的网络”
🛠️ 可用工具
AI 驱动工具
工具 | 描述 | 示例 |
| 根据文本生成完整网络 | “创建一个小型办公网络...” |
| 生成 PTBuilder JavaScript 代码 | “为一个由 5 台交换机组成的环网编写代码” |
| 运行 PTBuilder 代码 | 执行自定义/生成的代码 |
| 根据 JSON 规范构建网络 | 导入复杂设计 |
| 打开网页界面 | 访问代码编辑器和模板 |
核心网络工具
工具 | 描述 |
| 添加路由器、交换机、PC 或服务器 |
| 安装接口模块(WIC、NIM 等) |
| 使用线缆连接设备 |
| 删除设备 |
| 移除连接 |
| 重命名设备 |
| 在画布上移动设备 |
| 开启/关闭设备电源 |
配置工具
工具 | 描述 |
| 在 PC 上设置 IP、子网掩码、网关和 DNS |
| 在路由器/交换机上执行 IOS CLI 命令 |
监控与仿真工具
工具 | 描述 |
| 获取所有设备和连接的快照 |
| 获取设备详细信息 |
| 切换仿真/实时模式 |
| 查询仿真状态 |
| 逐步演示数据包传输过程 |
| 发送 PDU(例如 ICMP ping) |
| 读取 PDU 结果 |
| 查看 IOS 命令历史 |
📚 文档
QUICKSTART.md - 5 分钟快速入门
packet-tracer-automation-build-doc.md - 高级自动化技术
🎓 示例
示例 1:使用 AI 创建简单网络
Prompt: "Create a basic network with one 2911 router, one 2960 switch,
and two PCs. Configure the router with IP 192.168.1.1 and the PCs
with static IPs in the same subnet."
Result: Complete working network in 30 seconds示例 2:园区网络模板
从 Templates 标签页加载 “Campus Network” 模板:
三层架构(核心、汇聚、接入)
1 台核心交换机
2 台汇聚交换机
4 台接入交换机
正确的交换机间互连
示例 3:VLAN 配置
// From templates - VLAN setup
addDevice("S1", "2960-24TT", 300, 200);
addDevice("PC1", "PC-PT", 150, 300);
addDevice("PC2", "PC-PT", 450, 300);
configureIosDevice("S1", `
vlan 10
name Sales
vlan 20
name Engineering
interface FastEthernet0/1
switchport mode access
switchport access vlan 10
interface FastEthernet0/2
switchport mode access
switchport access vlan 20
`);🔧 配置
Gemini API 设置
方式一:交互式
python setup_config.py方式二:环境变量
export GEMINI_API_KEY="your_key_here"方式三:配置文件
创建 ~/.cisco-pt-mcp/config.json:
{
"gemini_api_key": "YOUR_KEY_HERE",
"bridge_host": "127.0.0.1",
"bridge_port": 7531,
"tool_timeout": 60
}🏗️ 架构
┌─────────────────┐
│ MCP Client │ (Claude Desktop, Cursor, etc.)
│ (Natural Lang) │
└────────┬────────┘
│ MCP Protocol
┌────────▼────────┐
│ MCP Server │ (Python)
│ + Gemini AI │ - Network generation
│ │ - Code generation
└────────┬────────┘
│ Socket.IO (port 7531)
┌────────▼────────┐
│ PT Extension │ (JavaScript)
│ cisco-pt-mcp │ - PTBuilder integration
│ │ - Web interface
└────────┬────────┘
│ IPC API
┌────────▼────────┐
│ Packet Tracer │ (Cisco Application)
│ Workspace │
└─────────────────┘🤝 参与贡献
欢迎贡献!该项目集成了:
PTBuilder - 用于 PT 的 JavaScript 自动化
Gemini API - AI 网络生成
📄 许可证
MIT License - 请参阅 LICENSE 文件
🙏 致谢
PTBuilder by kimmknight - JavaScript 自动化框架
MCP 协议 - AI 应用通信的标准
Google Gemini - AI 生成能力
原始 cisco-pt-mcp 由 muhammadbalawal 开发
🆘 支持与问题
如果你觉得这个项目有用,请给它点个 Star ⭐!
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceConnects Claude with Cisco Packet Tracer 9.x to control network topologies, configure devices with IOS commands, and run diagnostics via natural language.MIT
- AlicenseNot gradedqualityCmaintenanceEnables control of Cisco Packet Tracer 9.0 via natural language, allowing creation of network topologies, device configuration, and simulation launches through an MCP interface.998MIT
- AlicenseBqualityBmaintenanceEnables automation of Cisco Packet Tracer simulations by placing devices, connecting links, and generating IOS configurations via MCP, ideal for network coursework and demonstrations.231MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control Cisco Packet Tracer in real time, allowing natural language-driven creation and configuration of network topologies.4MIT
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/2001sithum/cisco-pt-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server