mcpField
L
Localhost Mcp

Localhost Mcp

Local
github.com/HasanJahidulDeveloper Tools4Updated 25w ago

About Localhost Mcp

Localhost Mcp is an MCP server for developers who need to inspect and manage local development servers. It reports ports, processes, frameworks and resource use, and supports guarded server termination.

Key features

  1. 01List active development servers
  2. 02Inspect a port's process
  3. 03Find idle or memory-heavy servers
  4. 04Explain conflicts and suggest nearby ports
  5. 05Terminate servers with safeguards

Use cases

  1. 01Identify the process using port 3000
  2. 02Find forgotten development processes
  3. 03Review possible zombie servers
  4. 04Resolve a port conflict

MCP support

It runs as a stdio MCP server and exposes tools to MCP clients for listing, inspecting and terminating local development servers.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"localhost": {
"command": "npx",
"args": [
"-y",
"localhost-mcp"
]
}
}
}
Run commandnpx -y localhost-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmlocalhost-mcp

Tools

5

Saved tool list · updated 3w ago

This tool takes no parameters.

Details

From the project README

localhost-mcp

localhost-mcp

localhost-mcp MCP server CI npm version License: MIT

MCP server that inspects, manages, and kills local dev servers. Stop guessing what's on :3000.

demo

Pairs with terminal-history-mcp — together they give your AI agent full memory of your dev environment: what you ran, what's running.

Why

Every dev hits these daily:

  • Error: listen EADDRINUSE :::3000 — what's holding the port?
  • 5 forgotten node / vite / next PIDs from last week eating RAM
  • Switching projects → no idea which dev servers still running
  • lsof -i :3000, kill -9 <pid>, repeat

localhost-mcp makes it one tool call.

Install

npm install -g localhost-mcp

Wire into Claude Code:

claude mcp add --scope user localhost -- localhost-mcp

Or any MCP-compatible client. The command runs as a stdio MCP server.

Tools

ToolPurpose
list_dev_serversAll listening dev servers w/ port, pid, framework, project, uptime, mem, cpu
port_infoInspect single port — who holds it
kill_serverKill by pid or port. Dry-run by default; pass confirm=true to execute
find_zombiesDetect long-running, idle, memory-heavy dev servers
port_conflictWhy is port X busy + 5 free alternatives nearby

Sample output

{
  "port": 3000,
  "pid": 48211,
  "process": "node",
  "cmdline": "next dev",
  "cwd": "/Users/me/code/myapp",
  "project_name": "myapp",
  "framework": "next.js",
  "uptime_seconds": 14523,
  "memory_mb": 412,
  "cpu_pct": 0.3,
  "user": "me"
}

Safety

  • kill_server defaults to dry-run. Must pass confirm=true.
  • Refuses to kill PIDs < 1000 (system processes).
  • Refuses processes outside the dev whitelist (node, python, ruby, go, deno, bun, php, java, rails, vite, next, etc).
  • SIGTERM first, escalates to SIGKILL after 5s timeout.

Frameworks detected

next.js, vite, nuxt, remix, astro, webpack-dev-server, esbuild, create-react-app, express, fastify, koa, hono, rails, django, flask, fastapi, uvicorn, gunicorn, deno, bun, php-builtin, jekyll, hugo.

Falls back to package.json sniffing when the cmdline is generic (node server.js).

Platform support

  • macOS — full support (uses lsof)
  • Linux — full support (uses lsof + /proc)
  • Windows — basic port scan only (uses netstat); cwd / framework detection limited

CLI usage

localhost-mcp list      # JSON list of all dev servers
localhost-mcp zombies   # JSON list of zombie candidates
localhost-mcp           # Start MCP stdio server

Build from source

git clone https://github.com/hasanjahidul/localhost-mcp.git
cd localhost-mcp
npm install
npm run build
node dist/cli.js list

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.