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 分