portview MCP server
2026년 11월 9일 커밋리스닝 포트와 해당 프로세스 목록을 나열하며, AI 클라이언트가 다양한 OS에서 포트를 점유 중인 프로세스를 조사, 진단, 비교 및 종료할 수 있도록 합니다.
다른 이름 Mapika/portview
- 스타
- 61
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- 2.1.0
- 마지막 커밋
- 2026년 11월 9일
- 라이선스
- MIT
portview MCP란?
리스닝 포트와 해당 프로세스 목록을 나열하며, AI 클라이언트가 다양한 OS에서 포트를 점유 중인 프로세스를 조사, 진단, 비교 및 종료할 수 있도록 합니다.
프로젝트 README에서 생성된 요약
portview MCP server 정보
네트워크 서비스를 관리하는 개발자는 portview를 사용하여 Linux, macOS, Windows 전반의 리스닝 포트를 식별하고 관리할 수 있습니다. 이 MCP server를 Claude Code와 같은 AI 클라이언트에 연결하면, agent가 활성 포트 목록을 나열하고, 특정 포트의 세부 정보를 조사하며, 이름으로 프로세스를 찾는 기능을 갖게 됩니다. 이 server는 포트 충돌이나 높은 메모리 사용량과 같은 네트워크 문제를 진단하는 방법을 제공하며, 특정 포트를 점유하고 있는 프로세스를 종료할 수도 있습니다.
이 도구는 stdio를 통해 작동하며, 파괴적인 동작을 방지하기 위해 read-only 모드로 설정할 수 있습니다. SSH를 통해 원격 호스트를 조사하는 기능을 지원하며, Docker와 통합하여 호스트 프로세스와 함께 컨테이너화된 서비스도 보여줍니다. 사용자는 list_ports, inspect_port, find_process, doctor, diff_ports, kill_port와 같은 특정 도구를 활용하여 AI 인터페이스를 통해 로컬 또는 원격 환경을 관리할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
구성
PORTVIEW_COLORS
| 이름 | 설명 | 유형 |
|---|---|---|
| PORTVIEW_COLORS | — |
자동 검사
2026년 11월 13일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능mapika/portview is public and reachablegithub.com/mapika/portview ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-09github.com/mapika/portview ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기portview
portview lists ports and the processes using them on Linux, macOS, and Windows. It shows process names, commands, memory usage, and uptime. You can inspect a port, stop its process, or monitor changes in an interactive terminal UI.
It also supports Docker, remote hosts over SSH, and an MCP server for coding agents.
Install
Homebrew:
brew install mapika/tap/portview
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/mapika/portview/main/install.sh | sh
Windows (PowerShell):
irm https://raw.githubusercontent.com/mapika/portview/main/install.ps1 | iex
Or use cargo install portview, or download a binary from
Releases.
What it does
portview # list all listening ports
portview 3000 # inspect port 3000 in detail
portview node # find ports by process name
portview watch # interactive TUI with live refresh
portview watch --docker # TUI with Docker containers as rows
portview kill 3000 --force # terminate the process using port 3000
portview doctor # diagnose port conflicts and issues
portview ssh user@server # inspect ports on a remote host
portview ssh user@server watch # remote TUI over SSH
portview ssh user@server --agentless # no portview needed on the remote
portview mcp # run as an MCP server for AI agents
Features
Scan
$ portview
╭──────┬───────┬─────┬──────────────┬──────┬────────────┬────────┬────────┬────────────────────────────╮
│ PORT │ PROTO │ PID │ ADDR │ USER │ PROCESS │ UPTIME │ MEM │ COMMAND │
├──────┼───────┼─────┼──────────────┼──────┼────────────┼────────┼────────┼────────────────────────────┤
│ 3000 │ TCP │ 8 │ 127.0.0.1 │ root │ node │ 7s │ 44 MB │ node /opt/app/web.js │
│ 5000 │ TCP │ 11 │ 127.0.0.1 │ root │ python3.12 │ 7s │ 18 MB │ python3 /opt/app/worker.py │
│ 6380 │ TCP │ 12 │ 127.0.0.1 │ root │ node │ 7s │ 1.2 GB │ node /opt/app/cache.js │
│ 7000 │ TCP │ 10 │ 127.0.0.1 │ root │ node │ 7s │ 45 MB │ node /opt/app/ingest.js │
│ 8080 │ TCP │ 9 │ 127.0.0.1 │ root │ node │ 7s │ 44 MB │ node /opt/app/api.js │
╰──────┴───────┴─────┴──────────────┴──────┴────────────┴────────┴────────┴────────────────────────────╯
--all includes non-listening connections, with one row per connection.
--wide shows full commands. --json produces JSON output for scripts.
Ports whose owner can't be resolved are still listed, with - in the columns that can't be filled. That happens for another user's process without sudo, and for sockets like TIME_WAIT that outlive the process that opened them.
The scan, doctor, and MCP examples below are real output, captured by
demo/record.shinside an isolated namespace — which is why the user isrootand the paths are/opt/app. The Docker example is illustrative, since it needs a running daemon.
MCP server (for AI agents)
portview mcp provides port queries, diagnostics, and process termination over
the Model Context Protocol using stdio.
To register it with Claude Code:
claude mcp add portview -- portview mcp
Or configure it manually:
{
"mcpServers": {
"portview": {
"command": "portview",
"args": ["mcp"]
}
}
}
| Tool | What it does |
|---|---|
list_ports |
List listening ports with available process details |
inspect_port |
Inspect a port, including process working directories and descendants |
find_process |
Find ports by process name or command substring |
doctor |
Check for conflicts, wildcard exposure, connection buildup, and high memory usage |
diff_ports |
Report ports that opened, closed, or changed owner since a baseline |
kill_port |
Terminate processes using a port; dry_run previews the targets. Marked destructive to the client |
The MCP server is included in the portview binary. Pass --read-only to disable
the kill_port tool:
portview mcp --read-only
Listed in the MCP Registry as
mcp-name: io.github.Mapika/portview.
Watch mode (interactive TUI)
portview watch # live-refresh every 1s
portview watch --docker # include Docker containers
portview watch --sort mem # sort by memory on launch
| Key | Action |
|---|---|
j/k, ↑/↓ |
Navigate rows |
Enter |
Inspect port (full command, cwd, children, connections) |
d/D |
Kill process or manage Docker container |
/ |
Filter across all columns |
←/→, r |
Cycle sort column, reverse direction |
t |
Toggle process tree view |
a |
Toggle all/listening-only |
q |
Quit |
Tree view (t): Groups child processes under their parents.
Detail view (Enter): Shows the full unwrapped command, working directory, child process list with ports, and open connections (in --all mode).
Doctor
portview doctor checks for port conflicts, wildcard bindings, connection
buildup, and high memory usage:
$ portview doctor
✓ No port conflicts
✓ No wildcard exposure issues
! Port 7000 has 16 CLOSE_WAIT connections — possible connection leak
! node (PID 12) is listening on port 6380 and using 1.2 GB of memory
2 warnings found
| Check | Flags |
|---|---|
| Port conflicts | Multiple PIDs bound to the same port |
| Wildcard exposure | Databases (postgres, redis, mysql, mongod, …) listening on 0.0.0.0 |
| Docker-host conflicts | A container publishing a port the host already uses |
| Connection buildup | High counts of TIME_WAIT or CLOSE_WAIT connections on one port; these do not by themselves establish a leak |
| High memory usage | Listening processes using more than 1 GB of resident memory |
Docker is auto-detected. portview doctor --json for scripting (exit code 1 on errors).
In CI
The GitHub Action runs doctor and can fail a workflow on errors or warnings:
- uses: mapika/portview@v2
with:
fail-on: error # error | warning | never
It annotates each finding inline on the run, writes a summary table, and exposes
findings (JSON), count, errors, and warnings as step outputs:
- uses: mapika/portview@v2
id: doctor
with:
fail-on: never
- run: echo '${{ steps.doctor.outputs.findings }}' | jq .
Set install: false if portview is already on PATH. Linux and macOS runners.
SSH remote mode
Inspect ports on a remote host over SSH:
portview ssh user@server # one-shot scan
portview ssh user@server watch # full interactive TUI
portview ssh user@server doctor # remote diagnostics
portview ssh user@server 3000 # inspect a remote port
portview ssh user@server --ssh-opt "-p 2222" # custom SSH port
Kill actions in the remote TUI are forwarded over SSH.
If portview is not installed on the remote host, SSH mode collects data using
ss and ps, or lsof and ps where ss is unavailable. This requires a
POSIX shell and the collection tools on the remote host.
$ portview ssh user@server
portview not found on user@server — falling back to agentless mode (ss + ps over SSH).
╭──────┬───────┬─────┬──────────────┬──────┬─────────┬────────┬───────┬──────────────────────╮
│ PORT │ PROTO │ PID │ ADDR │ USER │ PROCESS │ UPTIME │ MEM │ COMMAND │
├──────┼───────┼─────┼──────────────┼──────┼─────────┼────────┼───────┼──────────────────────┤
│ 3000 │ TCP │ 6 │ 127.0.0.1 │ root │ node │ 3s │ 45 MB │ node /opt/app/web.js │
│ 8080 │ TCP │ 7 │ 127.0.0.1 │ root │ node │ 3s │ 45 MB │ node /opt/app/api.js │
╰──────┴───────┴─────┴──────────────┴──────┴─────────┴────────┴───────┴──────────────────────╯
Use --agentless to collect data this way even when portview is installed on
the remote host. It supports scans, port inspection, process search,
diagnostics, and watch mode.
Run diagnostics on the collected data:
portview ssh user@server doctor --agentless
This uses the same diagnostic checks as local mode. The Docker check is skipped because agentless mode does not query remote containers.
Watch remote ports, with process termination available in the TUI:
portview ssh user@server watch --agentless
Watch mode collects updates through a single persistent SSH connection.
Docker integration
Use --docker to include ports published by Docker containers:
$ portview --docker
╭──────┬───────┬───────┬──────────────┬────────┬──────────┬────────┬────────┬────────────────────────────╮
│ PORT │ PROTO │ PID │ ADDR │ USER │ PROCESS │ UPTIME │ MEM │ COMMAND │
├──────┼───────┼───────┼──────────────┼────────┼──────────┼────────┼────────┼────────────────────────────┤
│ 3000 │ TCP │ 48291 │ 127.0.0.1 │ mark │ node │ 3h 12m │ 248 MB │ next dev [docker:web] │
│ 8080 │ TCP │ - │ 0.0.0.0 │ docker │ pv-nginx │ - │ - │ nginx:alpine :8080->80/tcp │
╰──────┴───────┴───────┴──────────────┴────────┴──────────┴────────┴────────┴────────────────────────────╯
Container-only rows have no host process, so PID, UPTIME, and MEM render as -.
In watch mode, press d on a Docker row to stop or restart the container, or
follow its logs.
JSON output
portview --json # pipe to jq, scripts, dashboards
portview --docker --json # includes Docker ownership data
portview watch --json # streaming JSON, one array per tick
portview doctor --json # machine-readable diagnostics
Custom colors
PORTVIEW_COLORS="port=red,pid=magenta,command=bright_cyan" portview
Columns: port, proto, pid, user, process, uptime, mem, command. Use --no-color to disable.
How it works
Local port and process data comes from OS interfaces:
| Field | Linux | macOS | Windows |
|---|---|---|---|
| Ports | /proc/net/tcp{,6}, udp{,6} |
proc_pidfdinfo |
GetExtendedTcp/UdpTable |
| PID | inode→pid via /proc/*/fd/ |
proc_listpids |
Included in socket table |
| Process | /proc/<pid>/exe |
proc_pidpath |
QueryFullProcessImageNameW |
| Memory | /proc/<pid>/status VmRSS |
proc_pidinfo |
K32GetProcessMemoryInfo |
| Uptime | /proc/<pid>/stat |
proc_pidinfo |
GetProcessTimes |
On Linux, portview reads the executable name from /proc/<pid>/exe.
The thread name in /proc/<pid>/comm can be changed by the runtime and is
limited to 15 bytes.
Docker integration uses the docker CLI. SSH mode uses the system ssh
client to run portview or the agentless collection tools on the remote host.
MCP mode uses newline-delimited JSON-RPC 2.0 on stdin/stdout.
Building from source
git clone https://github.com/mapika/portview
cd portview
cargo build --release
Requires Rust 1.85+ (edition 2024). Shell completions and man page are generated at build time.
The repository includes a Dockerfile. To inspect the host from a container,
share the host's network and PID namespaces:
docker run --rm -i --network host --pid host portview
Contributing
See CONTRIBUTING.md for development setup and guidelines, and demo/README.md for regenerating the recordings.
Changes should type-check on all three platforms, not just yours:
cargo check --target aarch64-apple-darwin
cargo check --target x86_64-pc-windows-msvc
Limitations
- Linux: Other users' ports are listed, but naming the process needs
sudo(it reads/proc/<pid>/fd/). Rows you can't attribute show-for PID, user, process, and command rather than being hidden. - macOS: Other users' ports are not listed without
sudo— sockets are enumerated per process viaproc_pidfdinfo, so a process that can't be opened contributes nothing to enumerate. For the same reason doctor cannot detect TIME_WAIT pileups there; CLOSE_WAIT is detected normally. - Windows: Ports owned by inaccessible system processes are listed with the PID but
-for name and user. Kill always force-terminates. Run as Administrator for full detail. - Docker: Requires
dockerCLI and daemon access - SSH: every command falls back to agentless collection when portview is missing on the remote, using
ss+pson Linux andlsofwheressdoes not exist. The remote needs one of those and a POSIX shell. Agentless collection cannot see Docker on the far end, so that check reports as skipped rather than passed.
License
MIT
portview MCP 질문
portview MCP server로 AI agent가 무엇을 할 수 있나요?
리스닝 포트 목록 나열, 포트의 프로세스 및 작업 디렉토리 조사, 프로세스 이름으로 검색, 진단 실행, 포트 변경 사항 비교, 포트 점유 프로세스 종료 등의 도구를 제공합니다.
Claude Code에 portview를 MCP server로 추가하려면 어떻게 하나요?
MCP server가 portview 바이너리에 포함되어 있으므로, claude mcp add 명령어로 등록하면 됩니다.
안전을 위해 kill_port 도구를 비활성화할 수 있나요?
네, MCP server를 --read-only 옵션과 함께 실행하면 파괴적인 동작을 수행하는 kill_port 도구가 제거됩니다.
portview MCP server 사용 시 인증이 필요한가요?
아니요, MCP server는 별도의 인증 단계 없이 newline-delimited JSON-RPC를 사용하여 로컬에서 stdio를 통해 실행됩니다.
MCP server가 지원하는 운영체제는 무엇인가요?
portview가 지원하는 플랫폼과 동일한 Linux, macOS, Windows를 지원하며, 포트 및 프로세스 데이터에 대해 네이티브 OS 인터페이스를 사용합니다.