# localhost-mcp

> localhost-mcp is an open-source MCP server for developer tools. MCP server that lists, inspects and safely kills local dev servers by port. It is available on CLI, macOS, Linux and Windows.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows
- **Repository:** https://github.com/hasanjahidul/localhost-mcp
- **GitHub stars:** 4
- **License:** MIT
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

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.

## Features

- **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

## Tools

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_servers` (name 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_zombies` (name suggests: reads): Detect long-running, idle, memory-heavy dev servers
- `port_conflict`: Explain why a port is busy and list free alternatives nearby

## 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.

## Alternatives

- [portview](https://ai-powered.com/mcp/portview): portview is an open-source MCP server for developer tools.
- [Tidyports](https://ai-powered.com/mcp/tidyports): Tidyports is an open-source MCP server for developer tools.
- [Freshdeps MCP](https://ai-powered.com/mcp/freshdeps-mcp): Freshdeps MCP is a free MCP server for developer tools.
- [Mcpdiet](https://ai-powered.com/mcp/mcpdiet): Mcpdiet is an open-source MCP server for developer tools.
- [Next Devtools MCP](https://ai-powered.com/mcp/next-devtools-mcp): Next Devtools MCP is an open-source MCP server for developer tools.
- [MCPProxy](https://ai-powered.com/mcp/mcpproxy): MCPProxy is an open-source MCP server for developer tools.
- [MCP Registry](https://ai-powered.com/mcp/mcp-registry-2): MCP Registry is an open-source MCP server for developer tools.
- [NEPHIS MCP Server](https://ai-powered.com/mcp/nephis-mcp-server): NEPHIS MCP Server is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/localhost-mcp
