port-doctor-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@port-doctor-mcpwhat's using port 3000?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
port-doctor-mcp
A local stdio MCP server based on FastMCP that checks development port usage and terminates the corresponding process by port.
Features
check_port_status(port: int): checks whether a port is occupied, and returns the PID, name, RSS memory usage, protocol, and connection state of the occupying process.kill_process_by_port(port: int, force: bool = True): terminates the process occupying the port. Uses forceful termination by default; passforce=falseto use the gentler terminate. The server will not terminate itself.scan_common_dev_ports(): scans common development ports: 3000, 3001, 4173, 5000, 5173, 8000, 8001, 8080, 8081, 8888, 9000.
Related MCP server: localhost-mcp
Installation
Requires Python 3.10 or higher.
python -m venv .venv
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install -r requirements.txtVerify that the current interpreter actually has the dependencies installed:
python -c "import sys, psutil, fastmcp; print(sys.executable); print('psutil', psutil.__version__); print('fastmcp', fastmcp.__version__)"If ModuleNotFoundError still appears here, it means the Python used to install dependencies and the one used to run the server are not the same. Do not just run Invalidate Caches; instead, in PyCharm select this project's .venv/bin/python under Settings -> Project -> Python Interpreter, and use the same interpreter in the Run Configuration.
For example, the project interpreter path should be similar to:
/path/to/port-doctor-mcp/.venv/bin/pythonWindows example:
C:\path\to\port-doctor-mcp\.venv\Scripts\python.exeRunning
This is a stdio server. Once started, it waits for MCP clients to communicate via stdin/stdout and does not provide an HTTP port.
python server.pyYou can also use the FastMCP CLI:
fastmcp run server.pyFor development and debugging, you can use MCP Inspector (subject to the support of your installed FastMCP CLI):
fastmcp dev inspector server.pyAfter running python server.py directly, it is normal for the terminal to have no ordinary output and to keep waiting for input: the stdio MCP server waits for the client to send JSON-RPC messages via stdin/stdout. Do not treat "the process has not exited" as a startup failure.
Manual Testing Checklist
Run in the project root directory:
source .venv/bin/activate
python -m pip check
python -m py_compile server.py
git diff --check
fastmcp list server.py --input-schema --output-schema --jsonfastmcp list should show the following three tools:
check_port_status: requiredport, an integer.kill_process_by_port: requiredport, optionalforce, defaulttrue.scan_common_dev_ports: no parameters.
Testing with Inspector
Run:
fastmcp dev inspector server.pyIn the opened Inspector, test in order:
Call
check_port_status, passing5000or8000.Call
scan_common_dev_portsand confirm it returnsscanned_portsandoccupied_ports.Start a dedicated test service:
python -m http.server 8765 --bind 127.0.0.1Call
check_port_status(8765)and confirm you can see the Python process's PID, name, and memory.Call
kill_process_by_port(8765, force=false), confirm it returnssuccess: true, then close the test terminal.
Do not test kill_process_by_port directly against important processes such as databases, IDEs, or system services. This tool defaults to force=true and sends a forced termination signal.
Checking the schema with the FastMCP CLI
fastmcp inspect server.py --format mcpCheck whether the tool names, descriptions, parameter types, and default values in the output are correct.
MCP Client Configuration
Replace the path below with the absolute path of this project, then place it in the configuration of an MCP-capable client:
{
"mcpServers": {
"port-doctor-mcp": {
"command": "/absolute/path/to/port-doctor-mcp/.venv/bin/python",
"args": ["/absolute/path/to/port-doctor-mcp/server.py"]
}
}
}Windows example:
{
"mcpServers": {
"port-doctor-mcp": {
"command": "C:\\path\\to\\port-doctor-mcp\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\port-doctor-mcp\\server.py"]
}
}
}MCP.so only handles GitHub repository directory information; it will not fix your local Python interpreter. After installation, other users still need to create a virtual environment and run pip install -r requirements.txt.
Publishing to MCP.so
MCP.so is an MCP server directory; it will not turn a local stdio process into a public HTTP service. Before publishing, commit this project to a public GitHub repository, then open:
https://mcp.so/submit?type=serverFill in:
Repository URL: your GitHub repository URL.Name:port-doctor-mcp.
The submission page may offer a paid expedited publishing option; whether you purchase it does not affect whether this project's code runs. After discovering the project in the directory, users still need to configure the local Python environment following the installation steps above.
Return Value Example
check_port_status(8000) returns a structure similar to:
{
"port": 8000,
"in_use": true,
"process_count": 1,
"processes": [
{
"pid": 12345,
"name": "python",
"memory_rss_bytes": 52428800,
"memory_rss_mb": 50.0,
"connections": [
{
"protocol": "tcp",
"local_address": "127.0.0.1:8000",
"status": "LISTEN"
}
]
}
]
}Safety Notes
kill_process_by_port is a tool with side effects. The default force=true sends a forced termination signal and may cause loss of unsaved data; it is recommended to call check_port_status first to confirm the PID, then decide whether to terminate. When reading other users' process information or terminating protected processes, the operating system may return permission errors.
License
See LICENSE.
This server cannot be installed
Maintenance
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
- AlicenseAqualityDmaintenanceA unified developer toolkit for AI-assisted workflows. Task timing, doc drift detection, env validation, secret scanning, port conflict resolution, AI context generation, and license auditing — one MCP server, one install.73MIT
- AlicenseAqualityDmaintenanceInspect, manage, and kill local dev servers via MCP. Stop guessing what's on :3000. Five tools: list servers with framework detection, inspect ports, find zombies, diagnose conflicts, safe-kill with dry-run default. Local, no cloud, no telemetry.5203MIT
- AlicenseNot gradedqualityBmaintenanceEnables management of long-running development processes (such as dev servers, compilers, and watchers) from MCP hosts. Provides tools to start, stop, restart, check status, view logs, and send input to managed processes.MIT
- AlicenseNot gradedqualityAmaintenanceSee what's on your ports, then act on it. Diagnostic-first port viewer for Linux, MacOS and Windows.56MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/GrantKnoche/port-doctor-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server