kill_port
Free a port held by a running process: preview exactly what would be stopped, then confirm to terminate it gracefully and verify the port is actually released.
Instructions
Free a port by stopping the process on it. TWO STEPS, never kills on the first call.
Step 1: call kill_port(port). Nothing is killed. You get a plan naming every process (and its child processes) that would be stopped, what each one is (dev server such as vite/next/uvicorn, docker-proxy, database...), and a single-use confirm_token valid for 60 seconds. Show the plan to the user. Step 2: after the user agrees, call kill_port(port, confirm_token=). Processes get a graceful terminate, then a force-kill after grace_seconds; the tool then verifies the port is actually free and reports anything that survived.
Always refused, even with force: PID 0, 1 and 4, this server, and its ancestors (your MCP client). Refused unless force=True on step 1: operating-system services (svchost, systemd, SYSTEM-account processes, ...). The token only works for the port it was issued for.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"port": "<port>"
},
"name": "kill_port"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | ||
| force | No | ||
| protocol | No | tcp | |
| confirm_token | No | ||
| grace_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |