Skip to content

MCP server for AI-powered network infrastructure management. 74 tools for SSH, monitoring, logs, ACI fabric, and wireless control via Claude/Warp.

License

Notifications You must be signed in to change notification settings

angoran/git-netai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NET-AI-ASSISTANT 🌐

Python 3.12+ FastMCP Netmiko MCP Tools Connectors

A comprehensive MCP (Model Context Protocol) server for network infrastructure management. Execute CLI commands on network devices from 150+ vendors, monitor device health and performance, analyze centralized logs, manage data center fabric, and control wireless infrastructureβ€”all through AI assistants like Claude Desktop and Warp.

Key Features:

  • SSH Command Execution: Direct CLI access to routers, switches, and firewalls (Netmiko)
  • Network Monitoring: Real-time device, interface, and sensor monitoring (LibreNMS)
  • Log Management: Centralized log search and analysis (Graylog)
  • Data Center Operations: Cisco ACI fabric management and analytics (APIC)
  • Wireless Management: AP monitoring, client tracking, and RF optimization (Aruba)

🎯 Features

  • Multi-Vendor SSH Support: Works with Cisco, MikroTik, Palo Alto, Juniper, Aruba, HP, and 150+ other vendors
  • Network Monitoring (LibreNMS): Monitor 300+ devices, interfaces, sensors, and events in real-time
  • Log Analytics (Graylog): Search and analyze centralized logs across your infrastructure
  • Data Center Fabric (Cisco APIC): Manage ACI fabric health, topology, and security policies
  • Wireless Control (Aruba): Monitor APs, clients, rogue detection, and RF optimization
  • MCP Integration: Seamlessly integrates with Claude Desktop, Warp AI, and other MCP-compatible tools
  • Auto-Detection: Automatically detects device types or allows manual specification
  • Secure: Credential management via environment variables
  • Fast: Built with UV for lightning-fast dependency management

πŸš€ Quick Start

Prerequisites

  • Python 3.12 or higher
  • UV package manager
  • SSH access to network devices
  • Claude Desktop or Warp (for native MCP integration)

Installation

  1. Clone the repository

    git clone https://github.com/angoran/git-netai.git
    cd git-netai
  2. Sync dependencies with UV

    uv sync
  3. Configure credentials

    Create a .env file in the project root:

    # SSH credentials
    SSH_USERNAME="your_username"
    SSH_PASSWORD="your_password"
    
    # API endpoints and credentials
    LIBRENMS_URL="https://your-librenms-server"
    LIBRENMS_TOKEN="your_api_token"
    
    GRAYLOG_URL="https://your-graylog-server"
    GRAYLOG_TOKEN="your_api_token"
    
    APIC_URL="https://your-apic-server"
    APIC_USERNAME="your_username"
    APIC_PASSWORD="your_password"
    
    ARUBA_URL="https://your-aruba-controller:4343"
    ARUBA_USERNAME="your_username"
    ARUBA_PASSWORD='your_password'  # Use single quotes for special chars

πŸ”§ MCP Client Configuration

Claude Desktop

macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "NET-AI-ASSISTANT": {
      "command": "uv",
      "args": ["--directory", "/path/to/git-netai", "run", "python", "main.py"],
      "env": {"PYTHONPATH": "/path/to/git-netai"}
    }
  }
}

Warp AI

Location: ~/.warp/mcp_config.json

{
  "mcpServers": {
    "NET-AI-ASSISTANT": {
      "command": "uv",
      "args": ["run", "python", "main.py"],
      "env": {"PYTHONPATH": "/path/to/git-netai"},
      "working_directory": "/path/to/git-netai"
    }
  }
}

πŸ“š Usage

The server provides 74 MCP tools organized across 5 categories:

Tool Categories

Category Tools Description
SSH Command Execution 1 Execute CLI commands on 150+ network device types via SSH
Network Monitoring (LibreNMS) 17 Device, interface, sensor monitoring and event tracking
Log Management (Graylog) 4 Centralized log search, streams, and analytics
Data Center Fabric (Cisco APIC) 35 ACI fabric health, tenants, policies, and capacity planning
Wireless Management (Aruba) 17 AP monitoring, client tracking, RF optimization, and QoS

Natural Language Examples (Claude Desktop / Warp)

Execute "show version" on device 10.1.1.1 using cisco_ios
Show me all devices from location "datacenter-1"
Search Graylog for "authentication failure" in the last hour
List all connected clients on the Aruba controller

Python API Examples

from connectors import run_network_command

# Cisco IOS with auto-detection
result = run_network_command(
    ip_address="10.1.1.1",
    command="show version"
)

