Run the server
/Applications/Legato.app/Contents/Helpers/legato mcpThis runs Legato's MCP server over stdio for an agent. It reads protocol requests on stdin and writes its responses on stdout, one JSON message to a line, until stdin closes. Then it exits with status 0. See Connect an agent to set up a client, and MCP tools for the tools and their errors.
Protocol example
A client normally starts this process and talks to it. To check from a shell that the server answers, send it one ping:
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"ping"}' | /Applications/Legato.app/Contents/Helpers/legato mcpThe server prints one line of JSON with "jsonrpc":"2.0", "id":1 and an empty result. The order of the three can vary. It then exits with status 0, because stdin has closed.
A protocol error is a JSON-RPC error response. The server keeps running after one, and still exits with status 0. A line that isn't JSON gets the error code -32700.