# sebastienrousseau/rlg [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/sebastienrousseau/rlg  
**GitHub Stars:** 6  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sebastienrousseau-rlg

## Description
Log-stream tools for on-call / SRE agent workflows — expose rlg (RustLogs) log files as MCP tools. Three tools: taillog (last N events, filtered by level/target), filterlog (JSON-path-style predicates), summarizeerrors (grouped error taxonomy). Speaks JSON-RPC 2.0 over stdio; near-lock-free structured logging engine underneath (65k-slot ring buffer, 14 output formats, oslog/journald sinks). Install cargo install rlg-mcp or docker run -i ghcr.io/sebastienrousseau/rlg-mcp. Dual-licensed MIT OR Apache-2.0.

## Tools
Capabilities this server exposes over MCP:

- **tail_log** — `path`, optional `n` (default 100) → last `n` parseable records, rendered in Logfmt.
- **filter_log** — `path`, optional `min_level` / `component` / `format` → records matching every supplied filter, in the chosen `LogFormat`.
- **summarize_errors** — `path` → JSON map of `component → error_count` for ERROR-and-above records.

## Claude Desktop Quick Installation
Heuristic fallback — verify the package name and runner against the repository README before running it. Uses `npx` (confidence: low):

```json
"mcpServers": {
  "rlg": {
    "command": "npx",
    "args": ["-y","sebastienrousseau-rlg"]
  }
}
```

## Documentation & README

<!-- SPDX-License-Identifier: Apache-2.0 OR MIT -->

<p align="center">
  <img src="https://cloudcdn.pro/rlg/v1/logos/rlg.svg" alt="RLG logo" width="128" />
</p>

<h1 align="center">rlg — RustLogs</h1>

<p align="center">
  Near-lock-free structured logging for Rust, plus an ecosystem of
  companion crates: CLI tooling, MCP server, OTLP exporter, tower
  middleware, WebAssembly bindings, PII redaction, test utilities,
  and aggregation reports.
</p>

<p align="center">
  <a href="https://github.com/sebastienrousseau/rlg/actions"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/rlg/ci.yml?style=for-the-badge&logo=github" alt="Build" /></a>
  <a href="https://github.com/sebastienrousseau/rlg/actions/workflows/miri.yml"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/rlg/miri.yml?style=for-the-badge&logo=rust&label=Miri" alt="Miri" /></a>
  <a href="https://crates.io/crates/rlg"><img src="https://img.shields.io/crates/v/rlg.svg?style=for-the-badge&color=fc8d62&logo=rust" alt="Crates.io" /></a>
  <a href="https://docs.rs/rlg"><img src="https://img.shields.io/badge/docs.rs-rlg-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" alt="Docs.rs" /></a>
  <a href="https://codecov.io/gh/sebastienrousseau/rlg"><img src="https://img.shields.io/codecov/c/github/sebastienrousseau/rlg?style=for-the-badge&logo=codecov" alt="Coverage" /></a>
  <a href="https://lib.rs/crates/rlg"><img src="https://img.shields.io/badge/lib.rs-rlg-orange.svg?style=for-the-badge" alt="lib.rs" /></a>
</p>

---

This is the Cargo workspace root. The library lives at
[`crates/rlg`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg). Ten companion crates ship from this
workspace, all at lockstep version `0.0.11`.

## The rlg ecosystem

