NetsCLI — Claude Code MCP server: what it does, how to install
Network scanner that lets coding agents discover subnet hosts, inspect TCP and UDP ports, query DNS records, and examine ARP tables.
claude mcp add --env NETSCLI_MCP_ALLOW_PUBLIC_TARGETS=<NETSCLI_MCP_ALLOW_PUBLIC_TARGETS> --transport stdio netscli -- npx -y netscliWhat NetsCLI does
NetsCLI exposes structured network investigation tools directly to language models. Instead of parsing messy terminal output from shell utilities, the assistant receives direct responses from Rust-based routines. The default configuration includes nine operations: host discovery, port scanning, ping checks, DNS lookups, mDNS resolution, network interface inspection, and ARP lookups.
Accessing external endpoints requires setting the NETSCLI_MCP_ALLOW_PUBLIC_TARGETS environment variable. Specific builds compiled with packet capture support provide four extra diagnostic tools. Clients can invoke the service via npx or by launching an installed binary with netscli serve.
What it helps with
- locate active devices across the local subnet
- check open TCP and UDP ports on a given IP
- fetch DNS and mDNS records for a domain
- inspect the system ARP cache with vendor details
Example prompts for the agent
- Scan ports 22, 80, and 443 on host 192.168.1.10.
- Discover all reachable devices on my subnet.
- Inspect example.com to check ping latency and DNS records.
How to install NetsCLI
Platform CLI
claude mcp add --env NETSCLI_MCP_ALLOW_PUBLIC_TARGETS=<NETSCLI_MCP_ALLOW_PUBLIC_TARGETS> --transport stdio netscli -- npx -y netscliReplace <…> with your own values
Platform CLI
codex mcp add netscli --env NETSCLI_MCP_ALLOW_PUBLIC_TARGETS=<NETSCLI_MCP_ALLOW_PUBLIC_TARGETS> -- npx -y netscliReplace <…> with your own values
Config file
{
"mcpServers": {
"netscli": {
"command": "npx",
"args": [
"-y",
"netscli"
],
"env": {
"NETSCLI_MCP_ALLOW_PUBLIC_TARGETS": "<NETSCLI_MCP_ALLOW_PUBLIC_TARGETS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"netscli": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"netscli"
],
"env": {
"NETSCLI_MCP_ALLOW_PUBLIC_TARGETS": "<NETSCLI_MCP_ALLOW_PUBLIC_TARGETS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e NETSCLI_MCP_ALLOW_PUBLIC_TARGETS=<NETSCLI_MCP_ALLOW_PUBLIC_TARGETS> netscli npx -y netscliReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about NetsCLI
How do I install NetsCLI in Claude Code?
Run claude mcp add netscli -- npx -y netscli. If your workflow involves external hosts, pass the environment flag: claude mcp add --env NETSCLI_MCP_ALLOW_PUBLIC_TARGETS=<NETSCLI_MCP_ALLOW_PUBLIC_TARGETS> --transport stdio netscli -- npx -y netscli.
What operations does NetsCLI provide by default?
Out of the box, it gives agents nine tools covering host discovery, port sweeps, ping, DNS, mDNS, ARP cache inspection, and network interface listings. Builds with packet capture enable four extra commands.
Is a local Rust toolchain required to use the MCP server?
No Rust installation is necessary. You can run the server directly on demand using npx within your agent client configuration.