Skip to main content

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)

Version License Platform Python

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, and interfaces subcommands.
  • Structured Output โ€” Every check returns --format text|json|csv|xml.
  • MCP Server โ€” Turns netcheck into 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 cryptography library 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 netcheckx OR netcheck from PyPI, not both (they're the same package with different names). Use netcheckx to 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

netcheckx-2.1.0.1.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netcheckx-2.1.0.1-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

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

Hashes for netcheckx-2.1.0.1.tar.gz
Algorithm Hash digest
SHA256 d0e5ed012bbdbed1bdefb7acd3b9101def9c390801aba0e203aade768b64ed43
MD5 3aa3d887b3e50a3c27c104d7ffecb2f0
BLAKE2b-256 fc71a8c691e92eb64b585aab5110413f60a3944c2917dcfd0a983423839c2f99

See more details on using hashes here.

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

Hashes for netcheckx-2.1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07672ac455a8858cc4cae31ef65cc0633eb941e40dd3fa37ca30b6c554497501
MD5 f86ae417e94b520acb14dc7dfa6a88dc
BLAKE2b-256 a3a8a9a82db9ac1060c6504ca0e53c2ed262ca3f9046d8c305f8cf2ca1e63822

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page