MDS MCP

MDS MCP

A lightweight MCP server that exposes read-only Cisco MDS NX-OS show commands as tools, allowing LLM clients to inspect SAN fabric in plain language.

Category
访问服务器

README

MDS MCP server

A lightweight FastMCP server that exposes read-only Cisco MDS NX-OS show commands as Model Context Protocol tools. Point it at one or many MDS switches and let an LLM client (VS Code, Claude, a LangChain agent, etc) inspect your SAN fabric in plain language.

  • Read-only & safe — every tool maps to a show command over NX-API (JSON-RPC).
  • Multi-switch — register as many switches as you want; clients pick one per call.
  • Two transportsstdio (one process per client) or http (one shared server).
  • 61 tools covering zoning, device-aliases, FLOGI/FCNS, VSANs, interfaces, transceivers, counters, environment, logging, and inventory.

Requirements

  • Python 3.13+
  • uv
  • Cisco MDS switch(es) with NX-API enabled (feature nxapi)

Configuration

Switches are declared with indexed environment variables. Add more by repeating the block with the next number (gaps are tolerated):

Variable Required Default Description
MCP_TRANSPORT http stdio or http
MCP_HOST 0.0.0.0 HTTP bind address
MCP_PORT 8000 HTTP bind port
MDS_<N>_HOST Switch IP or hostname
MDS_<N>_USERNAME NX-API username
MDS_<N>_PASSWORD NX-API password
MDS_<N>_NAME the host Friendly name used by the switch argument
MDS_<N>_PORT 8443 NX-API HTTPS port
MDS_<N>_VERIFY_SSL false Verify the TLS certificate
MDS_1_NAME=mds-fab-a
MDS_1_HOST=192.0.2.10
MDS_1_USERNAME=admin
MDS_1_PASSWORD=secret

MDS_2_NAME=mds-fab-b
MDS_2_HOST=192.0.2.11
MDS_2_USERNAME=admin
MDS_2_PASSWORD=secret

Copy .env.example to .env and fill it in. On startup the server reads this .env file, so you don't have to export the variables by hand. Variables set in the actual environment (shell, Docker, or an MCP client's env block) take precedence over .env.

Run

Install dependencies once, then start the server:

uv sync                 # create the virtualenv and install dependencies

uv run python main.py   # start the server (defaults to HTTP on http://localhost:8000/mcp)

To use stdio instead of HTTP, set MCP_TRANSPORT=stdio — either in .env (MCP_TRANSPORT=stdio) or inline for a single run:

MCP_TRANSPORT=stdio uv run python main.py

Docker / Podman

Build the image, then run it with your .env providing the switch credentials. The commands below use docker; replace it with podman if you prefer (the syntax is identical):

docker build -t mds-mcp .
docker run --rm -p 8000:8000 --env-file .env mds-mcp   # HTTP on http://localhost:8000/mcp

Using it from a client (Visual Studio Code)

Using Visual Studio Code here for the example, but any LLM client that supports MCP will work more or less the same way.

You register the server in a mcp.json file: .vscode/mcp.json for this workspace only, or your user mcp.json (Command Palette → MCP: Open User Configuration) to use it everywhere. Pick one of the two options below, paste it into that file, then open the Command Palette → MCP: List Serverscisco-mdsStart.

Option A — HTTP

You run the server yourself; VS Code just connects to it.

  1. Configure your switches in .env (see Configuration).
  2. Start the server: uv run python main.py.
  3. Add this to mcp.json:
{
  "servers": {
    "cisco-mds": { "type": "http", "url": "http://localhost:8000/mcp" }
  }
}

Option B — stdio

VS Code launches the process for you. Set cwd to where you cloned the repo so the server finds your .env. The env block below is optional — use it only to set or override variables without an .env file (remember it takes precedence over .env).

{
  "servers": {
    "cisco-mds": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "python", "main.py"],
      "cwd": "/path/to/mds-mcp",
      "env": {
        "MCP_TRANSPORT": "stdio",
        "MDS_1_HOST": "192.0.2.10",
        "MDS_1_USERNAME": "admin",
        "MDS_1_PASSWORD": "secret"
      }
    }
  }
}

Once started, open Copilot Chat and the cisco-mds tools become available to the model.

Usage

Ask the model questions in plain language about your SAN fabric. Examples:

  • "List the configured switches and their software version."
  • "Which zones are active in VSAN 20 on mds-fab-a?"
  • "Show me the FLOGI database on both switches."
  • "List all device aliases and tell me which ones aren't logged in right now."
  • "Resolve pwwn 50:00:00:00:00:00:00:01 to a device alias and show its FCNS entry."
  • "Are there any interfaces with CRC errors or link failures on mds-fab-b?"
  • "Compare the transceiver Rx/Tx power on all fc interfaces and flag anything below -7 dBm."
  • "Which ports are members of port-channel 220, and what's their negotiated speed?"
  • "Show the traffic counters for interface fc1/3 — how much is it sending vs receiving?"
  • "Which interfaces are seeing the most txwait or discarded frames on mds-fab-a?"
  • "Summarize the VSAN membership across both fabrics."
  • "Check the environment and module status — any failed fans, power supplies, or modules?"

Tool catalog

All tools are read-only.

Area Tools
Discovery list_switches
Zoning show_zone, show_zone_active, show_zoneset_active_vsan, show_zone_name, show_zone_vsan, show_zone_name_vsan, show_zone_status, show_zoneset, show_zoneset_active, show_zoneset_name, show_zoneset_vsan, show_zoneset_name_vsan
Device aliases show_device_alias_database, show_device_alias_name, show_device_alias_pwwn
Name server / login show_flogi_database, show_flogi_database_for, show_flogi_database_vsan, show_fcns_database, show_fcns_database_vsan, show_fcns_database_detail
VSANs show_vsan, show_vsan_id, show_vsan_usage, show_vsan_membership, show_vsan_membership_for
Interfaces show_interface_brief, show_interface_brief_for, show_interface_for, show_interface_description, show_interface_description_for, show_interface_bbcredit, show_interface_bbcredit_for, show_interface_transceiver, show_interface_transceiver_for, show_interface_transceiver_detail, show_interface_transceiver_detail_for, show_interface_mgmt, show_running_config_interface_for
Counters show_interface_counters, show_interface_counters_brief, show_interface_counters_for, show_interface_counters_brief_for, show_interface_counters_detailed_for, show_interface_aggregate_counters_for
Port-channels show_port_channel_summary, show_port_channel_usage
System / inventory show_version, show_hardware, show_inventory, show_module, show_module_uptime, show_boot, show_switchname, show_environment, show_cdp_neighbors, show_hosts
Operations show_users, show_accounting_log, show_logging

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选