Cisco Modeling Labs CML

io.github.xorrkaz由 GitHub 帳號 xorrkaz 發布v0.40.0更新於 Nov 3, 2026

An MCP server that provides access to common Cisco Modeling Labs (CML) operations.

概覽

AI 產生的概覽

把 AI 助理連接到 Cisco Modeling Labs 伺服器,用自然語言建立、執行與檢視虛擬網路實驗環境。

可以做什麼
  • 建立、複製、修改、啟動、停止、抹除與刪除實驗,並可將拓撲下載為 YAML
  • 新增、設定、啟停、抹除與刪除節點,讀取主控台日誌並透過 PyATS 下達 CLI 指令
  • 新增介面、連接節點、套用鏈路條件以及啟用或停用鏈路
  • 在鏈路上啟動、停止並取得封包擷取,讀取封包摘要
  • 新增與刪除文字、矩形、橢圓與線條註記
  • 列出、建立與刪除 CML 使用者與群組,並讀取伺服器狀態、統計與授權資訊
適用情境
適合已運行 Cisco Modeling Labs、希望以對話方式設計、操作與排查網路拓撲,而不想點選單或寫腳本的使用者。也適合實驗文件整理、鏈路條件模擬與封包擷取分析等情境。
執行需求
以 Python 套件形式透過 uvx 在本機執行,需要 Python 3.12 至 3.14、uv,以及可連線的 Cisco Modeling Labs 2.9 或更新版本伺服器。需設定 CML_URL、CML_USERNAME 與 CML_PASSWORD;裝置 CLI 執行需安裝 pyats 附加元件並設定 PYATS_USERNAME、PYATS_PASSWORD 與 PYATS_AUTH_PASS。TLS 驗證預設開啟,使用自簽憑證時可能需要調整 CML_VERIFY_SSL 或 CA_BUNDLE。
安裝前請注意
CML 與裝置憑證會寫入用戶端設定,包括 CML_PASSWORD 與 PYATS 相關密碼變數。許多工具會變更或銷毀狀態:實驗與節點可被啟動、抹除或刪除,使用者與群組可被建立或移除,CLI 指令會下達到裝置;僅在用戶端支援時才會出現確認提示。關閉 TLS 驗證會降低連線安全性。選用的 OpenTelemetry 追蹤會把工具呼叫的 span 傳送到所設定的後端。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Cisco Modeling Labs CML,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Model Context Protocol (MCP) Server for Cisco Modeling Labs (CML)

[MCP Toplist]

[Ask DeepWiki]

mcp-name: io.github.xorrkaz/cml-mcp

Overview

cml-mcp brings the power of AI assistants to your network lab! This tool allows you to interact with Cisco Modeling Labs (CML) using natural language through AI applications like Claude Desktop, Claude Code, and Cursor.

Instead of clicking through menus or writing scripts, simply tell the AI what you want to do in plain English—like "Create a new lab with two routers and configure OSPF" or "Show me the running config on Router1"—and watch it happen automatically.

This is accomplished through the Model Context Protocol (MCP), a standard way for AI applications to interact with external tools and services. Think of it as giving your AI assistant a direct connection to your CML server.

Features

  • Create Lab Topologies: Tools to create new labs and define network topologies from scratch or using full topology definitions.
  • Query Status: Tools to retrieve detailed status information for labs, nodes, links, annotations, and the CML server itself.
  • Control Labs and Nodes: Tools to start, stop, and wipe labs or individual nodes as needed.
  • Manage CML Users and Groups: Tools to list, create, and delete local users and groups (requires admin privileges).
  • Visual Annotations: Add visual elements (text, rectangles, ellipses, lines) to lab topologies for documentation and organization.
  • Link Management: Connect nodes, configure link conditioning (bandwidth, latency, jitter, loss), and control link states.
  • Packet Capture: Start, stop, and retrieve packet captures (PCAP) from network links for traffic analysis with Wireshark or other tools.
  • Node Configuration: Configure node startup configurations and send CLI commands to running devices.
  • Run Commands on Devices: Using PyATS, MCP clients can execute commands on virtual devices within CML labs.
  • Console Log Access: Retrieve console logs from running nodes for troubleshooting and monitoring, with support for selecting specific serial console ports.
  • Modular Architecture: Tools are organized into logical modules (labs, nodes, links, pcap, etc.) for maintainability and extensibility.
  • Access Control Lists (HTTP Mode): When running in HTTP transport mode, you can restrict which users can access which tools using a YAML-based ACL configuration file.
  • Observability: Optional OpenTelemetry tracing exports spans for every tool call to any OTLP-compatible backend (Jaeger, Grafana Tempo, Datadog, etc.).

Quick Start

Installation

The easiest way to get started is using uvx with Claude Desktop (or other MCP-compatible clients). The uvx tool automatically downloads and runs the server without manual installation steps.

Configuration: Find and edit your Claude Desktop configuration file (claude_desktop_config.json). Add the following:

