HasanJahidul/localhost-mcp

🖥️ Command Line
0 Views
0 Installs

📇 🏠 🍎 🪟 🐧 - Inspect, manage, and kill local dev servers. Lists what's listening on each port (pid, framework, project, uptime, memory, cpu), diagnoses port conflicts with free alternatives nearby, finds zombie processes, and kills by pid or port with a dry-run default.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "hasanjahidul-localhost-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "hasanjahidul-localhost-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

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

Related MCP Servers

blinkingbit-oss/execkit

🦀 🏠 🍎 🐧 - Stateful, structured, auditable shell sessions for AI agents over local, SSH, and Docker. Secret redaction, output budgeting, SSH host-key verification, and a loopback read-only browser viewer that streams the live transcript.

🖥️ Command Line0 views
bvisible/mcp-ssh-manager

📇 🏠 🍎 🪟 🐧 - Manage multiple SSH servers from one MCP: command execution, file transfer/rsync, database dump/import/query (MySQL/PostgreSQL/MongoDB), backups & restore, health monitoring, persistent sessions, tunnels, ProxyJump/bastion, and opt-in per-server security modes (readonly/restricted) with audit log. Linux, macOS & Windows OpenSSH.

🖥️ Command Line0 views
capsulerun/bash

📇 🏠 🍎 🪟 🐧 - Sandboxed bash for agents. Run untrusted commands in WebAssembly sandboxes with no setup required.

🖥️ Command Line0 views
cygnussystems/cygnus-ssh-mcp

🐍 🏠 🍎 🪟 🐧 - MCP server for SSH-based control of remote Linux, macOS, and Windows servers with 46 purpose-built tools instead of one generic command-runner: line-level file editing (no download/edit/upload round-trip), background task launch/monitor/kill, real sudo support, host aliases, recursive directory ops, archive create/extract, and full Unicode via SFTP (avoids PowerShell OEM code page corruption on Windows targets). pip install cygnus-ssh-mcp or uvx cygnus-ssh-mcp.

🖥️ Command Line0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it →
★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.