Expand description
rlg-mcp — a Model Context Protocol server for rlg log files.
Four tools over log files on the server’s filesystem — tail_log,
filter_log, summarize_errors, tail_logs_glob — plus one
prompt and two resources. The protocol is handled by [rmcp], the
official MCP SDK; this crate supplies the tools and the text a
model reads.
The four operations are plain functions — tail_log,
filter_log, summarize_errors, tail_logs_glob — so they
can be called and tested without a transport. LogServer is the
handler that exposes them as MCP tools; each answer is returned
twice, as text for the model and as a structured value for a client
that wants to read it without parsing prose.
§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}"); }Modules§
- transport
- One command line for the three MCP transports.
Structs§
- Error
Summary - ERROR-and-above records counted per component: what
summarize_errorsreturns. - Filter
LogArgs - Arguments of
filter_log. - LogServer
- The MCP server: the four tools, one prompt and two resources over
[
rmcp]. - Records
- A slice of rendered log records: what
tail_log,filter_logandtail_logs_globreturn. - Summarize
Errors Args - Arguments of
summarize_errors. - Tail
LogArgs - Arguments of
tail_log. - Tail
Logs Glob Args - Arguments of
tail_logs_glob.
Functions§
- 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. - tail_
logs_ glob - Tail the last
nrecords across every file matching a glob pattern (e.g./var/log/**/*.log), newest last, optionally keeping only records at or abovelevel. Matched files are read in sorted path order and their records concatenated before the finalnare taken; unparseable lines are skipped.