Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Log Ai Optimizer

FreeNot checked

Compresses log files into templates and statistics using Drain3, and exposes them to AI assistants via an MCP server for efficient log monitoring and anomaly de

GitHubEmbed

About

Compresses log files into templates and statistics using Drain3, and exposes them to AI assistants via an MCP server for efficient log monitoring and anomaly detection.

README

Compresses log files into templates + stats (via Drain3) and exposes them to Claude through an MCP server, so AI log monitoring reads compact stats instead of raw lines.

Install

python -m venv .venv
.venv/Scripts/activate        # or: source .venv/bin/activate
pip install -r requirements.txt
pip install -e . --no-deps

Configure

cp config.example.yaml config.yaml

Edit config.yaml: list the log file paths to tail, plus DB path and sampling caps.

Run

Start ingestion (tails files, mines templates, writes to SQLite — keep this running):

log-ai-optimizer ingest config.yaml

In a separate process, run the MCP query server (stdio transport):

log-ai-optimizer serve config.yaml

To use it from Claude Desktop/Code, add it as an MCP server pointing at that command, e.g.:

{
  "mcpServers": {
    "log-ai-optimizer": {
      "command": "log-ai-optimizer",
      "args": ["serve", "/path/to/config.yaml"]
    }
  }
}

MCP tools

  • list_sources() — sources with template/line counts
  • get_template_stats(source_id, since?) — templates sorted by count
  • get_anomalies(source_id, window_minutes) — templates new or spiking vs. prior window
  • drill_down(template_id, limit) — sample raw params for a template
  • search_templates(query, source_id?) — substring search over templates

Dev

pip install -r requirements-dev.txt
pip install -e . --no-deps
pytest

See log-compress-spec.md for the full design.

from github.com/JustinHabashi/log-ai-optimizer

Install Log Ai Optimizer in Claude Desktop, Claude Code & Cursor

Recommended · one command, every IDE
unyly install log-ai-optimizer

Installs into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.

First time? Get the CLI: curl -fsSL https://unyly.org/install | sh

Or configure manually

Run in your terminal:

claude mcp add log-ai-optimizer -- uvx --from git+https://github.com/JustinHabashi/log-ai-optimizer log-ai-optimizer

FAQ

Is Log Ai Optimizer MCP free?

Yes, Log Ai Optimizer MCP is free — one-click install via Unyly at no cost.

Does Log Ai Optimizer need an API key?

No, Log Ai Optimizer runs without API keys or environment variables.

Is Log Ai Optimizer hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Log Ai Optimizer in Claude Desktop, Claude Code or Cursor?

Open Log Ai Optimizer on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Log Ai Optimizer with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All ai MCPs