MCP Hub
Back to servers

Network Scanner MCP

A comprehensive network monitoring and discovery tool that provides ARP scanning, port/service detection, and cluster health monitoring for AI systems.

Tools
16
Updated
Dec 29, 2025
Validated
Jan 9, 2026

Network Scanner MCP

MCP Python-3.10+ License Part of Agentic System

Network discovery and port scanning for infrastructure mapping.

Part of the Agentic System - a 24/7 autonomous AI framework with persistent memory.

Environmental awareness for the AGI cluster through network device discovery, port scanning, and service detection.

   ╭──────────────────────────────────────╮
   │  PIXEL'S NETWORK AWARENESS           │
   │                                      │
   │  "I can see everything on the        │
   │   network now - all devices,         │
   │   services, and cluster health!"     │
   ╰──────────────────────────────────────╯

Features

Device Discovery

  • ARP Network Scanning: Discover all devices on the local network
  • MAC Vendor Lookup: Identify device manufacturers
  • Hostname Resolution: Resolve device hostnames via reverse DNS
  • Device History: Track when devices first/last appeared
  • Anomaly Detection: Alert when unknown devices join

Port Scanning & Service Detection

  • Port Scanning: Scan specific ports or common service ports
  • Service Fingerprinting: Identify services by port and banner
  • Quick Scan Mode: Fast scan of common ports (22, 80, 443, etc.)
  • Full Port Scan: Comprehensive scan of ports 1-1024
  • Banner Grabbing: Capture service banners for identification

Cluster Monitoring

  • Cluster Node Status: Monitor AGI cluster node connectivity
  • Health Checks: Ping-based reachability testing with latency
  • Alert Daemon: Continuous monitoring with voice and cluster alerts
  • Node Recovery Detection: Alerts when nodes come back online

Alerting

  • Voice Alerts: TTS alerts via edge-tts
  • Node-Chat Integration: Broadcast alerts to cluster nodes
  • Alert History: Persistent alert log with history

Installation

cd ${AGENTIC_SYSTEM_PATH:-/opt/agentic}/mcp-servers/network-scanner-mcp
source ${AGENTIC_SYSTEM_PATH:-/opt/agentic}/.venv/bin/activate

# Install the package
pip install -e .

# For development (includes tests)
pip install -e ".[dev]"

# Install system dependencies (Fedora)
sudo dnf install arp-scan

# For voice alerts (optional)
pip install edge-tts
sudo dnf install mpv

Configuration

MCP Server Configuration

Add to ~/.claude.json:

{
  "mcpServers": {
    "network-scanner": {
      "command": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}/.venv/bin/python",
      "args": ["-m", "network_scanner_mcp.server"],
      "cwd": "${AGENTIC_SYSTEM_PATH:-/opt/agentic}/mcp-servers/network-scanner-mcp/src"
    }
  }
}

Environment Variables

VariableDefaultDescription
NETWORK_SCANNER_DATA_DIR$AGENTIC_SYSTEM_PATH/databases/network-scannerData storage directory
NETWORK_INTERFACEAuto-detectedNetwork interface to use
DEFAULT_SCAN_SUBNETAuto-detectedDefault subnet for scans
LOG_LEVELINFOLogging level
LOG_TO_FILEfalseEnable file logging
CLUSTER_NODES_JSONNoneJSON string of cluster nodes

Alert Daemon Environment Variables

VariableDefaultDescription
SCAN_INTERVAL_SECONDS300Seconds between scans
VOICE_ALERTS_ENABLEDtrueEnable voice alerts
NODE_CHAT_ALERTS_ENABLEDtrueEnable cluster alerts
ALERT_ON_NEW_DEVICEStrueAlert on new device detection
ALERT_ON_CLUSTER_NODE_DOWNtrueAlert when cluster nodes go offline
TTS_VOICEen-IE-EmilyNeuralVoice for TTS alerts
MAX_ALERT_HISTORY1000Maximum alerts to retain

Cluster Nodes Configuration

Create cluster_nodes.json in the data directory:

{
  "192.0.2.146": {
    "name": "orchestrator",
    "role": "orchestrator",
    "type": "cluster_node"
  },
  "192.0.2.196": {
    "name": "builder",
    "role": "builder",
    "type": "cluster_node"
  },
  "192.0.2.233": {
    "name": "researcher",
    "role": "researcher",
    "type": "cluster_node"
  }
}

Or set via environment variable:

export CLUSTER_NODES_JSON='{"192.0.2.146": {"name": "orchestrator", "role": "orchestrator"}}'

MCP Tools

Device Discovery

ToolDescription
scan_network(subnet?, resolve_names?)ARP scan for all devices on subnet
detect_new_devices()Find only new devices since last scan
get_unknown_devices()List unidentified devices

Device Information

ToolDescription
get_device_info(identifier)Details about device (by IP or MAC)
get_device_history(mac?)Historical data for devices
mark_device_known(mac, label, device_type)Label a device as trusted
remove_device_known(mac)Remove device from known list

Network Topology

