Skip to main content
DevPort Doctor Animated Banner

DevPort Doctor

Local-first CLI and MCP toolkit for diagnosing port conflicts, localhost connectivity failures, Docker port mappings, and WSL networking issues.

DevPort Doctor Terminal Demo

Why DevPort Doctor?

Most port utilities only kill processes (killport, kill-port) or print raw socket tables (netstat, lsof). DevPort Doctor performs read-only, evidence-based diagnostics across your local stack:

  • Process & Port Inspection — List listening TCP ports, owning processes, and PIDs (psutil) while gracefully handling permission-restricted system sockets.
  • IPv4 vs. IPv6 Diagnostics — Detect occupied ports, connection refusals, timeouts, and 127.0.0.1 vs. ::1 binding mismatches (socket).
  • Docker & WSL Awareness — Inspect published vs. unpublished container ports and Windows-to-WSL listening sockets (subprocess, shell=False).
  • Multiple Output Formats — Rich terminal reports, structured JSON (--format json), and sanitized Markdown exports (--format markdown) with automatic home-path and credential redaction.
  • MCP Integration — Expose read-only diagnostic tools to AI coding agents over stdio (devport mcp) with zero external APIs.

Installation

# Install globally as a CLI tool (once published to PyPI)
uv tool install devport-doctor

# Or run from source
git clone https://github.com/jeromeprince777/DevPort-Doctor.git
cd DevPort-Doctor
uv sync
uv run devport --help

Usage

# Show version and help
devport --version
devport --help

# List all listening TCP ports (or filter by port)
devport list
devport list --port 3000

# Inspect a port's listeners and IPv4/IPv6 reachability
devport inspect 3000

# Run full evidence-based diagnostics
devport doctor 3000
devport doctor 3000 --host localhost
devport doctor 3000 --format json
devport doctor 3000 --format markdown

# Inspect Docker containers or WSL distributions
devport docker
devport wsl

# Check a Docker Compose file for port conflicts
devport compose
devport compose path/to/docker-compose.yml

# Continuously monitor a port for state or PID changes
devport watch 3000
devport watch 3000 --interval 1.0 --count 5

# Start the read-only MCP server (stdio)
devport mcp

Example Output

DevPort Doctor v0.1.0

Target: localhost:18789

[PASS] Host resolution
       ::1
       127.0.0.1
[WARN] TCP connection
       127.0.0.1:18789 (IPv4) -> OPEN
       ::1:18789 (IPv6) -> REFUSED
[PASS] Listening process
       127.0.0.1:18789 (IPv4) PID=23916 process=node.exe
[SKIP] Docker diagnostics
       Docker CLI was not found on PATH.
[SKIP] WSL diagnostics
       WSL is installed, but no Linux distributions are configured.

Likely cause:
Service is reachable on 127.0.0.1 (IPv4) only; ::1 (IPv6) failed (IPv4/IPv6 binding mismatch).

Recommendation:
Configure the server to bind to all interfaces (0.0.0.0 or ::), or connect explicitly via 127.0.0.1:18789.

MCP Server Configuration

Add DevPort Doctor to your MCP client configuration (e.g., Antigravity, Claude Desktop, or Cursor):

{
  "mcpServers": {
    "devport-doctor": {
      "command": "devport",
      "args": ["mcp"]
    }
  }
}

Exposed read-only tools: list_ports, inspect_port, diagnose_port, inspect_docker_ports, and inspect_wsl_ports.

Architecture

flowchart TD
    A[CLI Interface] --> C[Diagnostic Engine]
    B[MCP Server] --> C
    C --> D[Port Inspector]
    C --> E[Connectivity Tester]
    C --> F[Docker Inspector]
    C --> G[WSL Inspector]
    D --> H[Diagnostic Rules]
    E --> H
    F --> H
    G --> H
    H --> I[Structured Results]
    I --> J[Rich Terminal Output]
    I --> K[JSON / Markdown Reports]

See docs/architecture.md, docs/requirements.md, and ADR 0001 for design details.

Supported Platforms & Known Limitations

  • Primary platform: Windows 11 (verified locally + windows-latest CI).
  • Secondary platform: Linux (verified via ubuntu-latest CI).
  • macOS: Not yet tested or officially supported.
  • Docker & WSL: Verified via unit tests with mocked command output and graceful fallback checks on Windows; live container/distro integration depends on local Docker Desktop / WSL2 setup.
  • Permissions: Inspecting system-owned sockets (e.g., Windows System PID 4) may require elevated privileges; DevPort Doctor reports Access denied / UNKNOWN rather than failing.

Development

uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest
uv build

Contributing & Security

  • See CONTRIBUTING.md for development workflow and PR guidelines.
  • See SECURITY.md for vulnerability reporting and security guarantees.

License

MIT

Metadata

Release files for devport-doctor 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devport-doctor 0.2.0
File Size Uploaded Provenance Actions
devport_doctor-0.2.0.tar.gz 147.6 kB Without provenance Details for devport_doctor-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for devport-doctor 0.2.0
File Interpreter ABI Platform Actions
devport_doctor-0.2.0-py3-none-any.whl Python 3 none any Details for devport_doctor-0.2.0-py3-none-any.whl

Total release size: 177.7 kB

Release files / devport_doctor-0.2.0.tar.gz

Download URL devport_doctor-0.2.0.tar.gz
Size 147.6 kB
Tags Source
SHA-256 checksum
How to use checksums
55eb247016ba905fcb4cb8ac4579f75cda2a75acfa8a306bb0b86d4e8a29666a
BLAKE2b-256 checksum
How to use checksums
c09c6444f273459bb5f83a7f9e0f5970889f955e026c6895ffe8c4c2b8316ee4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / devport_doctor-0.2.0-py3-none-any.whl

Download URL devport_doctor-0.2.0-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
909d4dc5e0ea90a2af92062aa657ec99c2282699f729b5a86905b333e45b6881
BLAKE2b-256 checksum
How to use checksums
d9313fc3221452cf39dadda754c4b30962f5389ad4fc3508141f0249cede89d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for devport-doctor 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page