Log Analyzer MCP
An MCP server that lets AI assistants inspect and debug log files directly through 14 read-only tools.
Parse logs and auto-detect formats, time ranges, levels, and metadata.
Search patterns with context, regex/case/level filters.
Extract/group errors and stack traces; summarize debugging insights.
Tail recent entries and watch/poll for new log lines.
Correlate events around anchors and compare logs/time periods.
Analyze multiple files via merge, correlate, or compare operations.
Trace request/correlation IDs across entries.
Detect sensitive data such as PII, credentials, API keys, tokens, and connection strings.
Answer natural-language questions about logs.
Suggest useful search patterns and best parsing format/approach.
Enables parsing and analysis of Apache web server logs to identify request patterns and troubleshoot errors.
Provides tools to analyze Docker container logs, including support for timestamp extraction and log stream identification.
Facilitates debugging in containerized environments by parsing and analyzing Kubernetes-formatted log files.
Enables parsing and analysis of NGINX web server logs to identify request patterns and troubleshoot errors.
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 Analyzer MCP Find and group the most frequent errors in /var/log/app.log"
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 Analyzer MCP
🔍 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

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 installThen in Claude Code:
Analyze /var/log/app.log and tell me what's causing the errors📦 Installation
One-liner (Recommended)
uvx codesdevs-log-analyzer installManual
# pip
pip install codesdevs-log-analyzer
# uv
uv tool install codesdevs-log-analyzerAdd to ~/.claude/settings.json:
{
"mcpServers": {
"log-analyzer": {
"command": "uvx",
"args": ["codesdevs-log-analyzer"]
}
}
}📋 Supported Formats
Format | Example |
Syslog |
|
Apache/Nginx |
|
Apache/Nginx error |
|
JSON Lines |
|
Docker |
|
Python |
|
Java/Log4j |
|
Kubernetes |
|
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 |
| Detect format and extract metadata |
| Search with context lines |
| Extract and group errors |
| Generate debugging summary |
| Find related events |
| Monitor for new entries |
| Natural language queries |
| Detect PII/credentials |
+ 6 more |
💡 Examples
Find errors:
Extract all errors from /var/log/app.log, group similar onesSearch with context:
Search for "timeout" in app.log with 5 lines of contextCorrelate 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
📄 License
MIT License - see LICENSE for details.
Available Tools
14 toolslog_analyzer_askARead-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_correlateARead-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_diffARead-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_errorsARead-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_multiARead-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_parseARead-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_sensitiveARead-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_searchARead-onlyIdempotent
Search for patterns in a log file with context lines.
Args:
file_path: Path to the log file to search
pattern: Search pattern (regex or plain text)
is_regex: Treat pattern as regex (default: False, plain text)
case_sensitive: Case-sensitive search (default: False)
context_lines: Lines of context before/after match (0-10, default: 3)
max_matches: Maximum matches to return (1-200, default: 50)
level_filter: Filter by log level (ERROR, WARN, INFO, DEBUG)
response_format: Output format - 'markdown' or 'json'
Returns:
Search results with matches and surrounding context.
Inputs: file_path (required), pattern (required), is_regex, case_sensitive, +4 more. Returns: result
log_analyzer_suggest_formatARead-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_patternsARead-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_summarizeARead-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_tailBRead-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_traceARead-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_watchARead-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
Scored across 14 tools
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.
All tools follow a consistent 'log_analyzer_verb' pattern in snake_case, with verbs accurately describing the operation. Perfect naming uniformity.
14 tools is well-scoped for a log analysis server. Each tool addresses a specific need without being excessive or insufficient.
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
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
Analytics and debugging for your MCP server — explore usage and sessions, then root-cause errors.
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- AlicenseBqualityDmaintenanceA specialized MCP server that helps analyze and debug Model Context Protocol logs by providing Claude with direct access to log files across multiple platforms.116MIT
- FlicenseBqualityDmaintenanceA 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.1212-
- AlicenseNot gradedqualityCmaintenanceAn 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 npm6MIT
- 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