Error Analyzer MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
pip install -r requirements.txt
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add error-analyzer -- python "<FULL_PATH_TO_MCP>/dist/index.js"

Replace <FULL_PATH_TO_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Analyzes log files to identify root causes and generate fix plans.

Error Analyzer MCP Server 🔧

A specialized Model Context Protocol (MCP) server that analyzes errors in your projects, identifies root causes, and generates detailed fix plans with a built-in approval workflow before applying any changes.

🌟 Overview

When your project encounters errors, this MCP server helps you:

  • Read and analyze log files to understand what went wrong
  • Identify the affected files and their dependencies
  • Diagnose the root cause of errors
  • Create detailed fix plans with step-by-step solutions
  • Request your approval before making ANY file modifications
  • Apply approved fixes safely to your project

This server emphasizes safety and transparency: it never modifies your files without your explicit approval and clear understanding of what will change.

🏗️ Architecture

  • Reads log files from a configurable logger directory
  • Analyzes error messages and stack traces
  • Identifies related files and dependencies
  • Generates fix plans with risk assessment
  • Implements a two-phase workflow:
    1. Analysis & Planning Phase: Creates fix plans
    2. Approval Phase: Waits for your explicit approval
    3. Application Phase: Applies approved changes

🛠️ Available Tools

1. `list_available_logs`

List all log files in your logger directory.

  • Returns all .log files available for analysis

2. `analyze_error`

Analyze errors in a specific log file.

  • Input: project directory path, log file name
  • Returns: error location, root cause, affected files, severity level
  • Creates an analysis ID for further processing

3. `create_fix_plan`

Create a detailed work plan to fix identified errors.

  • Input: analysis ID from previous step
  • Returns: fix plan with proposed fixes, impact assessment, risk level
  • Status: Awaiting your approval
  • Creates a plan ID for tracking

4. `approve_fix_plan`

Approve a fix plan after reviewing the proposed changes.

  • Input: plan ID
  • Effect: Marks the plan as approved
  • Next step: Call apply_fix_plan to make the changes

5. `reject_fix_plan`

Reject a fix plan if you disagree with proposed solutions.

  • Input: plan ID, optional feedback
  • Effect: Cancels the plan
  • Next step: Can request new analysis with different parameters

6. `apply_fix_plan`

Apply the approved fixes to your project files.

  • Input: plan ID (must be approved first)
  • Effect: MODIFIES YOUR PROJECT FILES
  • Returns: List of changes applied
  • Safety: Only works if plan was explicitly approved

7. `get_fix_plan_details`

Retrieve detailed information about a specific fix plan.

  • Useful for reviewing plans before approval

8. `list_pending_plans`

See all fix plans created in this session with their statuses.

  • Helps track pending approvals and applied fixes

📋 Workflow Example

1. Error occurs in your project
   ↓
2. Error is written to logger/error.log
   ↓
3. Call analyze_error(project_dir="/path/to/project", log_file_name="error.log")
   → Returns: analysis_id = "abc123"
   ↓
4. Call create_fix_plan(analysis_id="abc123")
   → Returns: plan_id = "xyz789"
   → Status: "AWAITING USER APPROVAL"
   ↓
5. Review the proposed fixes in the plan
   ↓
6. Either:
   a) Call approve_fix_plan(plan_id="xyz789") → then apply_fix_plan(plan_id="xyz789")
   b) Call reject_fix_plan(plan_id="xyz789", feedback="...")

🚀 Setup

Installation

  1. Clone or extract the project to your workspace:
cd m:\mcp\mcp-read-log
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment (optional):
# Copy the example file
cp .env.example .env

# Edit .env to customize:
# - LOG_DIR: Path to your logger directory (default: ./logger)
# - PROJECT_DIR: Default project to analyze
# - BACKUP_BEFORE_APPLY: Create backups before applying fixes
  1. Create logger directory if it doesn't exist:
mkdir logger

📖 Usage with Claude or Other AI Agents

In Claude or Cline:

You have access to the error-analyzer-mcp MCP server. When a user's project has errors:

1. First call: list_available_logs() to see what log files are available
2. Then call: analyze_error() with the project path and log file name
3. Review the analysis results
4. Call: create_fix_plan() with the analysis ID
5. Show the user the proposed fixes and ask for approval
6. Only after explicit approval, call: apply_fix_plan()

Example Session:

User: "My Python project is broken with errors"
AI: Calling list_available_logs()... Found: error.log, debug.log
AI: Which log should I analyze? Let me check error.log.
AI: Calling analyze_error(project_dir=".", log_file_name="error.log")
AI: Analysis complete! Found SyntaxError on line 42, affects 3 files.
AI: Calling create_fix_plan()...
AI: Created fix plan. Here are the proposed changes:
   - Fix syntax error in main.py line 42
   - Update import in handler.py line 15
AI: This has LOW risk. Do you approve these changes?
User: "Yes, apply them

Tools (8)

list_available_logsList all log files in your logger directory.
analyze_errorAnalyze errors in a specific log file.
create_fix_planCreate a detailed work plan to fix identified errors.
approve_fix_planApprove a fix plan after reviewing the proposed changes.
reject_fix_planReject a fix plan if you disagree with proposed solutions.
apply_fix_planApply the approved fixes to your project files.
get_fix_plan_detailsRetrieve detailed information about a specific fix plan.
list_pending_plansSee all fix plans created in this session with their statuses.

Environment Variables

LOG_DIRPath to your logger directory
PROJECT_DIRDefault project to analyze
BACKUP_BEFORE_APPLYCreate backups before applying fixes

Configuration

claude_desktop_config.json
{ "mcpServers": { "error-analyzer": { "command": "python", "args": ["path/to/main.py"], "env": { "LOG_DIR": "./logger" } } } }

Try it

List all available log files in the logger directory.
Analyze the error.log file in my current project directory.
Create a fix plan for the error identified in the latest analysis.
Approve the fix plan with ID xyz789 and apply the changes.

Frequently Asked Questions

What are the key features of Error Analyzer?

Analyzes log files to identify root causes of project errors. Generates detailed fix plans with risk assessments. Implements a multi-phase approval workflow for safety. Provides tools to list, analyze, and apply fixes to project files.

What can I use Error Analyzer for?

Automating the diagnosis of recurring application crashes. Reviewing proposed code fixes for syntax errors before implementation. Managing error resolution workflows in a safe, approval-based environment.

How do I install Error Analyzer?

Install Error Analyzer by running: pip install -r requirements.txt

What MCP clients work with Error Analyzer?

Error Analyzer works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Error Analyzer docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare