mayanknauni
MCP Servermayanknaunipublic

generative ai cisco mcp

通过自然语言和自动化管理 Cisco 路由器的开源项目。

Repository Info

2
Stars
0
Forks
2
Watchers
0
Issues
Python
Language
MIT License
License

About This Server

通过自然语言和自动化管理 Cisco 路由器的开源项目。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Claude MCP Cisco Demo

Welcome to the Claude MCP Cisco Demo!
This project demonstrates how to use Claude Desktop, the Model Context Protocol (MCP), and Python to manage Cisco routers using natural language and automation.


📚 Table of Contents

  • Overview
  • Architecture
  • Lab Topology
  • Features
  • Getting Started
      1. Requirements
      1. Clone & Set Up
      1. Configure Your Routers
      1. MCP Server Setup
      1. Claude Desktop Integration
      1. Run & Test
  • Usage Examples
  • Security Notes
  • FAQ & Troubleshooting
  • License

Overview

This repo shows how to:

  • Connect Claude Desktop to Cisco routers via the Model Context Protocol (MCP)
  • Run show commands, retrieve configs, and push changes—all via natural language
  • Scale the approach to your entire IT infrastructure

All code and instructions are included.
All scripts and diagrams are open source—see LICENSE.


Architecture

MCP Architecture Flow

!MCP Architecture Flow

  • Claude Desktop: User interacts with AI
  • MCP Client: Bridges Claude with the MCP server
  • MCP Server: Exposes tools/resources, translates requests
  • Netmiko/SSH: Secure connection to Cisco routers
  • Routers: Managed devices

Lab Topology

GNS3 Lab Topology

!GNS3 Topology

  • PC1: Runs Claude Desktop and MCP server
  • R2, R1: Cisco routers (can be real or emulated)
  • Cloud: Simulates WAN/Internet

Features

  • Natural Language Network Management: Use Claude to interact with your routers
  • Python MCP Server: Powered by FastMCP and Netmiko
  • Multi-Device Support: Easily add more routers
  • Secure SSH Automation: All actions over SSH

Getting Started

1. Requirements

  • Python 3.10+
  • Claude Desktop (see Anthropic)
  • Cisco routers (real or GNS3/EVEng)
  • GNS3 (optional, for emulation)
  • SSH enabled on routers

2. Clone & Set Up

git clone https://github.com/mayanknauni/generative-ai-cisco-mcp.git cd claude-mcp-cisco-demo python -m venv venv On Windows:

venv\Scripts\activate On Mac/Linux:

source venv/bin/activate pip install -r requirements.txt

text

3. Configure Your Routers

  • Make sure SSH is enabled and reachable from your desktop.
  • Example Cisco config:

conf t hostname R1 username admin privilege 15 secret Cisco123 ip domain-name lab.local crypto key generate rsa modulus 2048 ip ssh version 2 line vty 0 4 login local transport input ssh end

text

4. MCP Server Setup

  • Edit mcp_server.py and update the router IPs and credentials:

router_manager.add_router("R1", RouterConfig( host="1.1.1.1", # Replace with your router's IP username="admin", password="Cisco123" )) router_manager.add_router("R2", RouterConfig( host="2.2.2.2", username="admin", password="Cisco123" ))

text

5. Claude Desktop Integration

  • Find your Claude Desktop config file (typically %APPDATA%\Claude\claude_desktop_config.json on Windows).
  • Add/replace with:

{ "mcpServers": { "cisco-router-manager": { "command": "C:\Users\youruser\claude-mcp-cisco-demo\venv\Scripts\python.exe", "args": [ "C:\Users\youruser\claude-mcp-cisco-demo\mcp_server.py" ] } } }

text

  • Restart Claude Desktop.

6. Run & Test

  • Start the MCP server manually (for debugging):

python mcp_server.py

text

  • Or let Claude Desktop launch it automatically when you use a tool.

Usage Examples

Show command:

{ "router": "R2", "command": "show ip interface brief" }

text

Config command:

{ "router": "R2", "command": [ "interface GigabitEthernet0/1", "description Configured by MCP", "no shutdown" ] }

text

Use built-in tools:

  • get_config to fetch running config
  • configure_interface to set interface IPs

Security Notes

  • Never commit real device credentials to public repositories.
  • For production, use environment variables or a secrets manager.
  • Restrict SSH access to trusted hosts only.

FAQ & Troubleshooting

  • SSH errors?
    Ensure your router supports modern SSH KEX algorithms or set Netmiko’s kex_algorithms as described in issues.
  • Claude Desktop can’t find the server?
    Double-check your Python path in the config and that dependencies are installed in the right venv.

License

MIT License


All code and diagrams are shared for learning and inspiration. Fork, adapt, and build your own AI-powered network automation!


Demo and documentation by Mayank Nauni


Quick Start

1

Clone the repository

git clone https://github.com/mayanknauni/generative-ai-cisco-mcp
2

Install dependencies

cd generative-ai-cisco-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownermayanknauni
Repogenerative-ai-cisco-mcp
LanguagePython
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation