Token导航 LogoToken导航TokenDH.com
S2 Simulator MCP Server logo
运维云端stdio官方级别未说明来源级核验

S2 Simulator MCP Server

MCP Server

S2 Simulator MCP Server是一个多云平台服务器,用于生成网络可观测性指标,支持稳态模拟和异常注入模式,适用于网络测试和故障模拟场景。

工具数

3

提示词数

0

GitHub Stars

0

资源数

0
Python可观测性云端部署

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ARD92

提供方

ARD92

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

S2模拟器MCP服务器

概述

该项目实现了一个MCP(多云平台)服务器,旨在与S2可观测性模拟器进行交互和控制。它允许用户在稳态(基线)模式或异常注入模式下生成网络可观测性度量,模拟各种网络问题。在运行此程序之前,请确保您拥有所有必要的文件。

这是一个学习MCP的实验,因此它不够干净,无法直接调用API,而是依赖于在后台调用另一个工具。但它做它的工作:) 因此,需要事先准备好文件

特性

  • 稳态仿真:生成基线网络可观测性度量。
  • 异常注射:模拟各种网络问题,如CPU峰值、内存峰值、链路故障、BGP切换等。
  • 灵活输入:通过结构化JSON有效载荷或自由格式的命令字符串接受意图。
  • 后台处理:将模拟作为后台进程运行,允许非阻塞操作。
  • 会话管理:停止并监视正在运行的模拟会话。

安装

  1. 克隆存储库 (如果你还没有)。和https://github.com/ARD92/s2-observability-simulator.git这是模拟器工具。
  1. 安装依赖项:服务器依赖于 mcppython-dotenv.
   pip install -r requirements.txt
  1. 确保 generate_all_stats.py 可用的:此服务器需要 generate_all_stats.py 脚本位于由指定的目录中 SCRIPT_DIR (默认值: /root/s2-observability-simulator/).您可能需要调整 SCRIPT_DIRPYTHON_BIN 如果您的设置不同,则使用环境变量。克隆https://github.com/ARD92/s2-observability-simulator.git获取该工具

用法

MCP服务器配置

{
  "mcpServers": {
    "simulator": {
        "command": "npx",
        "args": [
        "mcp-remote",
        "http://192.168.1.10:8050/mcp/",
        "--allow-http"
        ]
    }
  }
}

MCP服务器公开了以下工具:

  • simulator_intent:开始新的模拟。
  • simulator_stop_run:停止正在运行的后台模拟。
  • simulator_status:列出所有跟踪的模拟过程及其状态。

启动MCP服务器

要启动MCP服务器,请运行 main.py:

python main.py

运行模拟

模拟可以使用以下方式启动 simulator_intent 工具。您可以提供结构化的JSON有效负载或自由形式的文本,并允许llm进行解释。

稳态模式

要使用拓扑文件和可选的保证/BPG文件生成稳态指标:

{
    "mode": "steady",
    "topology": "topology.csv",
    "assurance": "assurance.csv",
    "bgp": "bgp.csv",
    "tunnel": "tunnel.csv"
}

异常模式

要注入异常,请设置 mode “异常”并提供 anomaly 有效载荷:

{
    "mode": "anomaly",
    "topology": "topology.csv",
    "assurance": "assurance.csv",
    "bgp": "bgp.csv",
    "anomaly": {"cpuspike": ["nylf01"], "memspike": ["nyag01"], "linkdown": ["nylf01_et-0/0/0"]}
}
use simulator tool with topology=mcp-topology.csv, bgp = mcp-bgp_config.csv, mode=anomaly, anamoly cpuspike for CASPJNP01, memspike for device CASPJNP02, linkdown on CALFJNP02 interface et-0/0/0

If you want to modify existing , use the following prompt

