feat: Network MCP Server v0.1.0 — SNMP backend with 5 tools

MVP with zero-dependency SNMP backend for AI-powered network management:
- get_snmp_value: query single OID
- walk_snmp_tree: walk OID subtree
- get_device_info: vendor auto-detection, uptime, location
- get_interfaces: interface status with human-readable output
- discover_devices: subnet SNMP discovery

Tech: FastMCP + pysnmp-lextudio, Python 3.10+
Works with: Cisco, Juniper, Arista, UniFi, Fortinet, and any SNMP device
23 tests passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 07:48:18 +10:00
co-authored by Claude Opus 4.6
commit 761bb8c16c
14 changed files with 1155 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
"""Tests for configuration module."""
import os
from network_mcp.config import get_default_community, get_snmp_timeout
def test_default_community_from_env(monkeypatch):
monkeypatch.setenv("SNMP_COMMUNITY", "my_secret")
assert get_default_community() == "my_secret"
def test_default_community_fallback(monkeypatch):
monkeypatch.delenv("SNMP_COMMUNITY", raising=False)
# Without config file, should return "public"
monkeypatch.setenv("NETWORK_MCP_CONFIG_DIR", "/tmp/nonexistent-mcp-test")
assert get_default_community() == "public"
def test_snmp_timeout_from_env(monkeypatch):
monkeypatch.setenv("SNMP_TIMEOUT", "10.0")
assert get_snmp_timeout() == 10.0
def test_snmp_timeout_default(monkeypatch):
monkeypatch.delenv("SNMP_TIMEOUT", raising=False)
assert get_snmp_timeout() == 5.0