
localhost-mcp
MCP server that lists, inspects and safely kills local dev servers by port
localhost-mcp is an open-source MCP server for developer tools. It is available on CLI, macOS, Linux and Windows.
- Pricing
- Open source
- Platforms
- CLI, macOS, Linux
- GitHub stars
- 4
- Last commit
- Language
- TypeScript
- License
- MIT
Similar MCP servers
About localhost-mcp
Developers often lose track of which processes are holding ports like 3000 or leaving old Node, Vite or Next.js servers running in the background. This server gives an AI client a set of tools to see exactly what is listening on each port, which project and framework it belongs to, and how much memory and CPU it uses.
Beyond inspection, it can flag idle or memory-heavy dev servers as zombie candidates and suggest nearby free ports when a conflict occurs. Killing a process is deliberately guarded: the kill tool runs as a dry run unless explicitly confirmed, skips low-numbered system PIDs, and only acts on a whitelist of development runtimes, sending SIGTERM before escalating to SIGKILL.
It installs from npm and plugs into Claude Code or any MCP-compatible client, and it also ships a command-line mode for listing servers and zombies as JSON. macOS and Linux get full detection, while Windows is limited to a basic port scan.
Tools this server provides (5)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 2 of 5 tools read data; 3 names don't say.
From the server's own tool labels and tool names; not verified by us.
- list_dev_serversName suggests: reads
- All listening dev servers with port, pid, framework, project, uptime, memory and CPU
- port_info
- Inspect a single port to see which process holds it
- kill_server
- Kill a process by pid or port; dry-run unless confirm=true
- find_zombiesName suggests: reads
- Detect long-running, idle, memory-heavy dev servers
- port_conflict
- Explain why a port is busy and list free alternatives nearby
What it does
- Live dev server listing
- Shows every listening dev server with its port, PID, framework, project folder, uptime, memory and CPU use.
- Single port inspection
- Reveals which process holds a given port so conflicts can be diagnosed in one call.
- Guarded process termination
- Kill requests are dry runs until confirmed, and system PIDs and non-development processes are refused.
- Zombie server detection
- Finds long-running, idle or memory-heavy dev servers that are likely forgotten.
- Free port suggestions
- When a port is busy, proposes several free alternatives nearby.
- Framework detection
- Identifies common frameworks such as Next.js, Vite, Rails, Django and Express, falling back to package.json when the command line is generic.
Good for
- Finding out which process is blocking a port that throws EADDRINUSE
- Cleaning up forgotten dev servers that are consuming RAM after switching projects
- Letting an AI agent check which local services are running before starting a new one
- Choosing a free port for a new dev server without trial and error
Pricing
Open source
localhost-mcp FAQ
Does kill_server stop processes without asking?
No. It defaults to a dry run and only terminates a process when confirm=true is passed.
Which operating systems are supported?
macOS and Linux have full support. Windows gets a basic port scan with limited working-directory and framework detection.
How do I install localhost-mcp?
Install globally with npm install -g localhost-mcp, then register it with your MCP client, for example with claude mcp add in Claude Code.
Can I use localhost-mcp without an MCP client?
Yes. The localhost-mcp list and localhost-mcp zombies commands print JSON from the terminal.
Is localhost-mcp free?
Yes. localhost-mcp is open source, so you can use and self-host it for free.
What are the best alternatives to localhost-mcp?
The closest alternatives to localhost-mcp are portview, Tidyports, Freshdeps MCP, Mcpdiet and Next Devtools MCP.
Where this comes from
- Description: written from the project's README.