Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Open-source AI agent to safely kill stray dev servers & free blocked ports in Google Antigravity IDE (and similar agentic IDEs like Cursor). Slash commands: /killservers /listports /nukeports. Intelligent, safe, portable

License

Notifications You must be signed in to change notification settings

supratikpm/ServerSlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš”οΈ ServerSlayer

Kill Stray Development Servers β€’ Free "Port in Use" Errors Instantly

Stars IDE Support Safe Cross Platform

Open-source AI agent to safely terminate stray localhost processes and free blocked ports.
Works with Node.js, Python/Django/Flask, Java/Spring Boot, Ruby/Rails, Go, PHP and more.


🎬 Demo

ServerSlayer Demo

πŸ‘† Click to watch the demo video
πŸŽ₯ https://youtu.be/Fetdo7CfPIs


🚨 The Problem: "Port Already in Use"

Every developer knows this pain:

Error: listen EADDRINUSE: address already in use :::3000

You forgot to stop a dev server. Now you're hunting PIDs manually. Not anymore.


✨ The Solution: One Slash Command

/killservers

That's it. ServerSlayer finds and safely kills stray development servers, idle localhost processes, and zombie dev servers β€” instantly.


🎯 Features

Feature Description
Kill Stray Servers Terminate localhost processes blocking your ports
Safe Port Killer Never kills databases, Docker, ngrok, or IDE processes
Idle Server Detection Identifies unresponsive/zombie dev servers
Cross-Platform Works on Windows, macOS, and Linux
Multi-Framework Node.js, Python, Java, Ruby, Go, PHP support
Any Agentic IDE Cursor, Antigravity, Continue.dev, Windsurf, VS Code + AI

πŸš€ Quick Install

Step 1: Clone

git clone https://github.com/supratikpm/ServerSlayer.git

Step 2: Copy to Your Project

Windows (PowerShell):

Copy-Item -Path "path\to\ServerSlayer\.agent" -Destination ".\" -Recurse -Force

macOS / Linux:

cp -r /path/to/ServerSlayer/.agent ./

Step 3: Use It!

Type /listports or /killservers in your AI chat. Done!


πŸ“– Slash Commands

Command What it does
/listports πŸ“‹ List all running dev servers on localhost
/killservers πŸ”ͺ Kill stray servers (graceful termination)
/nukeports ☒️ Force kill all dev servers
/killport 3000 🎯 Kill specific port

πŸ–₯️ Works in Any Agentic IDE

ServerSlayer is IDE-agnostic. Tested and works with:

IDE Setup
Cursor Add .cursorrules (see below)
Antigravity Just copy .agent/ folder
Continue.dev Copy .agent/ folder
Windsurf Copy .agent/ folder
VS Code + AI Use system prompt (see below)
Any AI Assistant Use the Python script directly
πŸ“‹ Cursor IDE Setup (.cursorrules)

Create .cursorrules in your project root:

You have access to ServerSlayer workflows in .agent/workflows/.
When the user mentions ports, servers, or "port in use" errors, use:
- /listports - to see what's running
- /killservers - to safely kill dev servers
- /killport <port> - to kill a specific port
- /nukeports - for force kill

Run: python .agent/tools/server_slayer_tools.py [list|kill] [options]
πŸ€– Claude / ChatGPT / Any AI Setup

Add to your system prompt:

You have ServerSlayer for port management.

Commands:
python .agent/tools/server_slayer_tools.py list
python .agent/tools/server_slayer_tools.py kill --scope=project
python .agent/tools/server_slayer_tools.py kill --force
python .agent/tools/server_slayer_tools.py kill --port 3000

SAFETY: Never kill ports 3306, 5432, 27017, 6379 (databases).

πŸ›‘οΈ Safety First: Protected Services

ServerSlayer automatically protects critical services:

Category Protected
Databases MySQL (3306), PostgreSQL (5432), MongoDB (27017), Redis (6379)
Tunnels ngrok, SSH (22)
IDE Processes Cursor, VSCode, Antigravity, JetBrains
Containers Docker daemon

πŸ”§ How It Works (Code Visibility)

The core logic is in server_slayer_tools.py:

# Detection: Find all listening ports
def get_listening_ports():
    if SYSTEM_OS == "Windows":
        output = run_command(["netstat", "-ano"])
        # Parse LISTENING ports...
    else:  # macOS / Linux
        output = run_command(["lsof", "-iTCP", "-sTCP:LISTEN", "-n", "-P"])
        # Parse listening ports...

# Safety: Never kill protected services
PROTECTED_PORTS = [3306, 5432, 27017, 6379, 1433, 22]
PROTECTED_PROCESSES = ["docker", "postgres", "mysql", "ngrok", "vscode", "cursor"]

# Kill: Graceful first, force if needed
def kill_process(pid, force=False):
    if SYSTEM_OS == "Windows":
        subprocess.run(["taskkill", "/PID", str(pid), "/F" if force else ""])
    else:
        subprocess.run(["kill", "-9" if force else "", str(pid)])

Full source: server_slayer_tools.py


πŸ“ Project Structure

.agent/                          # πŸ‘ˆ Copy this folder to any project
β”œβ”€β”€ tools/
β”‚   └── server_slayer_tools.py   # Core detection & kill logic
└── workflows/
    β”œβ”€β”€ listports.md             # /listports command
    β”œβ”€β”€ killservers.md           # /killservers command
    β”œβ”€β”€ killport.md              # /killport command
    └── nukeports.md             # /nukeports command

πŸ”§ Supported Frameworks

Framework Default Ports
Node.js (Next.js, Vite, CRA) 3000, 3001, 5173
Python (Django, Flask, FastAPI) 8000, 5000
Java (Spring Boot, Tomcat) 8080
Ruby (Rails) 3000
Go 8080
PHP 8000

🀝 Contributing

PRs welcome! See CONTRIBUTING.md

Help needed:

  • 🍎 macOS/Linux testing
  • 🧩 More framework detection
  • 🎬 Better demo GIF

⭐ Star This Repo

If ServerSlayer saved you from "port already in use" hell:

Star


πŸ” Keywords

kill stray servers β€’ port already in use β€’ terminate localhost processes β€’ safe port killer β€’ idle server killer β€’ free blocked ports β€’ dev server cleanup β€’ cursor rules β€’ ai agent β€’ antigravity ide


βš”οΈ Stray servers slain! Happy coding! πŸš€

Made with βš”οΈ by @supratikpm

About

Open-source AI agent to safely kill stray dev servers & free blocked ports in Google Antigravity IDE (and similar agentic IDEs like Cursor). Slash commands: /killservers /listports /nukeports. Intelligent, safe, portable

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages