Log Analyzer MCP server

Analyzes Windows Event Logs, ETL files, structured logs, and unstructured text through specialized parsers with caching, providing real-time system monitoring, log source registration, filtering, pagination, and automated pattern and anomaly detection across multiple log formats.
Back to servers
Setup instructions
Provider
Steve Edwards
Release date
Jul 24, 2025
Language
Python
Stats
2 stars

The MCP Log Analyzer is a powerful tool for analyzing various log types on Windows systems using the Model Context Protocol. It supports multiple log formats including Windows Event Logs, Event Trace Logs, and structured logs like JSON and CSV.

Installation

Basic Installation

# Clone the repository
git clone https://github.com/your-username/mcp-log-analyzer.git
cd mcp-log-analyzer

# Install the package
pip install -e .

# For ETL file support (optional)
pip install -e ".[etl]"

Windows-Specific Setup

On Windows, the package includes Windows Event Log support via pywin32:

# Ensure Windows dependencies are installed
pip install pywin32>=300

# Test the setup
python test_windows_setup.py

# If successful, start the server
python main.py

Note: You may need to run the post-install script after installing pywin32:

python Scripts/pywin32_postinstall.py -install

Usage

Starting the MCP Server

MCP servers communicate via stdin/stdout with MCP clients like Claude Code. The server runs silently, waiting for protocol messages:

# Run directly
python main.py

# Or add to Claude Code
claude mcp add mcp-log-analyzer python main.py

Testing the Server

# Verify the server is working
python check_server.py

# See usage instructions
python check_server.py --usage

Integrating with Claude Code

  1. Add the server:

    claude mcp add mcp-log-analyzer python /path/to/main.py
    
  2. Use the available tools:

    • register_log_source: Register new log sources
    • list_log_sources: View all registered sources
    • get_log_source: Get details about a specific source
    • delete_log_source: Remove a log source
    • query_logs: Query logs with filters and pagination
    • analyze_logs: Perform analysis (summary, pattern, anomaly)
  3. Access resources:

    • View registered sources: @mcp-log-analyzer:logs://sources
    • Learn about log types: @mcp-log-analyzer:logs://types
    • Get analysis options: @mcp-log-analyzer:logs://analysis-types

System Monitoring Resources

Access real-time system information without registering log sources:

Process Monitoring

@mcp-log-analyzer:system://process-list

Shows top processes by CPU usage with memory information.

Windows Event Logs (Windows only)

# Default (last 10 entries)
@mcp-log-analyzer:system://windows-event-logs

# Last 50 entries
@mcp-log-analyzer:system://windows-event-logs/last/50

# Last 30 minutes
@mcp-log-analyzer:system://windows-event-logs/time/30m

# Specific time range
@mcp-log-analyzer:system://windows-event-logs/range/2025-01-07 13:00/2025-01-07 14:00

Linux System Logs (Linux only)

# Default (last 50 lines)
@mcp-log-analyzer:system://linux-logs

# Last 100 lines
@mcp-log-analyzer:system://linux-logs/last/100

# Last hour
@mcp-log-analyzer:system://linux-logs/time/1h

# Specific time range
@mcp-log-analyzer:system://linux-logs/range/2025-01-07 13:00/2025-01-07 14:00

Network Monitoring (Cross-platform)

# Default (listening ports)
@mcp-log-analyzer:system://netstat

# 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 information
@mcp-log-analyzer:system://netstat/port/80

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

1. Register a Windows System Log

Use register_log_source tool with:
- name: "system-logs"
- source_type: "evt"
- path: "System"

2. Query Recent Errors

Use query_logs tool with:
- source_name: "system-logs"
- filters: {"level": "Error"}
- limit: 10

3. Analyze Patterns

Use analyze_logs tool with:
- source_name: "system-logs"
- analysis_type: "pattern"

4. Register an ETL File

Use register_log_source tool with:
- name: "network-trace"
- source_type: "etl"
- path: "C:\\Traces\\network.etl"

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-log-analyzer" '{"command":"python","args":["main.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-log-analyzer": {
            "command": "python",
            "args": [
                "main.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-log-analyzer": {
            "command": "python",
            "args": [
                "main.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later