CLI command
probierz serve
Serve the same tools over HTTP on 127.0.0.1 for Probierz Desktop and other local programs.
Invocation#
probierz serve [--port <PORT>]Required inputs and options#
--portis the loopback port; without itPROBIERZ_SERVE_PORT(which Stado's service declaration sets), else any free one.stado product install probierz --surface serviceruns it as a Stado service on the host.
Output and state effects#
Listens on 127.0.0.1 only and writes the URL, a fresh bearer token and the harness to serve.json in Probierz's state directory, readable by its owner alone. Each connection is answered on its own thread, so a long command does not hold the others. GET /healthz answers without the token, with only that it serves and its version, so Stado can check the service. GET /v1/tools lists the command tools probierz mcp lists, one per command, each titled with the command as typed; the background-run tools only probierz mcp keeps (probierz_start_run and its controls) are not listed, since a call here is answered when its command ends, and probierz_run runs a journey. POST /v1/call runs one listed tool by name with its arguments; POST /v1/argv runs one command line as the CLI would. Every answer carries the command's JSON and, on refusal (422), the refusal with what the command printed. A request's body is read only after its token holds.
Exact refusals#
- A port that cannot be listened on, or a
PROBIERZ_SERVE_PORTthat is not a port, is refused naming it and the cause. - A request other than
GET /healthzwithout the token fromserve.jsonis answered 401; a request line or header over 8000 octets 400; an unknown path 404; an unknown tool or an argument the command does not take is the same refusalprobierz mcpgives, andmcporserveare not started from a server. - A process already serving another harness refuses to serve a second one.
Declared refusals#
What probierz refusals list declares for this command at revision d2cd6156e8b8dc6204dab7b46ec0b34b2bb03cea (probierz 0.1.7 (revision unknown, not built from a git checkout)): each cause's id, the operation declaring it, its exit status and code, and its remedy.
input-unreadable(probierz.mcp, exit 1, config): reading the next request from standard input: standard input cannot be read ({reason}), so no further request can be. startprobierz mcpwith its standard input a pipe or terminal the client writes requests to.request-not-json(probierz.mcp, exit 2, refused): reading one request line: the line is not JSON, so it names no method to serve. send one JSON-RPC 2.0 request object per line.method-missing(probierz.mcp, exit 2, refused): reading request {id}: the request carries an id but no method naming what to do. name the method: initialize, ping, tools/list or tools/call.method-unknown(probierz.mcp, exit 2, refused): serving method {method}: this server serves no method {method}. call one of initialize, ping, tools/list or tools/call.name-missing(probierz.mcp, exit 2, refused): reading which tool tools/call is to run: params.name is {found}, not the non-empty name of a tool. name the tool in params.name, as tools/list answers it.arguments-not-object(probierz.mcp, exit 2, refused): reading the arguments of {tool}: params.arguments is {found}, not an object of argument names to values. send params.arguments as a JSON object, or leave it out for a tool that needs none.tool-unknown(probierz.mcp, exit 2, refused): running tool {tool}: this server serves no tool {tool}. call tools/list for the tools this server serves, and call one of them.argument-missing(probierz.mcp, exit 2, refused): reading the arguments of {tool}: {tool} requires the argument {argument}, and it is not given. give {argument}, as the tool's inputSchema in tools/list declares it.argument-undeclared(probierz.mcp, exit 2, refused): reading the arguments of {tool}: {tool} declares no argument {argument}, so it would not reach the command as anything it reads. leave {argument} out, or name one of the arguments {tool} declares.argument-type(probierz.mcp, exit 2, refused): reading the argument {argument} of {tool}: {argument} must be {expected}, and it is {found}. give {argument} as {expected}, as the tool's inputSchema declares it.argument-empty(probierz.mcp, exit 2, refused): reading the argument {argument} of {tool}: {argument} is empty, and it names something the command reads. give {argument} a value.argument-flag-like(probierz.mcp, exit 2, refused): reading the argument {argument} of {tool}: {argument} is {value}, which starts with '-', so the command would read it as an option instead of the {argument} it names. give {argument} a value that does not start with '-' (a path can be written ./-name).catalogue-invalid(probierz.mcp, exit 1, config): reading the tool catalogue this binary serves: the catalogue compiled into this probierz breaks the rule that {rule}. install a probierz built from a revision whose tool catalogue holds (probierz refusals checkpasses there), and report this build's.catalogue-part-not-json(probierz.mcp, exit 1, config): reading the run control tools compiled into this probierz: they are not a JSON array of tools ({reason}). install a probierz built from a revision whose tool catalogue holds (probierz refusals checkpasses there), and report this build's.command-refused(probierz.mcp, exit 2, refused): reading the command probierz {command}: the arguments do not match the command's options. give each argument in the form the command takes (probierz {command} --help).server-nested(probierz.mcp, exit 2, refused): running probierz {command} for a caller of the service: probierz {command} is a server, and a server is not started from inside another. start probierz {command} on its own, outside the service.answer-not-json(probierz.mcp, exit 1, config): reading what probierz {command} answered for {tool}: the command's answer is not one JSON document. report the command: every command routed to a tool answers one JSON document.answer-unwritten(probierz.mcp, exit 69, infra_down): writing the answer to request {id} on standard output: the client's end of standard output does not take it ({reason}). keep the MCP client reading the server's standard output until it closes the server's standard input; a client that closed its read end has stopped listening.
Source snapshot#
Generated from the Rust binaries at revision 99a74945a3598a8d73b6c6cbe5aae4f283becea3 of Probierz's private source repository.
Combined help SHA-256: 77529678a61237f774b59e76df0d1907cb749ef5da56d2ed913b040793b7d30b; binary SHA-256: be9e0eaff0e6ea50403a0c6f6d467697a4eac676f9523b8dc13a596d2b5526c5.