Skip to main content
Glama
yufeizhou666

log-analyzer-mcp

by yufeizhou666

log-analyzer-mcp

로그 분석 및 시스템 메트릭 도구를 제공하는 MCP(Model Context Protocol) 서버입니다. stdio 전송을 통해 Claude Code에 연결되며, 로컬 로그 파일을 검색, 카운팅 및 분석하기 위한 5가지 도구를 제공합니다.

기능

도구

설명

search_logs

키워드 또는 정규식 패턴으로 로그 파일 검색

count_by_level

심각도 수준(ERROR/WARN/INFO/DEBUG)별 로그 항목 수 계산

query_by_timerange

특정 시간 범위 내의 로그 필터링

get_system_metrics

CPU, 메모리 및 디스크 사용량 메트릭 가져오기

explain_error

AI 지원 분석을 위해 오류 내용 형식 지정

빠른 시작

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run the server
npm start

개발

# Run with hot reload
npm run dev

Claude Code와 통합

Claude Code에 서버 추가:

# Project-level (only available in this directory)
claude mcp add log-analyzer -- node /path/to/log-analyzer-mcp/dist/index.js

# User-level (available globally)
claude mcp add log-analyzer --scope user -- node /path/to/log-analyzer-mcp/dist/index.js

연결 확인:

claude mcp list

도구 세부 정보

search_logs

키워드 또는 정규식으로 로그 파일을 검색합니다. 단일 .log 파일 또는 전체 디렉토리 검색을 지원합니다.

{
  "keywords": ["ERROR", "timeout"],
  "regex": "connection.*failed",
  "logPath": "/var/log",
  "limit": 100
}

count_by_level

심각도 수준별로 로그 항목을 계산하며, 선택적으로 시간 범위별로 필터링할 수 있습니다.

{
  "logPath": "/var/log",
  "startTime": "2026-04-29T00:00:00Z",
  "endTime": "2026-04-30T00:00:00Z"
}

query_by_timerange

특정 시간 범위 내의 로그를 필터링하며, 선택적으로 수준 필터를 적용할 수 있습니다.

{
  "startTime": "2026-04-29T00:00:00Z",
  "endTime": "2026-04-30T00:00:00Z",
  "logPath": "/var/log",
  "level": "ERROR",
  "limit": 100
}

get_system_metrics

CPU, 메모리 및 디스크 메트릭을 가져옵니다. Windows 및 Linux를 지원합니다.

{
  "metrics": ["cpu", "memory", "disk"]
}

explain_error

AI 지원 근본 원인 분석을 위해 오류 내용을 형식화합니다.

{
  "errorContent": "java.lang.NullPointerException\n  at com.example.Service.process(Service.java:42)",
  "contextLines": 10
}

아키텍처

src/
├── index.ts           # MCP Server entry point
├── tools/             # Individual MCP tool implementations
├── utils/
│   ├── log_parser.ts  # Timestamp/level parsing, keyword/regex matching
│   └── metrics.ts     # Cross-platform CPU/memory/disk metrics
└── types/             # TypeScript type definitions

이 서버는 StdioServerTransport와 함께 @modelcontextprotocol/sdk를 사용합니다. 도구는 CallToolRequestSchema 핸들러를 통해 등록됩니다.

주요 설계 결정

  • 스트림 처리: readline + createReadStream을 사용하여 대용량 로그 파일을 메모리에 완전히 로드하지 않고 처리합니다.

  • 크로스 플랫폼: 런타임 플랫폼 감지를 통해 Windows(WMIC) 및 Linux(top/free/df) 이중 경로 구현

  • 허용적 파싱: 비표준 로그 형식은 삭제되지 않고 보존됩니다(수준이 누락된 경우 INFO로 기본 설정, 타임스탬프가 누락된 경우 현재 시간으로 기본 설정).

라이선스

MIT

Install Server
F
license - not found
B
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yufeizhou666/my_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server