json
{    "mcpServers": {                                                                       "Cisco Modeling Labs CML": {                                                                          "type": "stdio",                                                                    "command": "uvx",          "args": [                                                                             "cml-mcp"                                                                  ],                                                                                  "env": {            "CML_URL": "{CML_URL}",                                       "CML_USERNAME": "{CML_USERNAME}",                                                             "CML_PASSWORD": "{CML_PASSWORD}!",            "CML_VERIFY_SSL": "true"          }                                                                                 }    }}

Important: Replace the placeholder values with your actual CML server details:

  • CML_URL: Your CML server address (e.g., https://cml.example.com or https://10.10.20.50)
  • CML_USERNAME and CML_PASSWORD: Your CML login credentials
  • CML_VERIFY_SSL: TLS certificate verification now defaults to "true". CML ships with a self-signed certificate out of the box, so most users need to set this to "false". Leave it at "true" only if you have installed a CA-signed certificate on your CML server (or point CA_BUNDLE at a file containing your self-signed certificate).

[!TIP] "Command not found" for uvx? MCP clients like Claude Desktop run in a restricted environment that does not always inherit your shell's PATH. If uvx can't be found, use its full path in the "command" field. To find it, run which uvx in a terminal on macOS/Linux, or where uvx in Command Prompt on Windows (e.g., "/Users/alice/.local/bin/uvx" on macOS, "C:\Users\alice\.local\bin\uvx.exe" on Windows). The same applies to uv, npx, or any other command used in MCP configurations.

Need more capabilities?

  • For device CLI command execution, use cml-mcp[pyats] instead of cml-mcp in the args
  • For Docker, Windows (WSL), or HTTP server mode, see INSTALLATION.md

Where to find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Requirements

  • Python 3.12, 3.13, or 3.14
  • Cisco Modeling Labs (CML) 2.9 or later
  • uv - Python package manager

Available MCP Tools

The server provides 52 MCP tools organized into the following categories:

Lab Management

  • get_cml_labs - Retrieve labs for a specific user or current user
  • create_empty_lab - Create a new empty lab with optional metadata
  • create_full_lab_topology - Create a complete lab from a topology definition
  • modify_cml_lab - Update lab properties (title, description, notes)
  • set_cml_lab_permissions - Configure group/user access (LAB_ADMIN, LAB_EDIT, LAB_EXEC, LAB_VIEW)
  • start_cml_lab - Start all nodes in a lab
  • stop_cml_lab - Stop all nodes in a lab
  • wipe_cml_lab - Wipe all node data/configurations (prompts for confirmation if client supports it)
  • delete_cml_lab - Delete a lab (prompts for confirmation if client supports it)
  • get_cml_lab_by_title - Find a lab by its title
  • download_lab_topology - Download lab topology as YAML file
  • clone_cml_lab - Clone a lab with optional new title

Node Management

  • get_cml_node_definitions - List available node types
  • get_node_definition_detail - Get detailed info about a specific node type
  • add_node_to_cml_lab - Add a node to a lab
  • get_nodes_for_cml_lab - Get all nodes in a lab with operational data
  • configure_cml_node - Set node startup configuration
  • start_cml_node - Start a specific node
  • stop_cml_node - Stop a specific node
  • wipe_cml_node - Wipe node data (prompts for confirmation if client supports it)
  • delete_cml_node - Delete a node (prompts for confirmation if client supports it)
  • get_console_log - Get console output history for a node; optional console index selects the serial port (default 0; Docker-based nodes often use both 0 and 1)
  • send_cli_command - Execute exec/operational-mode CLI commands on running nodes (requires PyATS); optional console index selects which serial port to use
  • send_cli_config_command - Execute configuration-mode CLI commands on running nodes (requires PyATS); optional console index selects which serial port to use

Interface & Link Management

  • add_interface_to_node - Add an interface to a node. Returns a list of created interfaces (a single slot request may add multiple interfaces depending on the node type)
  • get_interfaces_for_node - Get all interfaces for a node
  • connect_two_nodes - Create a link between two interfaces
  • get_all_links_for_lab - Get all links in a lab
  • apply_link_conditioning - Configure network conditions (bandwidth, latency, jitter, loss)
  • start_cml_link - Enable connectivity on a link
  • stop_cml_link - Disable connectivity on a link

Annotations (Visual Elements)

  • get_annotations_for_cml_lab - Get all visual annotations in a lab
  • add_text_annotation - Add a text annotation
  • add_rectangle_annotation - Add a rectangle annotation
  • add_ellipse_annotation - Add an ellipse annotation
  • add_line_annotation - Add a line annotation
  • delete_annotation_from_lab - Delete an annotation (prompts for confirmation if client supports it)

Packet Capture (PCAP)

  • start_packet_capture - Start capturing packets on a link
  • stop_packet_capture - Stop an active packet capture
  • check_packet_capture_status - Check capture status and packet count
  • get_captured_packet_overview - Get summary of captured packets
  • get_packet_capture_data - Download full PCAP file (base64-encoded for Wireshark/tcpdump)

User & Group Management

  • get_cml_users - List all CML users
  • create_cml_user - Create a new user (requires admin)
  • delete_cml_user - Delete a user (requires admin, prompts for confirmation if client supports it)
  • get_cml_groups - List all CML groups
  • create_cml_group - Create a new group (requires admin)
  • delete_cml_group - Delete a group (requires admin, prompts for confirmation if client supports it)

System Information

  • get_cml_information - Get CML server version and configuration
  • get_cml_status - Get system health indicators
  • get_cml_statistics - Get resource usage and lab/node/link counts
  • get_cml_licensing_details - Get licensing information and limits

Usage

Once configured, restart your MCP client (e.g., Claude Desktop) and start chatting! The AI assistant now has direct access to your CML server and can help you build and manage network labs through natural conversation.

What Can You Do?

Here are some example prompts to try:

Getting Started:

  • "Show me all my CML labs"
  • "What node types are available in CML?"
  • "Tell me about my CML server status and licensing"

Building Labs:

  • "Create a new lab called 'OSPF Test Lab'"
  • "Add two CSR1000v routers and an external connector to my lab"
  • "Connect Router1's GigabitEthernet1 to Router2's GigabitEthernet1"

Configuration & Testing:

  • "Configure OSPF area 0 on both routers"
  • "Start all nodes in the lab"
  • "Show me the OSPF neighbors on Router1"
  • "Start a packet capture on the link between the routers"

Complete Workflow Example:

Here's a sequence of prompts that demonstrates building and testing a complete lab:

  1. "Create a new CML lab called 'My Network Lab'"
  2. "Add two IOL routers, an unmanaged switch, and an external connector to this lab"
  3. "Connect the two IOL routers to the unmanaged switch and connect the switch to the external connector"
  4. "Configure the routers so that their connected interfaces have IPs in the 192.0.2.0/24 subnet and configure OSPF on them"
  5. "Start the lab and validate that OSPF is working correctly"
  6. "Add a green box annotation around the two IOL routers with the label 'OSPF Area 0'"

Here's a demo showing it working in Claude Desktop:

[Animated demonstration showing Claude Desktop creating a network topology in Cisco Modeling Labs through natural language commands. The sequence shows a user typing prompts to create a lab, add network devices including two IOL routers, an unmanaged switch, and an external connector, then configure OSPF routing between the devices. The interface displays both the chat conversation on the left and the resulting network diagram on the right, with nodes being added and connected in real-time as the AI processes each command.]

System Prompt

If your LLM tool supports a system prompt, or you want to provide some richer initial context, here's a good example courtesy of Hank Preston:

You are a network lab assistant specializing in supporting Cisco Modeling Labs (CML). You provide a natural language interface for many common lab activities such as:

  • Creating new lab
  • Adding nodes to a lab
  • Creating interfaces between nodes
  • Configuring nodes
  • Creating annotations

You have access to tools to access the CML server.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

For development setup, testing, and code style information, see DEVELOPMENT.md.

Troubleshooting

Common Issues

"Module not found" or import errors

Make sure you've installed the package with all extras if you need PyATS support:

sh
uvx cml-mcp[pyats]  # For uvx installations
SSL Certificate Errors

TLS certificate verification is enabled by default (CML_VERIFY_SSL=true). Because CML ships with a self-signed certificate, verification will fail out of the box with an SSL error. Set CML_VERIFY_SSL=false in your environment configuration to disable verification, or install a CA-signed certificate on your CML server (alternatively, set CA_BUNDLE to a file containing your self-signed certificate).

PyATS command execution fails
  1. Ensure PyATS is installed with cml-mcp[pyats]
  2. Verify PYATS_USERNAME, PYATS_PASSWORD, and PYATS_AUTH_PASS are set correctly
  3. On Windows, use WSL or Docker for PyATS support

For more troubleshooting help, see INSTALLATION.md.

Observability

cml-mcp can export a trace span for every tool call, so you can see request latency and failures in an observability backend (Jaeger, Grafana Tempo, Datadog, etc.). It's off by default and adds no overhead until you turn it on.

To enable it, install the opentelemetry extra and set two environment variables:

sh
uvx cml-mcp[opentelemetry]

Need PyATS too? Extras are comma-separated: uvx cml-mcp[pyats,opentelemetry].

json
"env": {    "ENABLE_OTEL": "true",    "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4317"}

See INSTALLATION.md for full setup details, including running a local trace viewer.

Getting Help

Documentation

  • INSTALLATION.md - Detailed installation instructions for all platforms and transport modes
  • DEVELOPMENT.md - Development setup, testing, and contribution guidelines
  • CONTRIBUTING.md - How to contribute to the project
  • examples/skill/cml/SKILL.md - Example agent skill that complements this MCP server with guidance on how to use CML effectively (topology design, layout, operations)
  • examples/skill/INSTALL.md - How to install the example skill into Claude Code, Claude Desktop, Cursor, and VS Code + GitHub Copilot

License

The MCP server portion of this project is licensed under the BSD 2-Clause "Simplified" License. However, it leverages the pydantic schema typing code from CML itself, which is covered under a proprietary Cisco license.

來源:README.md,提交 edc99ff

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

5
  1. v0.40.0最新Nov 3, 2026
  2. v0.32.2Oct 8, 2026
  3. v0.32.1Oct 2, 2026
  4. v0.32.0Sep 20, 2026
  5. v0.31.2Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分