# Cisco Nexus (explicit device type)
result = run_network_command(
    ip_address="10.1.10.100",
    command="show ip int br",
    device_type="cisco_nxos"
)
from connectors.librenms_con import search_devices

# Search devices by location
devices = search_devices("location", "datacenter-1")
from connectors.graylog_con import search_logs

# Search logs in the last hour
logs = search_logs("error", relative_range=3600)

πŸ›  Supported Device Types

Vendor Device Type Example Command
Cisco IOS cisco_ios show version
Cisco NX-OS cisco_nxos show ip int br
Cisco ASA cisco_asa show firewall
MikroTik mikrotik_routeros /system resource print
Palo Alto paloalto_panos show system info
Juniper juniper_junos show version
Aruba aruba_os show version
HP Comware hp_comware display version

For a complete list of 150+ supported devices, see Netmiko Supported Platforms.


πŸ“ Project Structure

git-netai/
β”œβ”€β”€ main.py                    # MCP server entry point
β”œβ”€β”€ connectors/
β”‚   β”œβ”€β”€ __init__.py           # Package initialization
β”‚   β”œβ”€β”€ ssh_conn.py           # SSH connection module
β”‚   β”œβ”€β”€ librenms_con.py       # LibreNMS API connector
β”‚   β”œβ”€β”€ graylog_con.py        # Graylog API connector
β”‚   β”œβ”€β”€ apic_con.py           # Cisco APIC API connector
β”‚   └── aruba_con.py          # Aruba WiFi Controller API connector
β”œβ”€β”€ .env                       # Credentials (not committed)
β”œβ”€β”€ .gitignore                 # Git ignore rules
β”œβ”€β”€ pyproject.toml             # Project configuration
β”œβ”€β”€ uv.lock                    # UV lock file
β”œβ”€β”€ test_connectors.py         # Connector smoke tests
└── README.md                  # This file

πŸ§ͺ Testing

Quick Tests

Verify server:

uv run python -c "from main import mcp; print('βœ“ Server OK:', mcp.name)"

Test all connectors:

uv run python test_connectors.py

Individual Connector Tests

# SSH Connection
from connectors import run_network_command
result = run_network_command("10.1.1.1", "show version", "cisco_ios")

# LibreNMS
from connectors.librenms_con import search_devices
devices = search_devices("location", "datacenter-1")

# Graylog
from connectors.graylog_con import search_logs
logs = search_logs("error", relative_range=3600)

# Cisco APIC
from connectors.apic_con import get_apic_fabric_health
health = get_apic_fabric_health()

# Aruba
from connectors.aruba_con import ArubaConnector
aruba = ArubaConnector()
info = aruba.get_controller_info()
aruba.logout()

πŸ”’ Security

  • Credentials: Never commit the .env file (already in .gitignore)
  • Production: Use a secrets manager (e.g., HashiCorp Vault, AWS Secrets Manager, 1Password CLI)
  • Network: Ensure SSH connections are properly secured and firewalled
  • Permissions: Use service accounts with minimum required privileges
  • Logging: Disable session logging in production to avoid credential leakage

πŸ› Troubleshooting

Issue Solution
SSH Connection Fails Verify network connectivity with ping, test SSH manually, check .env credentials
Server Not Starting Verify uv --version and python --version (β‰₯3.12), reinstall with uv sync
Auto-detection Fails Specify device type explicitly: run_network_command("10.1.1.1", "show version", "cisco_ios")
Enable Debug Logs Add to connector files: import logging; logging.basicConfig(level=logging.DEBUG)

🀝 Contributing

Contributions are welcome! Fork the repo, create a feature branch, commit your changes, and open a Pull Request.


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • FastMCP - Fast MCP server framework
  • Netmiko - Multi-vendor network device library
  • UV - Lightning-fast Python package manager
  • Anthropic - For the MCP protocol and Claude

πŸ“ž Support


πŸ—ΊοΈ Roadmap

βœ… Completed

  • SSH connector for 150+ network device vendors (Netmiko)
  • LibreNMS API connector - 17 tools for network monitoring
  • Graylog API connector - 4 tools for log management
  • Cisco APIC API connector - 35 tools for data center fabric
  • Aruba WiFi Controller API connector - 17 tools for wireless management

πŸš€ Future Enhancements

  • Integration Cisco NDFC API
  • Integration Cisco DNA API
  • Add more LibreNMS endpoints (alerts, device groups, inventory)
  • Expand Graylog functionality (alert management, dashboards)
  • Add more APIC endpoints (troubleshooting, change management)
  • Expand Aruba capabilities (RF analytics, heat maps)

About

MCP server for AI-powered network infrastructure management. 74 tools for SSH, monitoring, logs, ACI fabric, and wireless control via Claude/Warp.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages