Skip to main content
Glama
Log Analyzer MCP
by Fato07

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 tools

9+ log formats

280 tests

81%+ coverage

Related MCP server: Log Analyzer MCP

🎬 Demo

Log Analyzer MCP Demo

Analyzing logs with 14 specialized tools

🤔 Why?

Without log-analyzer-mcp

With log-analyzer-mcp

Copy-paste chunks of logs

Point Claude at the file

Lose context between pastes

Full file access

Manual format parsing

Auto-detection

Miss related errors

Smart 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

# 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

uvx codesdevs-log-analyzer install

Manual

# pip
pip install codesdevs-log-analyzer

# uv
uv tool install codesdevs-log-analyzer

Add to ~/.claude/settings.json:

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

📋 Supported Formats

Format

Example

Syslog

Jan 15 10:30:00 hostname process[pid]: message

Apache/Nginx

127.0.0.1 - - [15/Jan/2026:10:30:00] "GET /path" 200

Apache/Nginx error

[Thu Jan 15 10:30:00.123456 2026] [error] [pid 1234] message

JSON Lines

{"timestamp": "...", "level": "ERROR", "message": "..."}

Docker

2026-01-15T10:30:00.123Z stdout message

Python

2026-01-15 10:30:00,123 - module - ERROR - message

Java/Log4j

2026-01-15 10:30:00,123 ERROR [thread] class - message

Kubernetes

level=error msg="..." ts=2026-01-15T10:30:00Z

Generic

Any line with recognizable timestamp

⚡ Performance

Metric

Value

100MB log file

< 10 seconds

Memory footprint

Streaming (no full load)

Max tested size

1GB+

Format detection

< 100ms

🛠️ Available Tools

Tool

Description

log_analyzer_parse

Detect format and extract metadata

log_analyzer_search

Search with context lines

log_analyzer_extract_errors

Extract and group errors

log_analyzer_summarize

Generate debugging summary

log_analyzer_correlate

Find related events

log_analyzer_watch

Monitor for new entries

log_analyzer_ask

Natural language queries

log_analyzer_scan_sensitive

Detect PII/credentials

+ 6 more

Full 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

git clone https://github.com/Fato07/log-analyzer-mcp
cd log-analyzer-mcp
uv sync
uv run pytest -v --cov

📈 Star History

Star History Chart

📄 License

MIT License - see LICENSE for details.


Available Tools

14 tools
log_analyzer_askA
Read-onlyIdempotent
Answer questions about log files using AI-assisted analysis.

Translates natural language questions into appropriate log analysis
operations and provides intelligent, contextual answers.

Example questions:
- "Why did the database connection fail?"
- "How many errors occurred in the last hour?"
- "What happened before the server crashed?"
- "Show me all authentication failures"
- "When did the first timeout occur?"

Args:
    file_path: Path to the log file to analyze
    question: Natural language question about the logs
    max_results: Maximum supporting entries to include (10-200, default: 50)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Natural language answer with supporting log entries and suggestions.

Inputs: file_path (required), question (required), max_results, response_format. Returns: result

log_analyzer_correlateA
Read-onlyIdempotent
Correlate events around anchor points in a log file.

Args:
    file_path: Path to the log file
    anchor_pattern: Pattern to anchor correlation around (regex)
    window_seconds: Time window in seconds around anchor (1-3600, default: 60)
    max_anchors: Maximum anchor points to analyze (1-50, default: 10)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Correlated events around each anchor point, showing what happened
    before and after the anchor event.

Inputs: file_path (required), anchor_pattern (required), window_seconds, max_anchors, +1 more. Returns: result

log_analyzer_diffA
Read-onlyIdempotent
Compare log files or time periods within a log file.

Args:
    file_path_a: First log file path
    file_path_b: Second log file path (optional - for comparing two files)
    time_range_a_start: Start time for first period (ISO format, for time comparison)
    time_range_a_end: End time for first period (ISO format)
    time_range_b_start: Start time for second period (ISO format)
    time_range_b_end: End time for second period (ISO format)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Comparison showing new errors, resolved errors, and volume changes.

