Runs an MCP server as a child process and talks to it over its standard input and output, one JSON message per line.
Options
:command- the executable, looked up on thePATH(required).:arguments- a list of binaries; defaults to[].:maximum_message_bytes- the longest message accepted; defaults to 4 MiB. A longer one closes the transport with:message_too_largeinstead of growing without bound.:exit_grace_milliseconds- how long a child gets to leave after its stdin closes before it is sentSIGTERM; defaults to 1 000. A child that is still alive 500 ms afterSIGTERMreceivesSIGKILL.
The child's standard error is not read: it goes to the terminal of the Erlang VM, which keeps
the progress chatter that tools such as npx print out of the protocol stream.
Port.close/1 does not end the child, so stopping this transport closes stdin (which makes a
well-behaved server exit) and then signals the child that stays. A server started through a
wrapper such as npx may leave a grandchild that shares the wrapper's stdin and ends with it;
a grandchild that ignores stdin closing is not tracked.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.