kill_server
Safely terminate a local dev server by PID or port. Dry run by default; pass confirm:true to send SIGTERM and escalate as needed. Protects system processes and non-dev servers.
Instructions
Terminates a local dev server by pid or port. DESTRUCTIVE. Safe by default: with no confirm, this is a DRY RUN — it reports what it would kill and changes nothing. Pass confirm: true to actually terminate: sends SIGTERM, waits up to 5s, then escalates to SIGKILL (or SIGKILL immediately if force: true). Refuses PIDs below 1000 and processes that don't look like dev servers. Provide exactly one of pid or port. Returns what was (or would be) killed and the signal used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | Process ID to kill. Mutually exclusive with `port`. | |
| port | No | TCP port whose listening process should be killed. Mutually exclusive with `pid`. | |
| force | No | Skip SIGTERM and send SIGKILL immediately. Default false. | |
| confirm | No | Must be true to actually terminate the process. When false/omitted the call is a dry run. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | ||
| port | No | ||
| killed | No | ||
| signal | No | `SIGTERM`, `SIGKILL`, or null on a dry run. | |
| dry_run | No | ||
| message | No | ||
| process | No |