Inputs: file_path_a (required), file_path_b, time_range_a_start, time_range_a_end, +3 more. Returns: result

log_analyzer_extract_errorsA
Read-onlyIdempotent
Extract all errors and exceptions from a log file with stack traces.

Args:
    file_path: Path to the log file
    include_warnings: Include WARN level entries (default: False)
    group_similar: Group similar error messages (default: True)
    max_errors: Maximum errors to return (1-500, default: 100)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Extracted errors grouped by similarity with occurrence counts,
    timestamps, and sample stack traces.

Inputs: file_path (required), include_warnings, group_similar, max_errors, +1 more. Returns: result

log_analyzer_multiA
Read-onlyIdempotent
Analyze multiple log files together for cross-file debugging.

Supports three operations:
- merge: Interleave entries by timestamp (like 'sort -m')
- correlate: Find events happening across files within time window
- compare: Diff error patterns between files

Args:
    file_paths: List of log file paths to analyze (2-10 files)
    operation: Analysis operation - 'merge', 'correlate', or 'compare' (default: 'merge')
    time_window: Time window in seconds for correlation (1-3600, default: 60)
    max_entries: Maximum entries to return (100-5000, default: 1000)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Combined analysis results based on the selected operation.

Inputs: file_paths (required), operation, time_window, max_entries, +1 more. Returns: result

log_analyzer_parseA
Read-onlyIdempotent
Parse and analyze a log file, detecting its format and extracting metadata.

Args:
    file_path: Path to the log file to analyze
    format_hint: Force specific format (syslog, apache_access, apache_error, jsonl,
                 docker, python, java, kubernetes, generic) or None for auto-detect
    max_lines: Maximum lines to parse (100-100000, default 10000)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Analysis results including detected format, time range, level distribution,
    and sample entries.

Inputs: file_path (required), format_hint, max_lines, response_format. Returns: result

log_analyzer_scan_sensitiveA
Read-onlyIdempotent
Detect sensitive data in logs (PII, credentials, API keys).

Scans log files for potentially sensitive information including:
- Email addresses
- Credit card numbers (Visa, MasterCard, Amex)
- API keys and tokens (AWS, GitHub, Slack, generic)
- Passwords in URLs or config
- Social Security Numbers (SSN)
- JWT and Bearer tokens
- Database connection strings
- Private key markers
- Phone numbers
- IP addresses (optional)

Args:
    file_path: Path to the log file to scan
    redact: Redact sensitive data in output (default: False)
    categories: Filter to specific categories. Options:
               email, credit_card, api_key, token, password,
               ssn, ip_address, phone, connection_string, private_key
    include_ips: Include IP address detection (default: False)
    max_matches: Maximum matches to return (1-500, default: 100)
    max_lines: Maximum lines to scan (1-1000000, default: 100000)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Sensitive data scan results with matches and statistics.

Inputs: file_path (required), redact, categories, include_ips, +3 more. Returns: result

log_analyzer_suggest_formatA
Read-onlyIdempotent
Analyze a log file and suggest the best parsing approach.

Returns detailed format detection information including:
- Detected format with confidence score
- Alternative formats to try if confidence is low
- Sample of unparseable lines with suggestions
- Custom pattern suggestions for generic parser

Args:
    file_path: Path to the log file to analyze
    sample_size: Number of lines to sample for analysis (default: 100)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Format suggestions and analysis results

Inputs: file_path (required), sample_size, response_format. Returns: result

log_analyzer_suggest_patternsA
Read-onlyIdempotent
Analyze a log file and suggest useful search patterns.

Scans the log content to identify patterns for:
- Common error templates (normalized messages)
- Identifiers (UUIDs, request IDs, user IDs, session IDs)
- Security indicators (auth failures, suspicious activity)
- Performance indicators (slow requests, high memory)
- HTTP endpoints with errors

