Cisco Switch MCP Server

Cisco Switch MCP Server

Adapter-driven MCP server for Cisco CBS220 switches, Catalyst Center/DNA Center, and Meraki Dashboard, enabling read-only device queries and dry-run write operations via shared Pydantic schemas.

Category
访问服务器

README

Cisco Switch MCP Server

Adapter-driven MCP server for Cisco CBS220 switches, Catalyst Center/DNA Center, and Meraki Dashboard. Callers provide only device_id; the adapter is selected from inventory.yaml.

Status: initial lab/read-only release. Do not enable write operations in production until they pass review and lab validation.

Features

  • CBS220/no-REST-API path: SSH/CLI through Netmiko
  • Catalyst Center and Meraki API adapter structure
  • Shared Pydantic schemas for all adapters
  • Six read-only MCP tools
  • Dry-run and explicit confirmation gate for write tools
  • Per-device SSH concurrency limit
  • Audit logging for write requests

Install

cd "D:\MCP\mcp cisco"
py -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[cli,dev]"
Copy-Item inventory.example.yaml inventory.yaml
$env:PYTHONPATH = "D:\MCP\mcp cisco\src"
$env:INVENTORY_FILE = "D:\MCP\mcp cisco\inventory.yaml"

Configure a real CBS220

Create a dedicated least-privilege account for MCP, enable SSH, and restrict access to the management network. Never commit credentials.

devices:
  - id: cbs220-office
    host: 10.10.10.20
    vendor: cisco
    model: CBS220-48T-4G
    adapter: cli
    cli:
      device_type: cisco_s300
      username_env: SWITCH_USER
      password_env: SWITCH_PASSWORD
      port: 22
      max_sessions: 2

Set credentials only in the process environment:

$env:SWITCH_USER = "mcp-readonly"
$env:SWITCH_PASSWORD = "your-secret"
Test-NetConnection 10.10.10.20 -Port 22
ssh mcp-readonly@10.10.10.20

cisco_s300 is the initial Netmiko driver choice and must be verified with the exact CBS220 firmware in a lab. Change device_type if required.

Test Netmiko before MCP

python -c "from netmiko import ConnectHandler; import os; c=ConnectHandler(device_type='cisco_s300',host='10.10.10.20',username=os.environ['SWITCH_USER'],password=os.environ['SWITCH_PASSWORD'],port=22); print(c.send_command('show system')); c.disconnect()"

The CLI adapter currently uses these CBS220 commands: show system, show interfaces status, show vlan, show mac address-table, show running-config, and show interfaces counters. They are based on the Cisco 220 Series CLI Reference Guide.

Catalyst Center and Meraki

Use the catalyst_center or meraki adapter entries in inventory.example.yaml. Set the API token through the environment variable named by token_env. Update endpoint mappings in adapters.py to match the exact OpenAPI/API version deployed by your organization; the example mappings are intentionally generic and must be validated before production use.

Run the MCP server

python -m cisco_switch_mcp.server

Run the MCP Inspector against a lab only:

npx @modelcontextprotocol/inspector python -m cisco_switch_mcp.server

Read-only tools:

get_device_info(device_id="cbs220-office")
get_interface_status(device_id="cbs220-office")
get_vlan_list(device_id="cbs220-office")
get_mac_address_table(device_id="cbs220-office")
get_running_config(device_id="cbs220-office")
get_interface_stats(device_id="cbs220-office")

Dry-run example:

set_port_vlan({device_id:"cbs220-office", interface:"Gi1", vlan_id:20, dry_run:true})

The v0.1 CLI write path intentionally rejects real apply operations until commands are validated in a lab. Future apply calls must use dry_run=false and confirmation="CONFIRM".

Verification checklist

python -m compileall -q src

Before production:

  1. Test against a lab switch or simulator.
  2. Verify Netmiko driver and command output for the exact firmware.
  3. Add SNMP polling and parser fixture tests.
  4. Align Catalyst Center/Meraki endpoints with official OpenAPI specs.
  5. Use a secret manager and least-privilege accounts.
  6. Apply TLS/certificate and network access policies.
  7. Enable write operations only after code review and change approval.

Evaluation questions

  1. Show model and firmware for cbs220-lab.
  2. Which ports on cbs220-lab are down?
  3. List configured VLANs.
  4. Find MAC 0011.2233.4455.
  5. Retrieve the running config.
  6. Find the interface with the most input errors.
  7. Query the Catalyst Center device inventory.
  8. Show interface status from Catalyst Center.
  9. Query VLANs from Meraki.
  10. Preview changing Gi1/0/10 to VLAN 20 without applying it.

Security

Do not commit .env, inventory.yaml, API keys, passwords, production exports, or raw configs. Review audit logs for sensitive data before forwarding them to an LLM. Use lab devices for all write testing.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选