netdiag-mcp
This server provides authenticated network monitoring and diagnostics via MCP, focused on site health and redundancy analysis.
List every known site.
Get layered health status for a site: circuit, power, core, and access.
List all degraded sites where at least one layer is not fully healthy.
Trace the most likely root-cause layer by walking dependency order (circuit → power → core → access).
Identify redundancy gaps: sites and layers that lack redundancy even when currently healthy.
Every tool call is protected by the governance layer described in the README: authentication, authorization, rate limiting, audit logging, injection defense/quarantine, and supply-chain integrity checks.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@netdiag-mcp Which sites have redundancy gaps?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
netdiag-mcp
A real Model Context Protocol server exposing infrastructure and security tools across ten domains, every one of them behind real cryptographic identity verification, least-privilege access scopes, rate limiting, a tamper-evident audit log, and structural prompt injection defense.
This used to be two repos. One had the governance depth but routed by keyword matching, not a real protocol, nothing could actually connect to it the way an MCP client connects to a real server. The other had the real protocol but none of the governance. Neither was the honest whole story on its own. This is the merge: 20 real MCP tools, all gated by the same governance layer this portfolio's ADRs document in depth, with the network dependency-tracing pattern already in this repo folded in as one of the domains.
All data is fabricated. No real hostnames, IPs, credentials, or vendor names appear anywhere in this repo.
Why this exists
I run infrastructure and security for a real multi-site organization, and I built and led the production version of this pattern before writing about it. This repo is that architecture, rebuilt from scratch with sample data, wired into an actual protocol server instead of a demo script, so it's something a real MCP client can connect to and call, not just something to read.
Related MCP server: AI Network Troubleshooting MCP Server
The 20 tools, by domain
Domain | Tools |
Network monitoring |
|
Ticketing |
|
Identity |
|
Endpoint management |
|
Security alerts |
|
Vulnerability |
|
Certificates |
|
Virtualization |
|
Network AAA |
|
Server management |
|
Governance demo |
|
root_cause is the standout in network monitoring: it doesn't just report what's broken, it walks circuit, power, core, and access in dependency order and identifies the most likely upstream cause, the same redundancy model documented in network-iac-lab.
alerts_with_severity_assessment is the standout in security alerts: it derives a severity signal from an alert's free text without ever returning that text, using the schema-constrained quarantine boundary described below.
request_hard_limit_action always refuses to execute directly. Every consequential action type (isolating an endpoint, disabling an account, rebooting a server, pushing a deployment, and others) is hard-coded to require a two-step, out-of-band confirmation, no matter what any pre-approval manifest says.
The governance layer
Every tool call above passes through _authorize() in netdiag_mcp/server.py before its underlying logic runs:
Authentication.
netdiag_mcp/governance/identity.py: real Ed25519 signature verification over(caller, domain, nonce), checked against a registered public key. Replay protection is persistent, a used nonce is rejected even across a server restart. Keys can be rotated or revoked outright, with no dual-key grace window.Authorization.
netdiag_mcp/governance/access_control.py: five caller identities (a read-only dashboard, a field technician's assistant, a network engineer's assistant, a security analyst's assistant, an admin agent), each with an explicit, checked set of reachable domains. Deny-by-default.Rate limiting.
netdiag_mcp/governance/rate_limit.py: a token bucket per caller, so a runaway loop gets stopped, not just slowed.Audit logging.
netdiag_mcp/governance/audit_log.py: a hash-chained, file-persisted, checkpointed log of every governance decision. Checkpointing catches the one attack plain hash-chaining can't, a full, internally self-consistent rewrite of the entire log.Prompt injection defense.
netdiag_mcp/governance/injection_defense.py: untrusted free text (an alert description, a ticket summary) is stripped to an allowlisted set of fields before it can reach a decision, proven against two worked examples of embedded injection attempts in the sample data.Schema-constrained quarantine.
netdiag_mcp/governance/quarantine.py: for the one case where dropping free text entirely would lose real signal, a classifier reads it but its output is constrained to a small, pre-declared set of values, proven with a test where the classifier itself is deliberately adversarial and still can't get anything past the schema check.netdiag_mcp/governance/model_classifier.pyis a real, working Anthropic API call usable as a drop-in replacement for the default keyword heuristic.Supply chain integrity.
netdiag_mcp/governance/supply_chain_integrity.py: a SHA-256 hash manifest of this repo's own trusted code, checked intosample_data/integrity_baseline.json, detecting modification, deletion, or unauthorized addition after the fact.
Full reasoning for every one of these lives in docs/adr/, ten ADRs, numbered in the order the decisions were actually made, including what each layer still doesn't cover and why.
One deliberate tradeoff, stated plainly
Every tool above takes caller, nonce, and signature_hex as explicit arguments. That's not how most production MCP servers authenticate, official MCP guidance points toward transport-level authentication (OAuth) instead. This repo authenticates at the call level anyway, because the point of this repo is proving the governance layer works, in a way every test and every manual call demonstrates rather than assumes a transport layer handled somewhere this repo can't show. See docs/adr/010-merging-into-one-mcp-server.md for the full reasoning.
Running it
pip install -e ".[dev]"
pytest tests/ -v108 tests: the original network monitoring suite, the full governance layer (identity, access control, rate limiting, audit logging with checkpointing, injection defense, quarantine, secrets, supply chain integrity), and 6 integration tests that call tools through the real MCP protocol layer (server.call_tool), not the underlying Python functions directly, proving the governance wiring holds at the layer a real client would actually hit.
To generate your own demo keypairs (the checked-in sample_data/demo_public_keys.json has public keys only, no private key ever ships in this repo):
python3 scripts/generate_demo_keys.pyTo run the server itself against an MCP client (stdio transport):
python3 -m netdiag_mcp.serverTo call a tool manually, sign a request with a registered private key:
from netdiag_mcp.governance.identity import sign_request, make_nonce
nonce = make_nonce()
signature_hex = sign_request(your_private_key, caller, domain, nonce).hex()
# pass caller, nonce, and signature_hex as the tool's leading argumentsAvailable Tools
5 toolsdegraded_sitesA
List every site with at least one layer not reporting fully healthy.
Inputs: no named parameters. Returns: result
list_sitesA
List every site known to this diagnostics server.
Inputs: no named parameters. Returns: result
redundancy_gapsA
List every (site, layer) pair currently lacking redundancy.
Flags layers that aren't redundant even if their current status is healthy, since a non-redundant healthy layer is one failure away from an outage.
Inputs: no named parameters. Returns: result
root_causeA
Trace the most likely root-cause layer for a site's issues.
Walks circuit, power, core, and access in dependency order and reports the first layer that isn't healthy, since an upstream issue typically explains downstream symptoms rather than being a separate problem. site must exactly match a name returned by list_sites.
Inputs: site (required).
site_healthA
Get the layered health status (circuit, power, core, access) for a site.
site must exactly match a name returned by list_sites.
Inputs: site (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clear, distinct purpose: listing sites, checking health, identifying degraded sites, tracing root causes, and finding redundancy gaps. No overlap or ambiguity.
All tool names use lowercase snake_case consistently, following a predictable and readable pattern. The mix of verb-led and noun-led names is coherent within the domain.
Five tools is well within the typical range and perfectly suited for a network diagnostics server, covering the essential operations without unnecessary bloat.
The tool set provides comprehensive coverage for network diagnostics: listing sites, checking health, surfacing degraded sites, identifying root causes, and flagging redundancy risks. No critical gaps are apparent.
Maintenance
Related MCP Connectors
Network, domain and website diagnostics for AI clients via MCP.
IP intelligence, network diagnostics, and AI service availability tools for AI agents.
Infrastructure context for any AI: VMware, Nutanix, Kubernetes and cloud. Read-only, off production.
Diagnose AI workflows for failure, security, and handoff risks — RED/AMBER/GREEN per node.
Related MCP Servers
- AlicenseAqualityBmaintenanceSD-WAN diagnostics by Jamie Blair. Demarc runs locally and provides read-only access to Cisco Catalyst SD-WAN Manager (vManage). Use 21 MCP tools to check site health, tunnels and alarms, or ask Qwen about a snapshot on your Windows laptop.21Apache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to safely troubleshoot networks through read-only tools for device inventory, interface status, VLAN paths, BGP neighbors, route lookups, and interface error detection. Integrates with Microsoft Copilot Studio and Teams for natural-language-driven network diagnostics.-
- FlicenseAqualityBmaintenanceEnables LLM clients to run structured, bottom-up network diagnostics across OSI Layers 1–3, including Wi-Fi telemetry, ping checks, and runbook-based remediation.7-
- AlicenseAqualityCmaintenanceEnables AI agents to run eleven read-only network checks — interfaces, Wi-Fi signal, IP configuration, ping, traceroute, routing and ARP tables, DNS, port and HTTP probes — and to diagnose faults bottom-up across the network layers, returning the first broken layer with a plain-English explanation and fix.11MIT