- Home
- Skills
- Workflow Automation
- PortLock MCP — Socket Broker & Zombie Process Terminator
More screenshots
Works with the AI Agents you already use
PortLock MCP — Socket Broker & Zombie Process Terminator
Ephemeral Socket Broker & Zombie Process Terminator (EADDRINUSE Eliminator). Prevents AI agents from panicking on occupied dev server ports.
$5
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 Number | Initial State | Owning Process / PID | Action Taken | Final Status |
|---|---|---|---|---|
3000 | Occupied | node.exe (PID 18492) | KILLED ZOMBIE | LIBERATED FREE |
5173 | Free | None | Available | Available |
40200 | Free | Broker Allocated | INJECTED FLAG | RUNNING SERVER |
# Executed Command with Dynamic Socket Injection
npm run dev -- --port 40200 --host 127.0.0.1
Next Steps
- Dev server is running cleanly without EADDRINUSE failure loops.
- 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):
-
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.
-
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. -
Multi-Agent Collision: Two parallel agent worktrees attempt to spin up dev servers on the exact same default port.
-
Guaranteed Free Port Allocation:
- Dynamically brokers open ports in non-standard ranges (e.g. 40100–40999) using OS-level ephemeral socket probing.
-
Port Collision Auditor:
- Inspects target ports to identify whether they are occupied and discovers the PID and command of the holding process.
-
Deterministic Zombie Reclaim:
- Terminates orphaned zombie listeners cleanly via OS-level task management (
SIGTERM/taskkill) to liberate blocked ports.
- Terminates orphaned zombie listeners cleanly via OS-level task management (
-
PreToolUse Dev Command Rewriter:
- Injects allocated free ports directly into dev server startup flags (
--port $PORT).
- Injects allocated free ports directly into dev server startup flags (
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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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