> kill the above session and reinitiate the same with interface et-0/0/4 instead of et-0/0/0

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓  simulator_stop_run (simulator MCP Server) {"payload":{"proc_id":"5db1c996-3d88-48b8-a047-85b2e01c39cb"},"ctx":""}                              │
│                                                                                                                                                   │
│    {                                                                                                                                              │
│      "status": "stopped",                                                                                                                         │
│      "proc_id": "5db1c996-3d88-48b8-a047-85b2e01c39cb",                                                                                           │
│      "stopped": true,                                                                                                                             │
│      "signal": "SIGTERM"                                                                                                                          │
│    }                                                                                                                                              │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓  simulator_intent (simulator MCP Server) {"ctx":"","payload":{"topology":"mcp-topology.csv","mode":"anomaly","bgp":"mcp-bgp_config.csv","anoma… │
│                                                                                                                                                   │
│    {                                                                                                                                              │
│      "status": "spawned",                                                                                                                         │
│      "proc_id": "df5ee7b1-cf7a-4e2b-929d-09a3e66b84ed",                                                                                           │
│      "pid": 1389897                                                                                                                               │
│    }                                                                                                                                              │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The previous simulator session has been stopped. I have re-initiated the simulator with the same anomalies, but with the linkdown on CALFJNP02
  interface et-0/0/4.

异常类型

支持以下异常类型 anomaly 有效载荷:

关键字描述/示例用法
trafficprofile修改给定接口上的流量。
例子: \'trafficprofile\': [\'nylf01_et-0/0/0_50-2-2\']
linkdown标记一个或多个链接。
例子: \'linkdown\': [\'nylf01_et-0/0/0\']
nodedown标记一个或多个节点。
例子: \'nodedown\': [\'nylf01\', \'nyag01\']
intflap启用界面摆动。
例子: \'intflap\': [\'nylf01_et-0/0/0\']
intindisc引入界面输入丢弃或错误。
例子: \'intindisc\': [\'nylf01_et-0/0/0\']
cpuspike模拟给定节点上的CPU利用率峰值。
例子: \'cpuspike\': [\'nylf01\']
memspike模拟给定节点上的内存尖峰。
例子: \'memspike\': [\'nylf01\']
assurance将异常注入保证指标。
例子: \'assurance\': [\'nylf01\']
bgpflap模拟BGP会话翻转事件。
例子: \'bgpflap\': [\'nylf01\']
tundown将一条隧道标记为向下。
例子: \'tundown\': [\'tun01\']
tunflap模拟隧道拍打。
例子: \'tunflap\': [\'tun01\']
intoutdisc引入接口输出丢弃。
例子: \'intoutdisc\': [\'nylf01_et-0/0/0\']
intinerr引入界面输入错误。
例子: \'intinerr\': [\'nylf01_et-0/0/0\']
intouterr引入接口输出错误。
例子: \'intouterr\': [\'nylf01_et-0/0/0\']
ospfflap引入接口输出错误。
例子: \'intouterr\': [\'nylf01_et-0/0/0\']
ospfdown引入接口输出错误。
例子: \'intouterr\': [\'nylf01_et-0/0/0\']

管理会话

停止会话

要停止正在运行的会话,请使用 simulator_stop_run 随着 proc_id 生成命令时获得:

{
    "proc_id": "YOUR_PROCESS_ID"
}

>> > kill all sessions

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓  simulator_stop_run (simulator MCP Server) {"payload":{"proc_id":"38018225-c96b-495a-8f90-cc1bc524c5b6"},"ctx":""}                              │
│                                                                                                                                                   │
│    {                                                                                                                                              │
│      "status": "stopped",                                                                                                                         │
│      "proc_id": "38018225-c96b-495a-8f90-cc1bc524c5b6",                                                                                           │
│      "stopped": true,                                                                                                                             │
│      "signal": "SIGTERM"                                                                                                                          │
│    }                                                                                                                                              │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ All active simulator sessions have been stopped.

查看会话状态

要查看所有活动和已完成的模拟器会话:

{}

(空有效载荷 simulator_status)或使用

>> show all sessions

 Here are all the simulator sessions:

   * Session ID: 5db1c996-3d88-48b8-a047-85b2e01c39cb (Finished)
       * Command: generate_all_stats.py -t mcp-topology.csv -a anomaly -b mcp-bgp_config.csv -av {"memspike": ["CASPJNP02"], "cpuspike": ["CASPJNP01"],
          "linkdown": ["CALFJNP02_et-0/0/0"]}
   * Session ID: df5ee7b1-cf7a-4e2b-929d-09a3e66b84ed (Finished)
       * Command: generate_all_stats.py -t mcp-topology.csv -a anomaly -b mcp-bgp_config.csv -av {"cpuspike": ["CASPJNP01"], "linkdown":
         ["CALFJNP02_et-0/0/4"], "memspike": ["CASPJNP02"]}
   * Session ID: 38018225-c96b-495a-8f90-cc1bc524c5b6 (Running)
       * Command: generate_all_stats.py -t mcp-topology.csv -a anomaly -b mcp-bgp_config.csv -av {"cpuspike": ["CASPJNP01"], "linkdown":
         ["CALFJNP02_et-0/0/1"], "memspike": ["CASPJNP02"]}

回放日志

> use simulator with mode replay , file logs.csv and topology backbone_topology.csv

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ x  simulator_intent (simulator MCP Server) {"ctx":"simulator","payload":{"logfile":"logs.csv","topology":"backbone_topology.csv","mode":"replay"}}                                            │
│                                                                                                                                                                                               │
│    MCP tool 'simulator_intent' reported tool error for function call:                                                                                                                         │
│    {"name":"simulator_intent","args":{"ctx":"simulator","payload":{"logfile":"logs.csv","topology":"backbone_topology.csv","mode":"replay"}}} with response:                                  │
│    [{"functionResponse":{"name":"simulator_intent","response":{"error":{"content":[{"type":"text","text":"Error executing tool simulator_intent: replay_file is required for replay           │
│    mode"}],"isError":true}}}}]                                                                                                                                                                │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I apologize for the error. It seems the correct parameter for the log file in replay mode is replay_file. I will restart the simulator with the correct parameter.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓  simulator_intent (simulator MCP Server) {"ctx":"simulator","payload":{"topology":"backbone_topology.csv","replay_file":"logs.csv","mode":"replay"}}                                        │
│                                                                                                                                                                                               │
│    {                                                                                                                                                                                          │
│      "status": "done",                                                                                                                                                                        │
│      "cmd": [                                                                                                                                                                                 │
│        "/root/mcp-sim/.venv/bin/python3",                                                                                                                                                     │
│        "generate_all_stats.py",                                                                                                                                                               │
│        "-t",                                                                                                                                                                                  │
│        "backbone_topology.csv",                                                                                                                                                               │
│        "-a",                                                                                                                                                                                  │
│        "replay",                                                                                                                                                                              │
│        "-f",                                                                                                                                                                                  │
│        "logs.csv"                                                                                                                                                                             │
│      ],                                                                                                                                                                                       │
│      "returncode": 0,                                                                                                                                                                         │
│      "stdout": "file is logs. sending to logminer\n",                                                                                                                                         │
│      "stderr": ""                                                                                                                                                                             │
│    }                                                                                                                                                                                          │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The simulator has successfully completed the replay mode operation using logs.csv and backbone_topology.csv.

目录标签

目录标签

Python可观测性云端部署网络模拟本地部署异常注入多云平台网络测试

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP