loading…
Search for a command to run...
loading…
Enables interaction with Cisco NX-OS devices by executing CLI commands via the NX-API interface. It supports concurrent multi-device operations, batch command e
Enables interaction with Cisco NX-OS devices by executing CLI commands via the NX-API interface. It supports concurrent multi-device operations, batch command execution, and provides responses in both text and structured JSON formats.
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).
feature nxapi)feature nxapi)# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# With uv and pyproject.toml (recommended)
uv sync
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!
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.
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:
/absolute/path/to/nxos-cli-mcp (or C:\absolute\path\to\nxos-cli-mcp) with the actual full path to your project directory.env file with your credentials is in the project directory.env file when started by the MCP clientExecute CLI commands on a single NX-OS device.
Parameters:
ip_address (required): IP address or hostname of the devicecommands (required): List of CLI commands to executeresponse_format (optional): "text" (default, human-readable) or "json" (structured data)username (optional): Username for authenticationpassword (optional): Password for authenticationtimeout (optional): Request timeout in seconds (default: 30)Execute the same CLI commands on multiple NX-OS devices concurrently.
Parameters:
ip_addresses (required): List of device IP addresses or hostnames (max 50)commands (required): List of CLI commands to execute on all devicesresponse_format (optional): "text" (default, human-readable) or "json" (structured data)username (optional): Username for authenticationpassword (optional): Password for authenticationtimeout (optional): Request timeout in seconds per device (default: 30)continue_on_error (optional): Continue executing on other devices if one fails (default: true)Before using this MCP server, ensure NX-API is enabled on your NX-OS devices:
configure terminal
feature nxapi
nxapi http port 80
nxapi https port 443
Verify NX-API is running:
show nxapi
.env file, never commit the file to version control.env has restricted permissions (chmod 600 .env on Unix systems)All commands are sent to NX-OS devices as text using the cli_show_ascii API type. This ensures consistent behavior with the CLI experience you're familiar with.
text (default): Plain text output, identical to what you see in a CLI session
json: Structured JSON response with detailed metadata, possibly better for MCP Hosts (experiment)
The server provides detailed error messages for common scenarios:
show nxapiping <device-ip>.env file are correct.env file exists in the project root directory.env file has proper format (no spaces around =)npx @modelcontextprotocol/inspector uv run nxos_cli_mcp.py
This MCP server is provided as-is under the MIT license.
Contributions are welcome! Please ensure:
For issues related to:
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"cisco-nx-os-cli-mcp-server": {
"command": "npx",
"args": []
}
}
}