Cisco NX-OS CLI MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
uv sync
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "NXOS_USERNAME=${NXOS_USERNAME}" -e "NXOS_PASSWORD=${NXOS_PASSWORD}" nxos-mcp -- node "<FULL_PATH_TO_NXOS_MCP>/dist/index.js"

Replace <FULL_PATH_TO_NXOS_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:NXOS_USERNAMENXOS_PASSWORD
README.md

Execute CLI commands on Cisco NX-OS devices via NX-API

Cisco NX-OS CLI MCP Server

A Model Context Protocol (MCP) server that lets you interact with Cisco NX-OS devices. You can send arbitrary CLI commands to one or more switches via their NX-API interface. This server exposes MCP tools for executing commands on one or more devices with comprehensive error handling. The output format can also be selected (text or JSON).

Features

  • Single Device Commands: Execute CLI commands on individual NX-OS switches
  • Multi-Device Commands: Execute the same commands across multiple switches concurrently
  • Text-Based I/O: Commands are sent as text (cli_show_ascii), responses default to text format
  • JSON Option: Optional JSON response format for structured parsing
  • Simple Authentication: Credentials collected from .env file or on a per-request override
  • Error Handling: Clear, actionable error messages
  • Batch Operations: Execute up to 100 commands per request
  • Concurrent Execution: Parallel command execution on multiple devices (up to 50)

Requirements

  • Python 3.10 or higher
  • Cisco NX-OS devices with NX-API enabled (feature nxapi)
  • Network connectivity between the MCP host (Claude Desktop, etc.) to target devices via HTTPS

Installation

Prerequisites

  • Python 3.10 or higher
  • uv - Fast Python package installer (recommended)
  • Cisco NX-OS devices with NX-API enabled (feature nxapi)
  • Network connectivity to target devices via HTTPS

Setup

  1. Install uv (if not already installed):
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. Install dependencies using uv:
# With uv and pyproject.toml (recommended)
uv sync
  1. Set up authentication credentials:

Create a .env file from the template:

cp .env.example .env

Edit .env and add your credentials:

NXOS_USERNAME=admin
NXOS_PASSWORD=your_secure_password

Important: Never commit your production .env file to version control. .gitignore is configured to prevent this but be cautious!

Registering with MCP Hosts

Claude Desktop

macOS:

Edit the Claude Desktop configuration file:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json

Add the NX-OS CLI MCP server to the mcpServers section:

{
  "mcpServers": {
    "nxos-cli": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/nxos-cli-mcp",
        "run",
        "nxos_cli_mcp.py"
      ]
    }
  }
}

Windows:

Edit the Claude Desktop configuration file:

notepad %APPDATA%\Claude\claude_desktop_config.json

Add the NX-OS CLI MCP server to the mcpServers section:

{
  "mcpServers": {
    "nxos-cli": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\absolute\\path\\to\\nxos-cli-mcp",
        "run",
        "nxos_cli_mcp.py"
      ]
    }
  }
}

After saving, restart Claude Desktop for the changes to take effect.

Visual Studio Code

macOS:

Edit the VS Code MCP settings file:

code ~/Library/Application\ Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json

Add the server configuration:

{
  "mcpServers": {
    "nxos-cli": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/nxos-cli-mcp",
        "run",
        "nxos_cli_mcp.py"
      ]
    }
  }
}

Windows:

Edit the VS Code MCP settings file:

notepad %APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json

Add the server configuration:

{
  "mcpServers": {
    "nxos-cli": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\absolute\\path\\to\\nxos-cli-mcp",
        "run",
        "nxos_cli_mcp.py"
      ]
    }
  }
}

After saving, reload the VS Code window (Command/Ctrl + Shift + P → "Developer: Reload Window").

Important Notes:

  • Replace /absolute/path/to/nxos-cli-mcp (or C:\absolute\path\to\nxos-cli-mcp) with the actual full path to your project directory
  • Ensure the .env file with your credentials is in the project directory
  • The server will automatically load credentials from the .env file when started by the MCP client

Available Tools

1. nxos_execute_commands

Execute CLI commands on a single NX-OS device.

Parameters:

  • ip_address (required): IP address or hostname of the device
  • commands (required): List of CLI commands to execute
  • response_format (optional): "text" (default, human-readable) or "json" (structured data)
  • username (optional): Username for authentication
  • password (optional): Password for authentication
  • timeout (optional): Request timeout in seconds (default: 30)
2. nxos_execute_commands_multi

Execute the same CLI commands on multiple NX-OS devices concurrently.

Tools (2)

nxos_execute_commandsExecute CLI commands on a single NX-OS device.
nxos_execute_commands_multiExecute the same CLI commands on multiple NX-OS devices concurrently.

Environment Variables

NXOS_USERNAMErequiredUsername for Cisco NX-OS authentication
NXOS_PASSWORDrequiredPassword for Cisco NX-OS authentication

Configuration

claude_desktop_config.json
{"mcpServers": {"nxos-cli": {"command": "uv", "args": ["--directory", "/absolute/path/to/nxos-cli-mcp", "run", "nxos_cli_mcp.py"]}}}

Try it

Get the interface status for switch 192.168.1.10 using 'show interface status'.
Run 'show version' on all switches in the core-switches list and return the output in JSON format.
Check the routing table on the distribution switch 192.168.1.20.
Execute 'show ip interface brief' on the leaf switches and summarize the down interfaces.

Frequently Asked Questions

What are the key features of Cisco NX-OS CLI?

Execute CLI commands on individual NX-OS switches. Concurrent multi-device command execution. Support for both text and structured JSON response formats. Batch execution of up to 100 commands per request. Comprehensive error handling for network operations.

What can I use Cisco NX-OS CLI for?

Automating routine network health checks across multiple switches. Parsing structured switch configuration data into JSON for reporting. Rapidly deploying or verifying configuration changes across a data center fabric. Troubleshooting connectivity issues by running diagnostic commands concurrently.

How do I install Cisco NX-OS CLI?

Install Cisco NX-OS CLI by running: uv sync

What MCP clients work with Cisco NX-OS CLI?

Cisco NX-OS CLI works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Cisco NX-OS CLI docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare