SQLite MCP Server

by direkt
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Allows to connect to an SQLite database and query log data through the Model Context Protocol (MCP) server

SQLite MCP 서버를 사용한 로그 분석

이 프로젝트는 압축된 로그 파일에서 SQLite 데이터베이스를 생성하고 MCP(Model Context Protocol) SQLite 서버를 사용하여 해당 데이터베이스와 상호 작용하는 도구를 제공합니다.

설치 지침

지엑스피1

로그 파일을 .gz 파일로 폴더에 넣은 다음, 다음을 실행합니다.

python3 create_log_db.py

MCP SQLite 서버

커서에서 MCP SQLite 서버를 구성하려면

  • 커서 설정
  • 엠씨피
  • 새로운 MCP 서버 추가
  • 이름 SQLlite
  • command 유형을 설정하세요
  • 이것을 명령 상자에 넣으세요
npx -y @smithery/cli@latest run mcp-server-sqlite-npx --config "{\"databasePath\":\"/path/to/thedatbase/logs.db\"}"

내용물

  • create_log_db.py : 로그 파일을 추출하여 SQLite 데이터베이스로 구문 분석하는 스크립트
  • query_logs.py : SQLite 데이터베이스를 직접 쿼리하는 스크립트
  • logs.db : 구문 분석된 로그 데이터를 포함하는 SQLite 데이터베이스

데이터베이스 구조

데이터베이스에는 다음과 같은 테이블이 포함되어 있습니다.

logs 테이블

  • id : 각 로그 항목에 대한 고유 식별자
  • timestamp : 로그 항목의 타임스탬프
  • thread : 로그를 생성한 스레드
  • level : 로그 레벨(INFO, WARN, ERROR, DEBUG)
  • module : 로그를 생성한 모듈
  • message : 로그 메시지 내용
  • source_file : 소스 로그 파일
  • raw_log : 원시 로그 항목

stack_traces 테이블

  • id : 각 스택 추적에 대한 고유 식별자
  • log_id : 이 스택 추적이 속한 로그 항목에 대한 참조
  • stack_trace : 전체 스택 추적 텍스트

parsing_errors 테이블

  • id : 각 구문 분석 오류에 대한 고유 식별자
  • line : 구문 분석할 수 없는 줄
  • source_file : 소스 로그 파일
  • error_message : 구문 분석에 실패한 이유를 설명하는 오류 메시지
  • timestamp : 구문 분석 오류가 발생한 시간

query_logs.py 스크립트를 사용하여 데이터베이스를 직접 쿼리할 수 있습니다.

-
security - not tested
F
license - not found
-
quality - not tested

모델 컨텍스트 프로토콜을 통해 SQLite 데이터베이스에 저장된 로그 데이터를 쿼리하여 로그 분석과 자연어 상호작용을 가능하게 합니다.

  1. Install instructions
    1. MCP SQLite Server
      1. Contents
        1. Database Structure
          1. logs Table
          2. stack_traces Table
          3. parsing_errors Table
        ID: rw4usp6sv6