Network Diagnostics MCP
# Network Diagnostics MCP
Let agents inspect interfaces, DNS, reachability, and open TCP ports.



## Tools
| Tool | Description |
| --- | --- |
| `list_interfaces` | Network interfaces with addresses, state, speed, and MTU |
| `get_interface_stats` | Per-interface byte, packet, error, and drop counters |
| `dns_lookup` | Resolve a hostname to IPv4/IPv6 addresses |
| `ping_host` | Send ICMP echo requests and report reachability |
| `check_tcp_port` | Check whether a TCP port is open and measure latency |
## Requirements
- Python 3.10+
- `pip install -e .`
## Install
```bash
git clone https://github.com/Ahmad-1276/network-diagnostics-mcp.git
cd network-diagnostics-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
```
## Run
```bash
network-diagnostics-mcp
# or
python -m network_diagnostics_mcp.server
```
The server speaks the MCP stdio protocol and waits for a client.
## Connect an MCP client
Add this to your client's MCP config (Claude Desktop, Cursor, VS Code, etc.):
```json
{
"mcpServers": {
"network-diagnostics": {
"command": "/absolute/path/to/.venv/bin/network-diagnostics-mcp",
"args": []
}
}
}
```
Use the absolute path to the executable inside your virtual environment. On Windows the path is `.venv\Scripts\network-diagnostics-mcp.exe`.
## Example prompts
- List network interfaces and IP addresses.
- Resolve example.com.
- Can this host reach 1.1.1.1?
- Is port 443 open on github.com?
## Notes
`ping_host` and `check_tcp_port` generate network traffic. Hostnames are validated and commands are executed without a shell. Some networks block ICMP or outbound ports.
## Development
```bash
pip install -e ".[dev]"
pytest -q
```
## License
MIT — see [LICENSE](LICENSE).
TDQS
Scored across 5 tools
Each tool targets a clearly distinct networking task: interface enumeration, interface counters, DNS resolution, ICMP reachability, and TCP port checks. There is little risk of confusing one tool with another.
All names use consistent snake_case and are readable, but the verb pattern is slightly mixed: dns_lookup is noun-oriented while the others use verbs like list, get, ping, and check. This is a minor deviation rather than a systemic issue.
Five tools is well-scoped for a network diagnostics server. Each tool has a clear diagnostic purpose and none feel redundant or extraneous.
The core diagnostic surface is covered: interfaces, stats, DNS, ping, and TCP connectivity. Minor gaps such as traceroute, route table inspection, or UDP checks exist but are not essential for basic troubleshooting.