A comprehensive Model Context Protocol (MCP) server that provides access to essential network operations and infrastructure tools through a standardized interface. - Ping: Test host connectivity with customizable packet count and timeout - Traceroute: Trace network path with configurable max hops - MTR: Monitor network path with real-time statistics - Telnet: Test port connectivity using telnet -
Add this skill
npx mdskills install alpadalar/netops-mcpComprehensive MCP server with excellent tool coverage, clear API documentation, and thorough setup instructions
A comprehensive Model Context Protocol (MCP) server that provides access to essential network operations and infrastructure tools through a standardized interface.
The following tools must be installed on the system:
# Network tools
curl, ping, traceroute, mtr, telnet, nc (netcat)
# DNS tools
nslookup, dig, host
# Network discovery
nmap
# System tools
ss, netstat, arp, arping
# HTTP tools
httpie (optional, for enhanced HTTP testing)
# Clone the repository
git clone https://github.com/alpadalar/NetOpsMCP.git
cd NetOpsMCP
# Install dependencies using uv
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
# Clone the repository
git clone https://github.com/alpadalar/NetOpsMCP.git
cd NetOpsMCP
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -e .
# Build and run with Docker Compose
docker compose up -d
# Or build manually
docker build -t netopsmcp .
docker run -p 8815:8815 netopsmcp
# Using Python directly
python -m netops_mcp.server_http --host 0.0.0.0 --port 8815
# Using Docker
docker compose up -d
# Using the provided script
./start_http_server.sh
# Health check
curl http://localhost:8815/health
# Test system requirements
curl -X POST http://localhost:8815/netops-mcp \
-H "Content-Type: application/json" \
-d '{"method": "check_required_tools", "params": {}}'
# Ping a host
result = ping_host("google.com", count=4, timeout=10)
# Test HTTP endpoint
result = curl_request("https://httpbin.org/get", method="GET")
# DNS lookup
result = nslookup_query("google.com", record_type="A")
# Network scan
result = nmap_scan("192.168.1.1", ports="1-1000", scan_type="basic")
ping_host(host: str, count: int = 4, timeout: int = 10)Test connectivity to a host using ping.
Parameters:
host: Target hostname or IP addresscount: Number of ping packets (default: 4)timeout: Timeout in seconds (default: 10)Returns: Ping statistics and results
traceroute_path(target: str, max_hops: int = 30, timeout: int = 30)Trace network path to a target.
Parameters:
target: Target hostname or IP addressmax_hops: Maximum number of hops (default: 30)timeout: Timeout in seconds (default: 30)Returns: Network path information
mtr_monitor(target: str, count: int = 10, timeout: int = 30)Monitor network path using MTR.
Parameters:
target: Target hostname or IP addresscount: Number of probes (default: 10)timeout: Timeout in seconds (default: 30)Returns: MTR statistics and hop information
curl_request(url: str, method: str = "GET", headers: dict = None, data: dict = None, timeout: int = 30)Execute HTTP request using curl.
Parameters:
url: Target URLmethod: HTTP method (GET, POST, PUT, DELETE, PATCH)headers: HTTP headers dictionarydata: Request data for POST/PUT requeststimeout: Request timeout in secondsReturns: HTTP response and timing information
httpie_request(url: str, method: str = "GET", headers: dict = None, data: dict = None, timeout: int = 30)Execute HTTP request using HTTPie.
Parameters: Same as curl_request
Returns: HTTP response and timing information
nslookup_query(domain: str, record_type: str = "A", server: str = None)Query DNS records using nslookup.
Parameters:
domain: Target domain namerecord_type: DNS record type (A, AAAA, MX, NS, TXT, CNAME)server: Custom DNS server (optional)Returns: DNS query results
dig_query(domain: str, record_type: str = "A", server: str = None)Query DNS records using dig.
Parameters: Same as nslookup_query
Returns: Detailed DNS query results
nmap_scan(target: str, ports: str = None, scan_type: str = "basic", timeout: int = 300)Scan network using nmap.
Parameters:
target: Target hostname, IP, or network rangeports: Port range (e.g., "1-1000", "80,443,8080")scan_type: Scan type (basic, full, stealth)timeout: Scan timeout in secondsReturns: Network scan results
port_scan(target: str, ports: str, timeout: int = 60)Perform targeted port scanning.
Parameters:
target: Target hostname or IP addressports: Port range to scantimeout: Scan timeout in secondsReturns: Port scan results
system_status()Get system status information.
Returns: CPU, memory, and disk usage statistics
ss_connections(state: str = None, protocol: str = None)Show network connections using ss.
Parameters:
state: Filter by connection stateprotocol: Filter by protocolReturns: Network connection information
netstat_connections(state: str = None, protocol: str = None)Show network connections using netstat.
Parameters: Same as ss_connections
Returns: Network connection information
# Using pytest
pytest tests/ -v
# Using uv
uv run pytest tests/ -v
# With coverage
pytest tests/ --cov=src --cov-report=html --cov-report=term-missing
The test suite covers:
To generate coverage reports:
# Generate HTML coverage report
pytest tests/ --cov=src --cov-report=html
# Generate terminal coverage report
pytest tests/ --cov=src --cov-report=term-missing
# Generate both reports
pytest tests/ --cov=src --cov-report=html --cov-report=term-missing
# Server configuration
NETOPS_MCP_HOST=0.0.0.0
NETOPS_MCP_PORT=8815
NETOPS_MCP_LOG_LEVEL=INFO
# Tool timeouts
PING_TIMEOUT=10
TRACEROUTE_TIMEOUT=30
MTR_TIMEOUT=30
CURL_TIMEOUT=30
NMAP_TIMEOUT=300
The server will automatically create a default configuration file from config/config.example.json on first run, or you can create config/config.json manually:
{
"logging": {
"level": "INFO",
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
"file": "logs/netops-mcp.log"
},
"security": {
"allow_privileged_commands": false,
"allowed_hosts": [],
"rate_limit_requests": 100,
"rate_limit_window": 60
},
"network": {
"default_timeout": 30,
"max_scan_timeout": 300,
"allowed_ports": "1-65535"
},
"server": {
"host": "0.0.0.0",
"port": 8815,
"path": "/netops-mcp"
}
}
version: '3.8'
services:
netopsmcp:
build: .
ports:
- "8815:8815"
environment:
- NETOPS_MCP_HOST=0.0.0.0
- NETOPS_MCP_PORT=8815
volumes:
- ./logs:/app/logs
- ./config:/app/config
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8815/health"]
interval: 30s
timeout: 10s
retries: 3
# Build image
docker build -t netopsmcp .
# Run container
docker run -d \
--name netopsmcp \
-p 8815:8815 \
-v $(pwd)/logs:/app/logs \
-v $(pwd)/config:/app/config \
netopsmcp
logs/netops-mcp.log: Main application loglogs/access.log: HTTP access loglogs/error.log: Error log# Check server health
curl http://localhost:8815/health
# Check system requirements
curl -X POST http://localhost:8815/netops-mcp \
-H "Content-Type: application/json" \
-d '{"method": "check_required_tools", "params": {}}'
Generate API Keys:
python scripts/generate_api_key.py -n 2 --config config/config.json
Configure Security (config/config.json):
{
"security": {
"require_auth": true,
"api_keys": ["your-generated-key-here"],
"rate_limit_requests": 100,
"rate_limit_window": 60
}
}
Deploy with Docker Compose:
docker compose up -d
Verify Deployment:
curl http://localhost:8815/health
The server supports API key authentication for secure access:
# Make authenticated request
curl -X POST http://localhost:8815/netops-mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method": "ping_host", "params": {"host": "google.com"}}'
Use a reverse proxy (nginx or Caddy) for HTTPS:
server {
listen 443 ssl http2;
server_name your-domain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:8815;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
GitHub Actions workflows included:
# Clone repository
git clone https://github.com/alpadalar/NetOpsMCP.git
cd NetOpsMCP
# Install development dependencies
uv pip install -e .
# Run tests
pytest tests/ -v
This project is licensed under the MIT License - see the LICENSE file for details.
NetOps MCP - Empowering network operations through standardized tool access.
Install via CLI
npx mdskills install alpadalar/netops-mcpNetOps MCP - Network Operations Tools MCP Server is a free, open-source AI agent skill. A comprehensive Model Context Protocol (MCP) server that provides access to essential network operations and infrastructure tools through a standardized interface. - Ping: Test host connectivity with customizable packet count and timeout - Traceroute: Trace network path with configurable max hops - MTR: Monitor network path with real-time statistics - Telnet: Test port connectivity using telnet -
Install NetOps MCP - Network Operations Tools MCP Server with a single command:
npx mdskills install alpadalar/netops-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
NetOps MCP - Network Operations Tools MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.