Skip to main content

Network connectivity checker with DNS, ping, HTTP, and SSL validation

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: pip (recommended)

pip install .
# or system-wide:
sudo pip install .

Option 2: Snap Store (Linux)

sudo snap install netcheck
sudo snap connect netcheck:network-observe   # enables ping & interfaces

Option 3: Debian package (.deb)

sudo dpkg -i netcheck_2.0.0_amd64.deb

Option 4: Chocolatey (Windows)

choco install netcheck

Option 5: macOS .pkg

Double-click the downloaded .pkg file, or:

sudo installer -pkg netcheck-2.0.0.pkg -target /

Option 6: 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.tar.gz (37.0 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-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file netcheckx-2.1.0.tar.gz.

File metadata

  • Download URL: netcheckx-2.1.0.tar.gz
  • Upload date:
  • Size: 37.0 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.tar.gz
Algorithm Hash digest
SHA256 d487795231a6f3398c50c8b133cbe4cde288c7ef45495335d85f4c4ba2fba85f
MD5 0589588cd827dc5585e6bfcefa7d46fb
BLAKE2b-256 075b7fe9ad8a2d0e8fc6d5e1e56d179148ad9a67a35a80d0eefde80a96109374

See more details on using hashes here.

File details

Details for the file netcheckx-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: netcheckx-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.0 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-py3-none-any.whl
Algorithm Hash digest
SHA256 eb24e08bf0b3bf788f7a01a3c8a70e854ed005c8fc720653607dac6c463ccd42
MD5 b849591ded0fb7889a4cf2a24597243f
BLAKE2b-256 535c6653e429c7df58a8fca644b21e2fb578a5cda0392ad37ab47f160b13d1a2

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