network/connections
List TCP and UDP sockets with owning processes, filter by state or port, and return text or JSON for connection troubleshooting.
Instructions
Lists TCP and UDP sockets in every state with their owning processes, like ss -tuanp, read natively from /proc/net (no ss needed). Read-only; unix and raw sockets are not included. state (case-insensitive, _ and - interchangeable) filters by LISTEN (includes unconnected UDP), ESTABLISHED, TIME_WAIT, CLOSE_WAIT, SYN_SENT, ... or the groups connected/synchronized; an invalid state is an error listing the valid names. port matches the local OR peer port. The owning process (pid, fd) is shown only for sockets whose /proc/PID/fd you can read; other users' processes need privileged: true (needs a grant). Text output has ss -tuanp columns; output_format: json returns an array of objects (netid, state, recv_q, send_q, local_address, local_port, peer_address, peer_port, uid, inode, processes), [] when empty. For the ARP cache use network/arp, for interfaces and IPs the network://interfaces resource, for process details processes/list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Match sockets whose local or peer port equals this | |
| state | No | Filter by TCP state, case-insensitive (LISTEN/listening, ESTABLISHED, TIME_WAIT, CLOSE_WAIT, SYN_SENT, ...). Omit to list all sockets - active connections and listening ports. | |
| privileged | No | Run as root to see PIDs of other users. Needs a grant for this tool in mcp-sudo.yaml, otherwise refused | |
| output_format | No | Use json for structured output (yaml, table and wide return the same JSON); default is text |