Network connectivity checker with DNS, ping, HTTP, and SSL validation. (Published as netcheckx on PyPI to avoid naming conflict with legacy netcheck package)
Project description
Network Connectivity Checker (netcheck)
A premium, cross-platform, production-grade Network Intelligence Engine & CLI written in pure Python 3. Overhauled from a legacy Bash tool into a zero-dependency Python engine with high-concurrency diagnostics, lenient target input normalisation, structured output (JSON/CSV/XML), and an integrated Model Context Protocol (MCP) Server for AI assistants.
๐ Key Features
- Zero-Dependency Core โ Built on the Python standard library. No third-party packages required to run.
- Cross-Platform โ Native support for Linux, macOS, and Windows with consistent terminal output.
- Subcommand CLI โ Modular
tcp,dns,http,ssl,ping, andinterfacessubcommands. - Structured Output โ Every check returns
--format text|json|csv|xml. - MCP Server โ Turns
netcheckinto a local tool-server for Claude, ChatGPT, and other AI agents. - Lenient Parsing โ Accepts CSVs, URLs, bracketed IPv6, IP ranges (
192.168.1.1-50), CIDR (10.0.0.0/24), port lists (80,443), and port ranges (8000-8100). - Concurrent Batch Checks โ Configurable thread pools (
--jobs, default 10) with real-time progress. - DNS Caching โ Resolves each host once per run; subsequent checks reuse the cached result.
- IPv6 Dual-Stack TCP โ Tries all resolved IPs (IPv4 + IPv6) until one connects.
- SSL Inspection Fallback โ Uses the
cryptographylibrary to inspect certificate metadata even when strict TLS validation fails.
๐ฆ Installation
Option 1: PyPI (recommended โ easiest)
pip install netcheckx
Note: Package name is
netcheckx(to avoid PyPI conflict), but you can use either command:
netcheck --help # Works
netcheckx --help # Also works (alias)
โ ๏ธ Important: Only install
netcheckxORnetcheckfrom PyPI, not both (they're the same package with different names). Usenetcheckxto get the latest version with full PyPI support.
Option 2: Local pip (development)
pip install .
# or system-wide:
sudo pip install .
Option 3: Snap Store (Linux)
sudo snap install netcheck
sudo snap connect netcheck:network-observe # enables ping & interfaces
Option 4: Debian package (.deb)
sudo dpkg -i netcheck_2.0.0_amd64.deb
Option 5: Chocolatey (Windows)
choco install netcheck
Option 6: macOS .pkg
Double-click the downloaded .pkg file, or:
sudo installer -pkg netcheck-2.0.0.pkg -target /
Option 7: Developer / local run (no install)
# 1. Clone the repo
git clone https://github.com/farman20ali/network_access_check.git
cd network_access_check
# 2. Install dev dependencies
pip install -r python-requirements.txt
# or
pip install -e ".[dev]"
# 3. Run directly
python3 -m netcheck --help
๐ ๏ธ CLI Reference
Subcommands
| Subcommand | Description | Example |
|---|---|---|
tcp |
TCP port reachability | netcheck tcp google.com 80,443 |
dns |
DNS hostname resolution | netcheck dns github.com |
http |
HTTP/HTTPS status + latency | netcheck http https://google.com |
ssl |
SSL certificate inspection | netcheck ssl google.com |
ping |
ICMP ping with RTT stats | netcheck ping 8.8.8.8 |
interfaces |
Active network interfaces + public IP | netcheck interfaces --all |
Global Flags
| Flag | Default | Description |
|---|---|---|
-t, --timeout |
5 |
Connection timeout in seconds |
-j, --jobs |
10 |
Concurrent thread pool size |
-f, --format |
text |
Output format: text, json, csv, xml |
--retry |
1 |
Number of connection attempts |
--retry-delay |
1 |
Delay between retries (seconds) |
-c, --count |
4 |
Ping packet count (ping subcommand only) |
-v, --version |
โ | Print version and exit |
Legacy Flags (kept for backward compatibility)
| Legacy | Equivalent subcommand |
|---|---|
-q, --quick <host> <port> |
netcheck tcp |
-d, --dns <host> |
netcheck dns |
-p, --ping <host> |
netcheck ping |
-s, --status <url> |
netcheck http |
--cert <host> |
netcheck ssl |
--my-ip, -ip |
netcheck interfaces |
๐ค MCP Server
netcheck ships an integrated Model Context Protocol server.
netcheck --mcp
# or
python3 -m netcheck.mcp.server
Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"netcheck": {
"command": "python3",
"args": ["-m", "netcheck.mcp.server"],
"env": { "PYTHONPATH": "/path/to/network_access_check" }
}
}
}
Exposed MCP tools: dns_lookup, ping_host, check_tcp_port, check_http_status, check_ssl_certificate, list_interfaces.
๐๏ธ Building Packages
All packaging is orchestrated by build_packages.py. Templates live in packaging/.
packaging/
โโโ chocolatey/ โ Windows Chocolatey (.nupkg)
โ โโโ tools/
โโโ linux/ โ install.sh / uninstall.sh
โโโ macos/ โ macOS .pkg scripts
โโโ snap/ โ snapcraft.yaml template
โโโ windows/ โ NSIS installer script (.nsi)
Common build commands
# Check available tools on this machine
python3 build_packages.py --check
# Sync a new version across all config files
python3 build_packages.py --sync-version 2.1.0
# Build all packages for the current OS
python3 build_packages.py --all
# Individual targets
python3 build_packages.py --pypi # wheel + sdist
python3 build_packages.py --deb # Debian .deb
python3 build_packages.py --rpm # RPM
python3 build_packages.py --snap # Snap .snap
python3 build_packages.py --linux # standalone binary (PyInstaller)
python3 build_packages.py --win # Windows .exe + NSIS + Chocolatey
python3 build_packages.py --mac # macOS binary + .pkg
All output lands in dist/<target>/.
๐งช Running Tests
# Using Make
make test
# Using pytest directly
python3 -m pytest tests/ -v
# With coverage
python3 -m pytest tests/ --cov=netcheck --cov-report=term-missing
๐ Repository Structure
network_access_check/
โโโ netcheck/ โ Python package
โ โโโ __init__.py โ version string
โ โโโ __main__.py โ python3 -m netcheck entry point
โ โโโ cli.py โ CLI argument parsing & dispatch
โ โโโ mcp/ โ MCP server
โ โโโ modules/ โ dns, tcp, http, ssl, ping, interfaces
โ โโโ utils/ โ formatters, retry, concurrency helpers
โโโ packaging/ โ Platform packaging templates
โ โโโ chocolatey/
โ โโโ linux/
โ โโโ macos/
โ โโโ snap/
โ โโโ windows/
โโโ tests/ โ pytest test suite
โโโ docs/ โ Guides and release notes
โโโ .github/workflows/ โ CI (ci.yml) + Release (release.yml)
โโโ build_packages.py โ Build orchestration script
โโโ pyproject.toml โ Package metadata & build config
โโโ python-requirements.txt โ Local dev setup shortcut
โโโ Makefile โ make install / test / clean
๐ก๏ธ License
Distributed under the GNU General Public License v3 (GPL-3.0). See LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netcheckx-2.1.0.1.tar.gz.
File metadata
- Download URL: netcheckx-2.1.0.1.tar.gz
- Upload date:
- Size: 37.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0e5ed012bbdbed1bdefb7acd3b9101def9c390801aba0e203aade768b64ed43
|
|
| MD5 |
3aa3d887b3e50a3c27c104d7ffecb2f0
|
|
| BLAKE2b-256 |
fc71a8c691e92eb64b585aab5110413f60a3944c2917dcfd0a983423839c2f99
|
File details
Details for the file netcheckx-2.1.0.1-py3-none-any.whl.
File metadata
- Download URL: netcheckx-2.1.0.1-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07672ac455a8858cc4cae31ef65cc0633eb941e40dd3fa37ca30b6c554497501
|
|
| MD5 |
f86ae417e94b520acb14dc7dfa6a88dc
|
|
| BLAKE2b-256 |
a3a8a9a82db9ac1060c6504ca0e53c2ed262ca3f9046d8c305f8cf2ca1e63822
|