Skip to main content

Crate rlg_mcp

Crate rlg_mcp 

Source
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.
ResponseError
JSON-RPC 2.0 error object.

Functions§

dispatch
Dispatch one JSON-RPC request to the appropriate handler.
filter_log
Apply filter to every record in path and return matches rendered in format.
summarize_errors
Count error+ records grouped by component.
tail_log
Return the last n parseable records from path, rendered in Logfmt. Unparseable lines are skipped.