Expand description
MCP (Model Context Protocol) tool implementations and the minimal JSON-RPC 2.0 dispatcher that wires them to a Server.
The wire format follows the MCP specification’s stdio transport: one JSON-RPC request per line on stdin, one response per line on stdout.
The three tools (tail_log, filter_log, summarize_errors)
are pure functions over a file path so they can be unit-tested
without spinning up the transport loop.
§Example
use std::path::Path;
let recent = rlg_mcp::tail_log(Path::new("/var/log/app.ndjson"), 10).unwrap();
for line in recent { println!("{line}"); }Structs§
- Request
- JSON-RPC 2.0 request envelope.
- Response
- JSON-RPC 2.0 response envelope.
- Response
Error - JSON-RPC 2.0 error object.
Functions§
- dispatch
- Dispatch one JSON-RPC request to the appropriate handler.
- filter_
log - Apply
filterto every record inpathand return matches rendered informat. - summarize_
errors - Count error+ records grouped by component.
- tail_
log - Return the last
nparseable records frompath, rendered inLogfmt. Unparseable lines are skipped.