Skip to main content
Glama
yangyu2729

console-switch-mcp

by yangyu2729

Console Switch MCP

通过串口 Console 口(RS-232/USB-to-Serial)控制网络交换机的 MCP Server。支持华为、H3C、思科等主流品牌交换机。

功能

Tool

说明

list_ports

列出计算机所有可用串口(COM口)

connect

通过 Console 口连接交换机

send_command

发送单条命令并获取返回结果

send_config

批量发送配置命令

disconnect

断开 Console 连接

get_status

查看当前连接状态

支持的设备

  • 华为 (Huawei) — 自动识别 <Huawei> / [Huawei] 提示符

  • H3C — 自动识别 <H3C> / [H3C] 提示符

  • 思科 (Cisco) — 自动识别 Router> / Router# 提示符

  • 其他支持标准串口 Console 的网络设备

前置条件

  1. 硬件:Console 线(USB 转 RJ45/RS-232),常见芯片:FTDI、CH340、PL2303

  2. 驱动:安装对应 USB 转串口芯片的驱动程序

  3. Node.js:>= 18.0.0

安装

1. 克隆项目

git clone https://github.com/yangyu2729/console-switch-mcp.git
cd console-switch-mcp

2. 安装依赖并构建

npm install
npm run build

3. 配置 MCP

WorkBuddy

编辑 ~/.workbuddy/mcp.json,添加:

{
  "mcpServers": {
    "console-switch-mcp": {
      "command": "node",
      "args": ["/你的路径/console-switch-mcp/build/index.js"],
      "disabled": false
    }
  }
}

Windows 路径示例:C:/Users/你的用户名/console-switch-mcp/build/index.js macOS/Linux 路径示例:/home/你的用户名/console-switch-mcp/build/index.js

Claude Desktop

编辑配置文件:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "console-switch-mcp": {
      "command": "node",
      "args": ["/绝对路径/console-switch-mcp/build/index.js"]
    }
  }
}

配置完成后重启 WorkBuddy / Claude Desktop 即可生效。

使用

在 AI 对话中直接使用自然语言操作:

  • "列出电脑上可用的串口"

  • "用 COM3 连接华为交换机,波特率 9600"

  • "查看交换机版本信息"

  • "查看 VLAN 配置"

  • "进入系统视图,配置端口"

  • "断开连接"

常用华为交换机命令

display version              查看设备版本
display current-configuration 查看当前配置
display vlan                 查看 VLAN 信息
display interface brief      查看接口概要
display arp                  查看 ARP 表
display mac-address          查看 MAC 地址表
display ip routing-table     查看路由表
display cpu-usage            查看 CPU 使用率
display logbuffer            查看日志缓冲
system-view                  进入系统视图
ping 192.168.1.1             测试网络连通性

串口参数

参数

默认值

说明

baudRate

9600

华为/H3C 默认 9600,部分设备用 115200

dataBits

8

数据位

stopBits

1

停止位

parity

none

校验位

项目结构

console-switch-mcp/
├── src/
│   ├── index.ts           # MCP Server 入口
│   └── serial-console.ts  # 串口通信核心模块
├── build/                 # 编译输出
├── package.json
└── tsconfig.json

License

MIT

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/yangyu2729/console-switch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server