log-analysis-mcp-server

dark3rMatt3r/log-analysis-mcp-server

3.1

If you are the rightful owner of log-analysis-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The MCP Log Analysis Server is designed to analyze logs from Spring/SpringBoot web applications running on Tomcat or Jetty, providing insights into application behavior and performance.

Tools
3
Resources
0
Prompts
0

MCP Log Analysis Server

A Model Context Protocol (MCP) server for analyzing logs from Spring/SpringBoot web applications running on Tomcat or Jetty.

Features

  • Parse Spring Boot and Tomcat log formats
  • Detect application startup patterns
  • Identify error patterns and anomalies
  • Calculate log statistics
  • RESTful API for log analysis
  • Domain-Driven Design architecture
  • Comprehensive test coverage with JUnit 5

Quick Start

Prerequisites

  • Java 17 or higher
  • Maven 3.8+

Building

mvn clean compile

Running Tests

# Unit tests only
mvn test

# Integration tests
mvn verify -P integration-tests

# With coverage
mvn test -P coverage

Running the Application

# Development mode
mvn spring-boot:run -Dspring-boot.run.profiles=dev

# Production JAR
mvn clean package
java -jar target/mcp-log-analysis-server-1.0.0.jar

Docker

# Build image
docker build -t mcp-log-analysis-server .

# Run with docker-compose
docker-compose up -d

Usage

The server implements the Model Context Protocol and provides three main tools:

  1. analyze_log_file - Analyze a log file from filesystem
  2. analyze_log_content - Analyze log content directly
  3. get_analysis_result - Retrieve previous analysis results

Sample Log Formats Supported

Spring Boot Format:

2024-01-01 10:00:00.123  INFO 12345 --- [main] com.example.Application : Starting Application

Tomcat Format:

01-Jan-2024 10:00:00.123 INFO [main] org.apache.catalina.startup.Catalina Starting Tomcat

Architecture

The project follows Domain-Driven Design principles:

  • Domain Layer: Core business logic and entities
  • Application Layer: Use cases and application services
  • Infrastructure Layer: External concerns (persistence, parsing)
  • Interface Layer: MCP protocol implementation

Testing Strategy

  • Unit tests for domain logic
  • Integration tests for components
  • Performance tests for large datasets
  • Test data builders for maintainability

Contributing

  1. Follow the existing code style (Google Java Format)
  2. Ensure all tests pass
  3. Maintain test coverage above 80%
  4. Update documentation as needed

License

MIT License