Skip to main content
Glama
HasanJahidul

localhost-mcp

by HasanJahidul

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.

Related MCP server: devpulse-mcp

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

Tool

Purpose

list_dev_servers

All listening dev servers w/ port, pid, framework, project, uptime, mem, cpu

port_info

Inspect single port — who holds it

kill_server

Kill by pid or port. Dry-run by default; pass confirm=true to execute

find_zombies

Detect long-running, idle, memory-heavy dev servers

port_conflict

Why 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

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
1dRelease cycle
2Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    F
    maintenance
    An MCP server that enables programmatic management and monitoring of development servers through a unified interface and interactive TUI. It provides tools for process control, log streaming, and experimental browser automation via Playwright.
    Last updated
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Zero-config MCP server that gives AI coding assistants a real-time diagnostic snapshot of your local dev environment. Detects framework, running services, recent errors, git state, and provides a health diagnosis in one call.
    Last updated
    3
    28
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Developers: Search your zsh, bash, or fish shell history from Claude Code, Cline, Cursor, Zed, or any MCP client using tools like search_history (full-text with timestamp/CWD/exit code), recent_in_dir, failed_commands, and command_chains for multi-step sequences. Reindex after new activity. Local-only SQLite FTS5 with secrets redacted before storage.
    Last updated
    5
    46
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • A MCP server built for developers enabling Git based project management with project and personal…

  • MCP Spec Compliance MCP — audits any MCP server.json against the official Model Context Protocol

  • MCP server for managing Prisma Postgres.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HasanJahidul/localhost-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server