SD-WAN MCP Server
Enables monitoring and management of SD-WAN devices through REST API endpoints, with tools for device health, statistics, BFD sessions, and network analytics. Integrates with Cursor IDE for natural language queries.
README
SD-WAN MCP Server
A comprehensive Model Context Protocol (MCP) server for monitoring and managing SD-WAN devices through REST API endpoints. This server exposes SD-WAN device monitoring and management functionality that can be integrated with Cursor and other MCP-compatible tools.
š Features
- š§ Device Management: List and monitor SD-WAN fabric devices
- š Statistics Collection: Interface statistics, device counters, tunnel statistics
- š BFD Monitoring: Bidirectional Forwarding Detection state and sessions
- āļø Configuration Access: Device configuration retrieval
- š Advanced Analytics: Health summaries, traffic analysis, and alerting
- š Session Management: Automatic authentication and session handling
- ā” Async Support: Full async/await support for non-blocking operations
- šÆ Cursor Integration: Seamless integration with Cursor IDE
š Available Tools
Basic Monitoring Tools
- get_fabric_devices - Get list of all SD-WAN fabric devices
- get_device_monitor - Get SD-WAN device monitoring information
- get_device_counters - Get SD-WAN device counters and statistics
- get_interface_statistics - Get interface statistics for all SD-WAN devices
- get_device_config - Get SD-WAN device configuration (requires device_id)
- get_bfd_state - Get BFD state for an SD-WAN device (requires device_id)
- get_bfd_sessions - Get BFD sessions for an SD-WAN device (requires device_id)
- get_tunnel_statistics - Get tunnel statistics for an SD-WAN device (requires device_id)
Authentication Tools
- authenticate - Authenticate with the SD-WAN management server
- get_session_status - Check current authentication session status
Advanced Analytics Tools
- get_device_health_summary - Comprehensive health summary across all SD-WAN devices
- filter_devices_by_status - Filter SD-WAN devices by operational status
- get_top_interfaces_by_traffic - Get top interfaces ranked by traffic utilization
- check_bfd_session_health - Monitor BFD session health across all SD-WAN devices
- generate_network_report - Generate comprehensive SD-WAN network status report
- get_device_alerts - Get alerts and warnings for SD-WAN devices by severity
- monitor_interface_utilization - Monitor interface utilization with configurable thresholds
- get_network_topology - Get SD-WAN network topology information
š ļø Quick Start
Prerequisites
- Python 3.8 or higher
- Access to SD-WAN management server
- Cursor IDE (for integration)
Installation
-
Clone the repository
git clone https://github.com/yourusername/sdwan-mcp-server.git cd sdwan-mcp-server -
Install dependencies
pip install -r requirements.txt -
Configure environment variables
# Copy the example environment file cp .env.example .env # Edit .env with your settings nano .env -
Update configuration
ā ļø IMPORTANT: You must update the IP address in your configuration!
Edit your
.envfile:# REQUIRED: Change this to your SD-WAN management server IP SDWAN_BASE_URL="https://YOUR_SDWAN_SERVER_IP:8443" # Update credentials SDWAN_USERNAME="your_username" SDWAN_PASSWORD="your_password" # Optional settings VERIFY_SSL="false" LOG_LEVEL="INFO" -
Test the server
python test_client.py -
Run the server
python main.py
āļø Configuration
Environment Variables
| Variable | Description | Default | Required |
|---|---|---|---|
SDWAN_BASE_URL |
SD-WAN server base URL | https://192.168.10.130:8443 |
ā YES |
SDWAN_USERNAME |
Authentication username | admin |
ā YES |
SDWAN_PASSWORD |
Authentication password | 1 |
ā YES |
VERIFY_SSL |
Enable SSL certificate verification | false |
No |
LOG_LEVEL |
Logging level (DEBUG, INFO, WARNING, ERROR) | INFO |
No |
SESSION_TIMEOUT |
Session timeout in seconds | 3600 |
No |
AUTO_RECONNECT |
Auto-reconnect on session expiry | true |
No |
Configuration Methods
Method 1: Environment Variables (Recommended)
export SDWAN_BASE_URL="https://your-sdwan-server:8443"
export SDWAN_USERNAME="admin"
export SDWAN_PASSWORD="your_password"
python main.py
Method 2: .env File
# Create .env file
echo "SDWAN_BASE_URL=https://your-sdwan-server:8443" > .env
echo "SDWAN_USERNAME=admin" >> .env
echo "SDWAN_PASSWORD=your_password" >> .env
python main.py
Method 3: Direct Configuration
Edit config.py to change default values (not recommended for production).
š§ Cursor Integration
Option 1: MCP Configuration File
-
Create or update your MCP configuration file:
{ "mcpServers": { "sdwan-mcp-server": { "command": "python", "args": ["/full/path/to/your/project/main.py"], "env": { "SDWAN_BASE_URL": "https://your-sdwan-server:8443", "SDWAN_USERNAME": "admin", "SDWAN_PASSWORD": "your_password" } } } } -
Update the path to point to your
main.pyfile -
Restart Cursor
Option 2: Cursor Settings
Add to your Cursor settings:
{
"mcp": {
"servers": {
"sdwan-mcp-server": {
"command": "python",
"args": ["/full/path/to/main.py"]
}
}
}
}
š” Usage Examples
Once integrated with Cursor, you can use natural language queries:
Basic Queries
- "Show me all SD-WAN fabric devices"
- "Get the SD-WAN interface statistics"
- "Check BFD state for SD-WAN device 200.0.1.1"
- "Get tunnel statistics for SD-WAN device 200.0.2.2"
Advanced Analytics
- "Give me a comprehensive health summary of the SD-WAN network"
- "Show me all SD-WAN devices that are currently down"
- "What are the top 10 interfaces by traffic volume?"
- "Generate a full SD-WAN network report"
- "Which interfaces are using more than 80% bandwidth?"
Troubleshooting
- "Check if I'm authenticated to the SD-WAN server"
- "Show me all critical alerts in the SD-WAN network"
- "What SD-WAN devices need immediate attention?"
šļø Project Structure
sdwan-mcp-server/
āāā main.py # Main MCP server implementation
āāā config.py # Configuration management
āāā test_client.py # Test client for validation
āāā requirements.txt # Python dependencies
āāā setup.py # Package setup
āāā mcp_config.json # MCP configuration template
āāā .env.example # Environment variables template
āāā .gitignore # Git ignore file
āāā LICENSE # MIT license
āāā README.md # This file
š API Endpoints
The server connects to these SD-WAN management API endpoints:
/dataservice/device- Fabric devices/dataservice/device/monitor- Device monitoring/dataservice/device/counters- Device counters/dataservice/statistics/interface- Interface statistics/dataservice/device/config- Device configuration/dataservice/device/bfd/state/device- BFD state/dataservice/device/bfd/sessions- BFD sessions/dataservice/device/tunnel/statistics- Tunnel statistics
š Troubleshooting
Common Issues
-
Connection Errors
# Check if your SD-WAN server is accessible curl -k https://YOUR_SDWAN_SERVER_IP:8443 -
Authentication Errors
# Verify credentials export SDWAN_USERNAME="correct_username" export SDWAN_PASSWORD="correct_password" -
SSL Certificate Issues
# Disable SSL verification for self-signed certificates export VERIFY_SSL="false" -
Import Errors
# Install missing dependencies pip install -r requirements.txt
Debug Mode
Enable detailed logging:
export LOG_LEVEL="DEBUG"
python main.py
Testing Connection
# Test authentication
python -c "
import asyncio
from main import SDWANMCPServer
async def test():
server = SDWANMCPServer()
result = await server._authenticate()
print(result)
asyncio.run(test())
"
š¤ Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
š Acknowledgments
- Built with Model Context Protocol (MCP)
- Designed for Cursor IDE and [CLAUDE DESKTOP]
- SD-WAN management capabilities
ā ļø Remember: Always update the SDWAN_BASE_URL to match your SD-WAN management server's IP address!
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.