More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    PortLock MCP — Socket Broker & Zombie Process Terminator

    1

    Ephemeral Socket Broker & Zombie Process Terminator (EADDRINUSE Eliminator). Prevents AI agents from panicking on occupied dev server ports.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    PortLock MCP — Socket Broker & Zombie Process Terminator

    PortLock MCP — Socket Broker & Zombie Process Terminator

    Example session with this skill installed

    Start our Vite dev server on an open port using PortLock. Check if port 3000 or 5173 is occupied by zombie processes, reclaim it if orphaned, or broker a dynamic non-colliding socket.

    • Read your context and instructions
    • Compiled the portlock mcp

    I have inspected the network sockets using PortLock MCP. An orphaned node zombie process was holding port 3000 from a previous run; PortLock terminated the zombie PID and brokered a guaranteed open socket.

    PortLock Socket Audit & Allocation Report

    <socket_broker status="RESOLVED">
      <collision_detected port="3000" status="OCCUPIED_EADDRINUSE">
    

    Owning PID: 18492 (Orphaned background process from previous test abort)
    Action: Terminated PID 18492 cleanly via task manager. Port 3000 liberated.

      </collision_detected>
      <dynamic_allocation status="RESERVED">
        • Brokered Socket: `127.0.0.1:40200`
    
    • Port Range: 40100 - 40999 (Dynamic ephemeral isolation)
    • Zero Collision Guarantee: Parallel worktrees cannot collide.
    
      </dynamic_allocation>
    </socket_broker>
    

    Socket State Differential

    Port NumberInitial StateOwning Process / PIDAction TakenFinal Status
    3000Occupiednode.exe (PID 18492)KILLED ZOMBIELIBERATED FREE
    5173FreeNoneAvailableAvailable
    40200FreeBroker AllocatedINJECTED FLAGRUNNING SERVER
    
    # Executed Command with Dynamic Socket Injection
    npm run dev -- --port 40200 --host 127.0.0.1
    

    Next Steps

    1. Dev server is running cleanly without EADDRINUSE failure loops.
    2. When the session concludes, PortLock automatically terminates the child server process.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    PortLock eliminates the infamous EADDRINUSE crash loop by brokering non-colliding ephemeral ports and cleanly terminating orphaned background processes holding dev server ports.

    Autonomous coding agents frequently enter circular failure loops when launching dev servers (next dev, vite, uvicorn, flask):

    1. Orphaned Sockets: An earlier command crashed or timed out, but the node/python process remains active in the background bound to port 3000 or 8080.

    2. EADDRINUSE Spiral: The agent sees Error: listen EADDRINUSE: address already in use :::3000, panics, edits application code or package.json, and burns dozens of turns attempting to fix a phantom bug.

    3. Multi-Agent Collision: Two parallel agent worktrees attempt to spin up dev servers on the exact same default port.

    4. Guaranteed Free Port Allocation:

      • Dynamically brokers open ports in non-standard ranges (e.g. 40100–40999) using OS-level ephemeral socket probing.
    5. Port Collision Auditor:

      • Inspects target ports to identify whether they are occupied and discovers the PID and command of the holding process.
    6. Deterministic Zombie Reclaim:

      • Terminates orphaned zombie listeners cleanly via OS-level task management (SIGTERM / taskkill) to liberate blocked ports.
    7. PreToolUse Dev Command Rewriter:

      • Injects allocated free ports directly into dev server startup flags (--port $PORT).
    • allocate_ephemeral_port: Finds and verifies an available non-colliding TCP port.
    • audit_port_collision: Checks if a specific port is in use and identifies the holding PID.
    • reclaim_zombie_socket: Force-terminates orphaned processes holding target ports.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Workflow Automation.

    Terminates orphaned local processes holding ports. Requires standard user permissions (does not terminate system-privileged Windows/Linux services like systemd or svchost).

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 19 days ago

    Software
    terminal

    Permissions

    No special permissions declared or detected

    Listed19 days ago

    What's inside

    Frequently Asked Questions

    Yes! PortLock detects the OS and executes taskkill on Windows or lsof/kill on Linux and macOS.

    New in Workflow Automation