Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Find out what is using a TCP/UDP port and free it, on Windows, macOS and Linux. Start with whats_on_port(port) for a single port or list_listening() for the whole machine; process_tree(pid) shows what a process started. find_free_port picks an unused port and check_port_reachable tests a TCP connect. To free a port call kill_port(port) FIRST: it kills nothing and returns a plan plus a confirm_token. Show the plan to the user, and only after they agree call kill_port(port, confirm_token=...). Never invent a token. Processes the OS hides from an unelevated server are reported as such, not skipped.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_listeningA

List what is listening on this machine, grouped by process.

Each process shows its PID, name, user, command line, working directory, an inferred framework (Vite, Next.js, uvicorn, Flask, docker-proxy, ...) and every port it holds with the address it is bound to. Sockets bound to 0.0.0.0 or :: are flagged EXPOSED (reachable from the network); 127.0.0.1 / ::1 are loopback only.

Filters: port_min/port_max (inclusive), process_name (case-insensitive substring of the process name or its command line, e.g. "node" or "uvicorn"), protocol "tcp" (default), "udp" or "all". Listeners whose owner the OS hides without elevation are listed under "unidentified process" rather than dropped.

whats_on_portA

Answer "what is using port N?" in detail.

Returns every listener on the port: PID, process name, user, full command line, working directory, the inferred framework, the address it is bound to (and whether that exposes it to the network), the process's parent and children, and whether kill_port would refuse it (system process, your own MCP client). If nothing is listening it says so, and also checks whether the port can be bound, which catches OS-reserved ports (Windows excluded ranges) and listeners hidden by missing privileges.

find_free_portA

Find unused TCP port(s) in start..end (inclusive), lowest first.

A port counts as free only if nothing is listening on it AND the OS lets us bind it on host, so ports reserved by the OS (Windows excluded ranges) are skipped. count returns that many ports. Use host "0.0.0.0" to require that the port is free on every interface.

kill_portA

Free a port by stopping the process on it. TWO STEPS, never kills on the first call.

Step 1: call kill_port(port). Nothing is killed. You get a plan naming every process (and its child processes) that would be stopped, what each one is (dev server such as vite/next/uvicorn, docker-proxy, database...), and a single-use confirm_token valid for 60 seconds. Show the plan to the user. Step 2: after the user agrees, call kill_port(port, confirm_token=). Processes get a graceful terminate, then a force-kill after grace_seconds; the tool then verifies the port is actually free and reports anything that survived.

Always refused, even with force: PID 0, 1 and 4, this server, and its ancestors (your MCP client). Refused unless force=True on step 1: operating-system services (svchost, systemd, SYSTEM-account processes, ...). The token only works for the port it was issued for.

process_treeA

Show a process's ancestors (who started it) and all its descendants, as a tree.

Each node lists name, PID and a shortened command line, and marks processes that are listening on a port. Use it before killing: killing a child can be undone by its parent restarting it (npm, nodemon, a reloader, a service manager).

check_port_reachableA

Try a TCP connect to host:port and report REACHABLE or UNREACHABLE with the reason.

Distinguishes "connection refused" (host is up, nothing listening), "timed out" (firewall drop or host down) and DNS failures. Works for localhost and remote hosts alike. It only connects and disconnects; no data is sent. Timeout is in seconds (0.1 to 30).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4/5.0

Scored across 6 tools

Disambiguation4/5

Each tool has a reasonably distinct role: list_listening is a broad process-grouped scan, whats_on_port is a single-port deep dive, find_free_port, kill_port, process_tree and check_port_reachable are clearly separate operations. The main overlap is between list_listening and whats_on_port (the latter returns a superset of detail for one port), and process_tree partially re-surfaces process info, but the list-vs-detail and diagnostic-vs-action boundaries are clear enough to avoid misselection.

Naming Consistency3/5

All names use snake_case, which is good, but the grammatical patterns are mixed: verb_noun (kill_port, find_free_port), gerund (list_listening), question phrase (whats_on_port), and bare noun (process_tree). It stays readable and mostly self-explanatory, but there is no single predictable verb_noun convention across the set.

Tool Count5/5

Six tools is tightly scoped to the port-diagnostics-and-cleanup domain, and each one covers a distinct step (discover, inspect, find free, trace, kill, verify reachability). Nothing feels redundant or padded.

Completeness4/5

The surface covers the full practical lifecycle: discover listeners, drill into a port, find free ports, understand process lineage, safely kill, and test reachability, with a thoughtful two-step kill flow. Minor gaps remain—find_free_port only checks TCP (no UDP equivalent despite UDP being supported in list_listening), and there's no ability to bind/reserve or wait-for-port readiness—but these are workable around.

Maintenance

ActivityMaintained
ResponsivenessOutdated data