Args:
    file_path: Path to the log file to analyze
    focus: Analysis focus - 'all', 'errors', 'security', 'performance',
           or 'identifiers' (default: 'all')
    max_patterns: Maximum patterns to suggest (1-20, default: 10)
    max_lines: Maximum lines to analyze (100-100000, default: 10000)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Suggested search patterns with descriptions, match counts, and examples.

Inputs: file_path (required), focus, max_patterns, max_lines, +1 more. Returns: result

log_analyzer_summarizeA
Read-onlyIdempotent
Generate a debugging summary of a log file.

Args:
    file_path: Path to the log file
    focus: Focus area - 'errors', 'performance', 'security', or 'all' (default)
    max_lines: Maximum lines to analyze (100-100000, default: 10000)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Summary including file overview, level distribution, top errors,
    anomalies detected, and recommended investigation areas.

Inputs: file_path (required), focus, max_lines, response_format. Returns: result

log_analyzer_tailB
Read-onlyIdempotent
Get the most recent log entries from a file.

Args:
    file_path: Path to the log file
    lines: Number of lines to return (1-1000, default: 100)
    level_filter: Filter by log level (ERROR, WARN, INFO, DEBUG)
    response_format: Output format - 'markdown' or 'json'

Returns:
    The last N log entries, parsed and formatted.

Inputs: file_path (required), lines, level_filter, response_format. Returns: result

log_analyzer_traceA
Read-onlyIdempotent
Extract and follow trace/correlation IDs across log entries.

Automatically detects trace IDs (OpenTelemetry, X-Request-ID, AWS X-Ray, UUID)
and groups related log entries to show request flows through your system.

Args:
    file_path: Path to the log file to analyze
    trace_id: Specific trace ID to filter for (None for all traces)
    max_traces: Maximum number of trace groups to return (1-500, default: 100)
    max_lines: Maximum lines to process (100-100000, default: 10000)
    response_format: Output format - 'markdown' or 'json'

Returns:
    Trace groups showing request flows, including trace ID types detected,
    entry counts, time spans, and error indicators.

Inputs: file_path (required), trace_id, max_traces, max_lines, +1 more. Returns: result

log_analyzer_watchA
Read-only
Watch a log file for new entries since a given position.

This enables polling-based log watching. First call with from_position=0
returns the current end-of-file position. Subsequent calls with the
returned position get new entries added since then.

Args:
    file_path: Path to the log file to watch
    from_position: File position to read from. Use 0 for initial call
                   (returns current end position), or use the returned
                   current_position from a previous call.
    max_lines: Maximum lines to read per call (1-1000, default: 100)
    level_filter: Filter by log levels, comma-separated (e.g., "ERROR,WARN")
    pattern_filter: Regex pattern to filter messages
    response_format: Output format - 'markdown' or 'json'

Returns:
    New log entries since the last position, with updated position for
    the next call.

Inputs: file_path (required), from_position, max_lines, level_filter, +2 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose (Q&A, correlation, diff, error extraction, multi-file analysis, parsing, sensitive data scanning, search, format suggestion, pattern suggestion, summary, tail, trace, watch). No two tools overlap significantly in functionality.

    Naming Consistency5/5

    All tools follow a consistent 'log_analyzer_verb' pattern in snake_case, with verbs accurately describing the operation. Perfect naming uniformity.

    Tool Count5/5

    14 tools is well-scoped for a log analysis server. Each tool addresses a specific need without being excessive or insufficient.

    Completeness5/5

    The tool set covers all major log analysis tasks: parsing, searching, filtering, extracting errors, correlating events, comparing files, summarizing, tracing, watching, and detecting sensitive data. No obvious gaps for the domain.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A Python-based MCP server that enables AI-assisted log file analysis with features for filtering, parsing, and interpreting log outputs, plus executing and analyzing test runs with varying verbosity levels.
      12
      12
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that provides AI assistants with direct access to application logs for on-demand searching, filtering, and analysis. It enables tools like Cursor to summarize log entries and identify errors within the development environment to streamline debugging.
      19 npm
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An 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