# NetsCLI MCP server

> Lets an AI agent discover network hosts, scan TCP and UDP ports, and query DNS or mDNS records.

- Repository: https://github.com/fstubner/netscli
- Page: https://hostedmcp.org/servers/fstubner/netscli
- Transport: stdio
- Stars: 19
- License: MIT
- Latest version: 0.3.4

## Install

### Claude Code

```sh
claude mcp add netscli -- npx -y netscli
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "netscli": {
      "command": "npx",
      "args": [
        "-y",
        "netscli"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "netscli": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "netscli"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"netscli","type":"stdio","command":"npx","args":["-y","netscli"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "netscli": {
      "command": "npx",
      "args": [
        "-y",
        "netscli"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add netscli -- npx -y netscli
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.netscli]
command = "npx"
args = ["-y", "netscli"]
```

### Gemini CLI

```sh
gemini mcp add -s user netscli npx -- -y netscli
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "netscli": {
      "command": "npx",
      "args": [
        "-y",
        "netscli"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `NETSCLI_MCP_ALLOW_PUBLIC_TARGETS` | no | no | Set to 1 to allow targets outside your own networks. Off by default. |

## FAQ

### What tools are available in the MCP server?

By default, it provides nine tools: discover, scan, ping, DNS, ARP, inspect, sweep, interfaces, and mDNS.

### How do I install NetsCLI on Windows?

You can install the CLI, TUI, and MCP server using winget install netscli, or the desktop app using winget install netscli-gui.

### Can I use NetsCLI without installing it first?

Yes, you can use npx to run the server by setting the command to npx and the args to -y netscli serve.
