portview — Claude Code MCP server: what it does, how to install
Inspects listening network ports, running processes, and memory consumption. It helps coding agents diagnose socket conflicts and terminate blocking services.
Open on GitHubWhat portview does
The MCP server is built into the portview executable and connects via standard input and output (stdio). It exposes tools such as list_ports to display listening sockets and find_process to match ports by command strings. The inspect_port tool inspects working directories alongside child processes.
Built-in diagnostics help track down problems. The doctor tool flags address conflicts, database bindings to 0.0.0.0, and processes exceeding 1 GB of resident memory. It also notes high counts of CLOSE_WAIT or TIME_WAIT sockets. To see what changed over time, diff_ports compares open ports against an earlier baseline.
For process management, kill_port stops programs attached to a given port. The tool is flagged as destructive to clients. Running the binary with the --read-only flag disables process termination, which limits the agent to diagnostic queries.
What it helps with
- identify which process occupies a specific network port
- diagnose port collisions and exposed database bindings
- track port status changes against a previous baseline
- terminate a stalled process bound to an active port
Example prompts for the agent
- Check what process is currently using port 3000.
- Run portview doctor to see if any local ports have conflicts.
- Inspect port 8080 and show its child processes and working directory.
How to install portview
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about portview
How to install portview in Claude Code?
First install the CLI tool on your system using Homebrew with brew install mapika/tap/portview or via Cargo using cargo install portview. Next, register the server by running claude mcp add portview -- portview mcp.
What does the portview MCP server do?
It gives coding agents tools to list listening sockets, inspect parent and child processes, detect connection issues, and stop processes holding ports.
Can I prevent the agent from killing processes?
Yes. Add the --read-only flag when starting the server: portview mcp --read-only. This removes the kill_port tool from the available toolset.