Skip to content

Documentation / @interstellar-tools/mcp / parsePort

Function: parsePort() ​

ts
function parsePort(text: string): number;

Defined in: http.ts:40

A TCP port from the command line or $PORT: a whole number in [0, 65535], where 0 picks a free one.

Parameters ​

ParameterType
textstring

Returns ​

number

Throws ​

If text is anything else, including empty.