Port Desk MCP
Click on "Deploy 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 Desk MCPWhich process is 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 desk MCP
Port desk is a local MCP server written in Python. It answers four questions about this machine:
list_listenersshows TCP and UDP sockets this user can see.who_ownsnames the process on a port and reports whether this process can bind it.next_free_portpicks a port this process can bind.wait_until_freewaits until a port can be bound.
The process speaks stdio. It does not open a port of its own except for a bind probe that closes immediately.
The same tools are also available as a Node server in port-desk-mcp. This repository is the Python package, so it can be installed with pip.
Tools
Tool | Call it when | Fields that matter |
| You need the listening sockets |
|
| You need the process on one port |
|
| You need a port to listen on |
|
| A port is busy and you can wait |
|
bind.result and wait_until_free.result are free, in_use, forbidden, or error. hidden is true when nothing visible owns the port and the bind probe still finds it taken. next_free_port trusts the bind probe, not lsof.
An empty listeners list means nothing matched. A wait that expires is a normal result with free: false.
Related MCP server: localhost-mcp
Safety
Port desk never signals another process and never reads command lines or environments. list_listeners and who_owns use lsof with a fixed argument list. Port and address filters run after that output is parsed. The bind probe listens on an IP address you pass, then closes the socket before the tool returns. A hostname is rejected so a DNS name cannot choose the address.
Requirements
Python 3.10 or newer
lsofonPATHforlist_listenersandwho_owns
next_free_port and wait_until_free do not need lsof.
Install
From a checkout:
python -m pip install -e ".[dev]"
pytestThe console script is port-desk-mcp. It speaks MCP over stdin and stdout.
After the package is on PyPI:
pip install port-desk-mcppipx and uvx work the same way: uvx port-desk-mcp.
Claude
Claude Code can use this checkout after the package is installed into the Python on PATH:
{
"mcpServers": {
"port-desk-mcp": {
"type": "stdio",
"command": "port-desk-mcp"
}
}
}Claude Desktop uses the same command in claude_desktop_config.json. On macOS that file is ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows it is %APPDATA%\Claude\claude_desktop_config.json.
Cursor
Add this to ~/.cursor/mcp.json:
{
"mcpServers": {
"port-desk-mcp": {
"command": "port-desk-mcp"
}
}
}Publish to PyPI
The package name on PyPI is port-desk-mcp. From a machine logged in with a PyPI API token:
python -m pip install build twine
python -m build
twine check dist/*
twine upload dist/*Create the token at https://pypi.org/manage/account/token/. Keep it out of the repository. twine upload asks for the username __token__ and the token as the password.
Example
This is an example of who_owns, not a reading from your machine:
{
"port": 5901,
"protocol": "tcp",
"owners": [
{
"protocol": "tcp",
"address": "127.0.0.1",
"port": 5901,
"pid": 2095,
"process": "Xtigervnc",
"user": "ubuntu"
}
],
"bind": { "host": "127.0.0.1", "result": "in_use" },
"hidden": false
}Contributing
See CONTRIBUTING.md. The project is licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
Syslog receiver and MCP server for homelab log intelligence.
Syslog receiver and MCP server for homelab log intelligence.
Open-source IP address and CIDR tools for network calculations and public IP lookup.
Secure tunneling, reverse proxy and remote access for local applications.
Related MCP Servers
- FlicenseAqualityCmaintenanceEnables AI assistants to identify processes listening on specific network ports by returning process names and PIDs. It provides infrastructure introspection capabilities through the Linux ss command to help users monitor and debug local services.11-
- 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.516 npm3MIT
- AlicenseNot gradedqualityBmaintenanceSee and control the local dev servers your coding agents leave running. Lists listeners with provenance — which agent, terminal and git worktree started each — kills strays, and allocates collision-free ports so parallel agents stop fighting over :3000.MIT
- AlicenseNot gradedqualityAmaintenanceSee what's on your ports, then act on it. Diagnostic-first port viewer for Linux, MacOS and Windows.60MIT