DevPort Doctor
Inspects published Docker container port mappings to diagnose port conflicts and Windows-to-WSL connectivity issues.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DevPort Doctor why does localhost:3000 refuse connections, and what process owns that port?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DevPort Doctor
Local-first CLI and MCP toolkit for diagnosing port conflicts, localhost connectivity failures, Docker port mappings, and WSL networking issues.
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.1vs.::1binding 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.
Related MCP server: DevTwin MCP
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 --helpUsage
# 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 mcpExample 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-latestCI).Secondary platform: Linux (verified via
ubuntu-latestCI).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
SystemPID 4) may require elevated privileges; DevPort Doctor reportsAccess denied/UNKNOWNrather than failing.
Development
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest
uv buildContributing & Security
See CONTRIBUTING.md for development workflow and PR guidelines.
See SECURITY.md for vulnerability reporting and security guarantees.
License
Available Tools
5 toolsdiagnose_portC
Run evidence-based diagnostics for a local development host and TCP port.
Inputs: port (required), host, timeout. Returns: object
inspect_docker_portsB
Inspect local Docker daemon availability and running container port mappings.
Inputs: timeout. Returns: object
inspect_portC
Inspect listening processes and IPv4/IPv6 localhost connectivity for a TCP port.
Inputs: port (required), timeout. Returns: object
inspect_wsl_portsC
Inspect Windows Subsystem for Linux (WSL) distros and listening TCP ports.
Inputs: timeout. Returns: object
list_portsB
List listening TCP ports and their owning processes (read-only).
Inputs: port. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct scope: listing ports, inspecting a specific port, diagnosing a port, Docker inspection, and WSL inspection. However, inspect_port and diagnose_port overlap somewhat, since both target a specific TCP port and could be confused when an agent needs deeper troubleshooting.
All tool names use consistent snake_case with a clear verb_noun pattern (list_ports, inspect_port, diagnose_port, inspect_docker_ports, inspect_wsl_ports). The naming is predictable and easy to scan.
Five tools is well-scoped for a focused port and connectivity diagnostics server. Each tool covers a distinct diagnostic surface without excessive fragmentation.
The surface covers general port listing, per-port inspection and diagnosis, Docker, and WSL. Minor gaps exist around deeper process or connection-state inspection, but the core diagnostic workflows are represented.
Maintenance
Related MCP Connectors
Monitors TLS/SSL certificate expiry, DNS resolution, and TCP port status for AI agents.
IP intelligence, network diagnostics, and AI service availability tools for AI agents.
Network diagnostics and liveness evidence for AI agents.
Network, domain and website diagnostics for AI clients via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform real network diagnostics on the local machine, including ping, traceroute, DNS lookups, TLS checks, and more.MIT
- AlicenseAqualityCmaintenanceProvides AI coding agents with structured, evidence-based diagnostics about the local development environment, detecting tech stack, runtime mismatches, dependency state, services, ports, and Git status without exposing secrets or using network calls.10Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to debug local networks in plain language by pinging, sweeping subnets, tracing routes, resolving DNS, scanning ports, inspecting ARP tables and active connections, and checking URL reachability.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to identify which processes are using ports across Windows, macOS, and Linux, inspect process details and trees, find free ports, test TCP reachability, and safely free ports through a two-step confirmed kill that refuses dangerous targets.6MIT