Supports installation via git clone, allowing users to easily download and set up the MCP log analyzer
Enables installation from GitHub repository, providing access to the complete log analyzer codebase and documentation
Provides access to Linux systemd journal and application logs through system resources, with filtering capabilities by time range or entry count
Supports running tests with pytest as part of the development workflow for validating log analyzer functionality
Built with Python and requires Python 3.12+ for operation, leveraging Python's ecosystem for log analysis capabilities
Enables analysis of structured XML log files, providing tools to register, query, and perform pattern/anomaly detection on XML logs
MCP Log Analyzer
A Model Context Protocol (MCP) server for analyzing different types of logs on Windows systems, built with the FastMCP framework.
Features
- Multiple Log Format Support
- Windows Event Logs (EVT/EVTX)
- Windows Event Trace Logs (ETL)
- Structured Logs (JSON, XML)
- CSV Logs
- Unstructured Text Logs
- MCP Tools
register_log_source
: Register new log sourceslist_log_sources
: View all registered sourcesget_log_source
: Get details about a specific sourcedelete_log_source
: Remove a log sourcequery_logs
: Query logs with filters and paginationanalyze_logs
: Perform analysis (summary, pattern, anomaly)
- MCP Resources
logs://sources
: View registered log sourceslogs://types
: Learn about supported log typeslogs://analysis-types
: Understand analysis optionssystem://windows-event-logs
: Recent Windows System and Application event logssystem://linux-logs
: Linux systemd journal and application logssystem://process-list
: Current processes with PID, CPU, and memory usagesystem://netstat
: Network connections and statistics for troubleshooting
- MCP Prompts
- Log analysis quickstart guide
- Troubleshooting guide
- Windows Event Log specific guide
Installation
Windows Setup
On Windows, the package includes Windows Event Log support via pywin32
. If you encounter import errors:
Note: On first install of pywin32
, you may need to run the post-install script:
Usage
Understanding MCP Servers
MCP (Model Context Protocol) servers don't have traditional web endpoints. They communicate via stdin/stdout with MCP clients (like Claude Code). When you run python main.py
, the server starts silently and waits for MCP protocol messages.
Testing the Server
Starting the MCP Server
Using with Claude Code
- Add the server to Claude Code:
- Use the tools in Claude Code:
- Register a log source: Use the
register_log_source
tool - Query logs: Use the
query_logs
tool - Analyze logs: Use the
analyze_logs
tool
- Register a log source: Use the
- Access resources:
- Reference resources using
@mcp-log-analyzer:logs://sources
- Get help with prompts like
/mcp__mcp-log-analyzer__log_analysis_quickstart
- Reference resources using
System Monitoring Resources
These resources provide real-time system information without needing to register log sources:
- Check System Processes:
- Access via
@mcp-log-analyzer:system://process-list
- Shows top processes by CPU usage with memory information
- Access via
- Windows Event Logs (Windows only):
- Default:
@mcp-log-analyzer:system://windows-event-logs
(last 10 entries) - By count:
@mcp-log-analyzer:system://windows-event-logs/last/50
(last 50 entries) - By time:
@mcp-log-analyzer:system://windows-event-logs/time/30m
(last 30 minutes) - By range:
@mcp-log-analyzer:system://windows-event-logs/range/2025-01-07 13:00/2025-01-07 14:00
- Shows System and Application event log entries
- Default:
- Linux System Logs (Linux only):
- Default:
@mcp-log-analyzer:system://linux-logs
(last 50 lines) - By count:
@mcp-log-analyzer:system://linux-logs/last/100
(last 100 lines) - By time:
@mcp-log-analyzer:system://linux-logs/time/1h
(last hour) - By range:
@mcp-log-analyzer:system://linux-logs/range/2025-01-07 13:00/2025-01-07 14:00
- Shows systemd journal, syslog, and common application logs
- Default:
- Network Monitoring (Cross-platform):
- Default:
@mcp-log-analyzer:system://netstat
(listening ports) - Listening ports:
@mcp-log-analyzer:system://netstat/listening
- Established connections:
@mcp-log-analyzer:system://netstat/established
- All connections:
@mcp-log-analyzer:system://netstat/all
- Network statistics:
@mcp-log-analyzer:system://netstat/stats
- Routing table:
@mcp-log-analyzer:system://netstat/routing
- Port-specific:
@mcp-log-analyzer:system://netstat/port/80
- Uses netstat on Windows, ss (preferred) or netstat on Linux
- Default:
Time Format Examples:
- Relative time:
30m
(30 minutes),2h
(2 hours),1d
(1 day) - Absolute time:
2025-01-07 13:00
,2025-01-07 13:30:15
,07/01/2025 13:00
Example Workflow
- Register a Windows System Log:
- Query Recent Errors:
- Analyze Patterns:
- Register an ETL File:
Development
Project Structure
src/mcp_log_analyzer/
: Main packagemcp_server/
: MCP server implementation using FastMCPcore/
: Core functionality and modelsparsers/
: Log parsers for different formats
main.py
: Server entry point.mcp.json
: MCP configurationtests/
: Test files
Requirements
- Python 3.12+
- Windows OS (for Event Log support)
- See
pyproject.toml
for full dependencies
License
MIT
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A Model Context Protocol server that analyzes various log types on Windows systems, allowing users to register, query, and analyze logs from different sources including Windows Event Logs, ETL files, and structured/unstructured text logs.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools for analyzing text documents, including counting words and characters. This server helps LLMs perform text analysis tasks by exposing simple document statistics functionality.Last updated -144110JavaScriptApache 2.0
- -securityAlicense-qualityA Model Context Protocol server that provides file system operations, analysis, and manipulation capabilities through a standardized tool interface.Last updated -4TypeScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that captures and manages stdout logs through named pipes, making application output available for querying and debugging in AI tools like Cursor IDE.Last updated -14284TypeScript
- AsecurityAlicenseAqualityA comprehensive Model Context Protocol server providing access to 70+ IT tools for developers and system administrators, including encoding/decoding, text manipulation, hashing, and network utilities.Last updated -764006TypeScriptMIT License