ToolDescription
get_network_topology()Full topology with categorization

Port Scanning

ToolDescription
scan_device_ports(target, ports?, quick?)Scan ports on specific device
discover_services()Quick scan all devices for services

Cluster Monitoring

ToolDescription
get_cluster_nodes()Status of configured cluster nodes
check_cluster_health()Ping all nodes and report health

Utilities

ToolDescription
ping_device(target, count?)Ping device for reachability
resolve_device_hostname(target)Resolve hostname via DNS
get_scanner_status()Get scanner status and configuration
export_for_security_scan()Export IPs for security-scanner-mcp

Usage Examples

Basic Network Discovery

# Scan the network
scan_network()

# Scan with hostname resolution
scan_network(resolve_names=True)

# Check for new devices
detect_new_devices()

# Find unknown devices
get_unknown_devices()

Device Management

# Mark your phone as known
mark_device_known(
    mac="00:00:00:00:00:63",
    label="Marc's iPhone",
    device_type="trusted"
)

# Get device details
get_device_info("192.0.2.217")
get_device_info("00:00:00:00:00:63")

# View device history
get_device_history()

Port Scanning

# Quick port scan (common ports)
scan_device_ports("192.0.2.217", quick=True)

# Scan specific ports
scan_device_ports("192.0.2.217", ports="22,80,443,8080")

# Full port scan (1-1024)
scan_device_ports("192.0.2.217", ports="all")

# Discover services on all devices
discover_services()

Cluster Monitoring

# Check cluster node status
get_cluster_nodes()

# Full health check with latency
check_cluster_health()

Network Topology

# Get full network topology
topology = get_network_topology()

# Returns categorized lists:
# - cluster_nodes: Configured cluster nodes
# - known_devices: Devices marked as trusted
# - unknown_devices: Unidentified devices

Alert Daemon

The alert daemon provides continuous network monitoring with alerts.

Running the Daemon

# Run directly
python -m network_scanner_mcp.alert_daemon

# Or use the installed script
network-scanner-daemon

Systemd Service

Install as a systemd service:

sudo cp network-scanner-daemon.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable network-scanner-daemon
sudo systemctl start network-scanner-daemon

Check status:

sudo systemctl status network-scanner-daemon
journalctl -u network-scanner-daemon -f

Alert Types

TypeTriggerPriority
new_deviceUnknown device detectedHigh
node_offlineCluster node unreachableCritical
node_recoveredCluster node back onlineNormal

Data Storage

All data is stored in the configured data directory (default: ${AGENTIC_SYSTEM_PATH:-/opt/agentic}/databases/network-scanner/):

FileDescription
device_history.jsonAll discovered devices with metadata
known_devices.jsonDevices marked as known/trusted
cluster_nodes.jsonCluster node configuration
alert_history.jsonAlert log (last 1000 alerts)
pending_alerts.jsonQueued alerts for delivery
server.logMCP server logs (if enabled)
alert_daemon.logAlert daemon logs

Integration

Enhanced Memory MCP

Device discoveries can be stored in enhanced-memory for pattern analysis and learning.

Node-Chat MCP

Alerts are broadcast to cluster nodes via node-chat when enabled.

Security Scanner MCP

Use export_for_security_scan() to get IP lists for vulnerability scanning with security-scanner-mcp.

Development

Running Tests

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=network_scanner_mcp --cov-report=html

# Run specific test file
pytest tests/test_utils.py -v

Code Structure

src/network_scanner_mcp/
├── __init__.py       # Package exports
├── server.py         # MCP server with tools
├── scanner.py        # Scanning functionality
├── alert_daemon.py   # Continuous monitoring daemon
└── utils.py          # Shared utilities

Requirements

  • Python 3.10+
  • Root/sudo access for ARP scanning
  • Network interface access

System Dependencies

  • arp-scan - Required for ARP scanning
  • edge-tts - Optional for voice alerts
  • mpv - Optional for audio playback

Changelog

v0.2.0

  • Added port scanning and service detection
  • Added hostname resolution
  • Implemented proper node-chat integration
  • Refactored with shared utilities module
  • Added comprehensive type hints
  • Added thread-safe device registry
  • Removed unused dependencies
  • Added unit tests
  • Fixed data format inconsistencies
  • Auto-detect network interface

v0.1.0

  • Initial release
  • ARP scanning
  • Device history tracking
  • Basic cluster monitoring
  • Alert daemon

Part of the AGI Agentic System - Environmental Awareness Component

Part of the MCP Ecosystem

This server integrates with other MCP servers for comprehensive AGI capabilities:

ServerPurpose
enhanced-memory-mcp4-tier persistent memory with semantic search
agent-runtime-mcpPersistent task queues and goal decomposition
agi-mcpFull AGI orchestration with 21 tools
cluster-execution-mcpDistributed task routing across nodes
node-chat-mcpInter-node AI communication
ember-mcpProduction-only policy enforcement

See agentic-system-oss for the complete framework.

Reviews

No reviews yet

Sign in to write a review