Log Analyzer Mcp

io.github.Fato07由 GitHub 账号 Fato07 发布v0.4.2更新于 Oct 25, 2026

AI-powered log analysis - parse, search, extract errors across 9+ formats

概览

AI 生成的概览

一个本地 MCP 服务器,让助手无需复制粘贴即可解析、搜索、汇总和调试 9 种以上格式的日志文件。

可以做什么
解析日志文件,自动识别格式并提取元数据与时间戳,支持 syslog、Apache/Nginx、JSON Lines、Docker、Python、Java/Log4j、Kubernetes 等 9 种以上格式,并以流式方式处理大文件而非全部载入内存。使用模式匹配、正则、上下文行和时间过滤搜索日志。提取并归并相似错误、捕获堆栈信息并生成调试摘要。跨多个文件关联相关事件,并监控文件中的新条目。以自然语言回答关于日志的问题,并扫描日志中的个人身份信息、凭据和密钥。
适用场景
适合通过日志文件调试应用或服务器,并希望助手直接读取文件而不是粘贴片段时使用,尤其适用于大体积或多文件日志、错误归并、按时间关联事件,或检查日志中是否意外泄露密钥。
运行要求
以本地进程通过 stdio 在用户桌面运行。需要 Python 及 uv 或 pip 来安装 codesdevs-log-analyzer 包;README 推荐一行 uvx 安装或在 Claude Code 设置文件中手动添加条目。未声明需要账户、API 密钥或环境变量。
安装前请注意
该服务器会读取本机日志文件,其中可能包含敏感数据;敏感数据扫描只是检测辅助,不能保证完全发现。watch 工具会监控文件中的新条目。使用前请确认所指向的文件路径。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Log Analyzer Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Log Analyzer MCP

[MCP Registry] [PyPI version] [PyPI Downloads] [License: MIT] [Python 3.10+] [GitHub stars]

🔍 Stop copy-pasting logs into AI. Let Claude read them directly.

An MCP server for AI-powered log analysis. Parse, search, and debug log files across 9+ formats — right from Claude Code.

📊 At a Glance

14 MCP tools9+ log formats
280 tests81%+ coverage

🎬 Demo

[Log Analyzer MCP Demo]

Analyzing logs with 14 specialized tools

🤔 Why?

Without log-analyzer-mcpWith log-analyzer-mcp
Copy-paste chunks of logsPoint Claude at the file
Lose context between pastesFull file access
Manual format parsingAuto-detection
Miss related errorsSmart correlation

✨ Features

  • Auto-Detection — Identifies format from 9+ common log types
  • Smart Search — Pattern matching with context, regex, and time filtering
  • Error Extraction — Groups similar errors, captures stack traces
  • Natural Language — Ask questions like "what errors happened today?"
  • Sensitive Data Scan — Detect PII, credentials, and secrets
  • Multi-File Analysis — Correlate events across distributed systems
  • Streaming — Handles 1GB+ files without memory issues

🚀 Quick Start

bash
# Install (adds to Claude Code automatically)uvx codesdevs-log-analyzer install

Then in Claude Code:

Analyze /var/log/app.log and tell me what's causing the errors

📦 Installation

One-liner (Recommended)

bash
uvx codesdevs-log-analyzer install

Manual

pip / uv / Claude Code config
bash
# pippip install codesdevs-log-analyzer
# uvuv tool install codesdevs-log-analyzer

Add to ~/.claude/settings.json:

json
{  "mcpServers": {    "log-analyzer": {      "command": "uvx",      "args": ["codesdevs-log-analyzer"]    }  }}

📋 Supported Formats

FormatExample
SyslogJan 15 10:30:00 hostname process[pid]: message
Apache/Nginx127.0.0.1 - - [15/Jan/2026:10:30:00] "GET /path" 200
JSON Lines{"timestamp": "...", "level": "ERROR", "message": "..."}
Docker2026-01-15T10:30:00.123Z stdout message
Python2026-01-15 10:30:00,123 - module - ERROR - message
Java/Log4j2026-01-15 10:30:00,123 ERROR [thread] class - message
Kuberneteslevel=error msg="..." ts=2026-01-15T10:30:00Z
GenericAny line with recognizable timestamp

⚡ Performance

MetricValue
100MB log file< 10 seconds
Memory footprintStreaming (no full load)
Max tested size1GB+
Format detection< 100ms

🛠️ Available Tools

ToolDescription
log_analyzer_parseDetect format and extract metadata
log_analyzer_searchSearch with context lines
log_analyzer_extract_errorsExtract and group errors
log_analyzer_summarizeGenerate debugging summary
log_analyzer_correlateFind related events
log_analyzer_watchMonitor for new entries
log_analyzer_askNatural language queries
log_analyzer_scan_sensitiveDetect PII/credentials
+ 6 moreFull reference →

💡 Examples

Find errors:

Extract all errors from /var/log/app.log, group similar ones

Search with context:

Search for "timeout" in app.log with 5 lines of context

Correlate events:

What happened 60 seconds before each OutOfMemoryError?

Scan for secrets:

Check /var/log/app.log for accidentally logged credentials

🔧 Development

bash
git clone https://github.com/Fato07/log-analyzer-mcpcd log-analyzer-mcpuv syncuv run pytest -v --cov

📈 Star History

[Star History Chart]

📄 License

MIT License - see LICENSE for details.


Found this useful? Give it a ⭐ on GitHub!

Report bugs · Request features · Discussions · Full docs

Built by Fato07 at CodesDevs

来源:README.md,提交 bcf0b38

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.4.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分