| Crate | What it does | Use case |
|---|---|---|
| **[`rlg`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg/README.md)** | Near-lock-free structured logging engine. 65k-slot ring buffer, deferred formatting, 14 output formats, native OS sinks (`os_log` via `syslog(3)`, `journald`). | Embed structured logging in any Rust binary or library. |
| **[`rlg-cli`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-cli/README.md)** | `rlg` binary — `jq` for structured logs. Tail, filter, convert across all 14 formats. | Pipe `my-service \| rlg --min-level error --format ecs` from the shell. |
| **[`rlg-mcp`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-mcp/README.md)** | Model Context Protocol server exposing rlg streams as tools to LLM agents. | Claude Desktop, Cursor, mcp.run agents reading your logs. |
| **[`rlg-otlp`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-otlp/README.md)** | OpenTelemetry network exporter (OTLP/HTTP JSON). | Ship records to Honeycomb, Datadog, Tempo, Jaeger, otelcol. |
| **[`rlg-tower`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-tower/README.md)** | `tower::Layer` emitting per-request structured access logs. | axum, tonic, hyper, `lambda_runtime` — any `tower::Service`. |
| **[`rlg-wasm`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-wasm/README.md)** | `wasm-bindgen` wrapper for browser / Deno / Cloudflare Workers / Bun, plus a WASI 0.2 component interface for wasmtime hosts. | Structured logging from JS or WASI 0.2 components. |
| **[`rlg-redact`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-redact/README.md)** | PII / secret redaction between `Log::fire()` and the sink. Aho-Corasick fused alternation regex. | Compliance, GDPR, audit-trail safety. Built-in patterns for cards, JWTs, bearers, emails, IPs, AWS keys. |
| **[`rlg-test`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-test/README.md)** | Test utilities — capture rlg records in a `#[test]` scope and assert on them with `assert_logged!`. | Downstream library tests verifying their structured log output. |
| **[`rlg-report`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-report/README.md)** | Log digest / analytics: count by level, top components, top errors, latency percentiles. CLI + library mode. | Operational dashboards, daily error reports, oncall triage. |
| **[`rlg-ebpf`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-ebpf/README.md)** | `Enricher` trait + `ProcessEnricher` (portable) + `EbpfEnricher` scaffold (Linux, behind the `ebpf` feature) for automatic PID / process-name attributes. | Automatic host-level context on every record without app code changes. |
| `xtask` *(internal, unpublished)* | `cargo xtask check-all / coverage / audit / doc / examples / bench / release`. | Maintainer automation. |

### Install one, install all

```toml
[dependencies]
rlg         = "0.0.12"
rlg-otlp    = "0.0.12"  # ship to an OTLP collector
rlg-tower   = "0.0.12"  # HTTP middleware
rlg-redact  = "0.0.12"  # PII redaction

[dev-dependencies]
rlg-test    = "0.0.12"  # assertions in your tests
```

CLI binaries:

```bash
cargo install rlg-cli       # the `rlg` binary
cargo install rlg-mcp       # the `rlg-mcp` MCP server
cargo install rlg-report    # the `rlg-report` digest tool
```

## Tools

The MCP server crate, [`rlg-mcp`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg-mcp/README.md), exposes rlg
log streams to LLM agents as three MCP tools over the stdio transport:

- `tail_log` — `path`, optional `n` (default 100) → last `n` parseable records, rendered in Logfmt.
- `filter_log` — `path`, optional `min_level` / `component` / `format` → records matching every supplied filter, in the chosen `LogFormat`.
- `summarize_errors` — `path` → JSON map of `component → error_count` for ERROR-and-above records.

## Workspace layout

```text
.
├── Cargo.toml            # workspace manifest (profiles, members)
├── README.md             # ← you are here
├── CHANGELOG.md / CONTRIBUTING.md / SECURITY.md
├── LICENSE-{APACHE,MIT}
├── crates/
│   ├── rlg/              # core library
│   ├── rlg-cli/          # `rlg` binary + filter/render lib
│   ├── rlg-mcp/          # MCP server
│   ├── rlg-otlp/         # OTLP/HTTP exporter
│   ├── rlg-tower/        # tower::Layer
│   ├── rlg-wasm/         # wasm-bindgen + WASI 0.2 component
│   ├── rlg-redact/       # PII / secret scrubber (Aho-Corasick)
│   ├── rlg-test/         # test utilities
│   ├── rlg-report/       # log digest binary + lib
│   ├── rlg-ebpf/         # Enricher trait + eBPF (Linux) scaffold
│   └── xtask/            # internal automation (publish = false)
└── .github/
    └── workflows/
        ├── ci.yml        # delegates to sebastienrousseau/pipelines
        └── release.yml   # workspace-aware crates.io publisher
```

## Quick links

- **Core docs:** [`crates/rlg/README.md`](https://github.com/sebastienrousseau/rlg/blob/HEAD/crates/rlg/README.md) · [docs.rs/rlg](https://docs.rs/rlg)
- **Contributing & signing policy:** [`CONTRIBUTING.md`](https://github.com/sebastienrousseau/rlg/blob/HEAD/CONTRIBUTING.md)
- **Security policy:** [`SECURITY.md`](https://github.com/sebastienrousseau/rlg/blob/HEAD/SECURITY.md)
- **Release notes:** [`CHANGELOG.md`](https://github.com/sebastienrousseau/rlg/blob/HEAD/CHANGELOG.md)

## License

Dual-licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) or [MIT](https://opensource.org/licenses/MIT), at your option.

