log-ai-optimizer
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@log-ai-optimizercheck for anomalies in main.log over the last 15 minutes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
log-ai-optimizer
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-depsRelated MCP server: log-mcp
Configure
cp config.example.yaml config.yamlEdit 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.yamlIn a separate process, run the MCP query server (stdio transport):
log-ai-optimizer serve config.yamlTo 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 countsget_template_stats(source_id, since?)— templates sorted by countget_anomalies(source_id, window_minutes)— templates new or spiking vs. prior windowdrill_down(template_id, limit)— sample raw params for a templatesearch_templates(query, source_id?)— substring search over templates
Dev
pip install -r requirements-dev.txt
pip install -e . --no-deps
pytestSee log-compress-spec.md for the full design.
This server cannot be deployed
Maintenance
Related MCP Connectors
Syslog receiver and MCP server for homelab log intelligence.
Syslog receiver and MCP server for homelab log intelligence.
MCP server for AI dialogue using various LLM models via AceDataCloud
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for intelligent log analysis providing semantic search, error pattern clustering, and smart error detection. It enables users to process, vectorize, and query local logs to efficiently identify issues and generate AI-powered summaries.MIT
- AlicenseAqualityDmaintenanceMCP server for log file analysis. Gives LLMs the ability to efficiently analyze large log files without loading them into context.7100MIT
- AlicenseNot gradedqualityCmaintenanceAggregates logs from multiple processes and provides an MCP server for AI agents to access, search, and manage logs in real-time.7 npm91BSD 3-Clause
- AlicenseAqualityCmaintenanceA Python MCP server that reduces token usage by ~98% when working with log files by auto-detecting format and stripping noise to return only actionable signal.52MIT