SQLite MCP サーバーによるログ分析
このプロジェクトは、圧縮されたログ ファイルから SQLite データベースを作成し、Model Context Protocol (MCP) SQLite サーバーを使用してそのデータベースと対話するためのツールを提供します。
インストール手順
ログ ファイルを .gz ファイルとしてフォルダーに配置し、次を実行します。
MCP SQLite サーバー
カーソルでMCP SQLiteサーバーを構成するには、
カーソル設定
MCP
新しいMCPサーバーを追加
名前
SQLlite
タイプを
command
に設定するこれをコマンドボックスに入れてください
コンテンツ
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
スクリプトを使用してデータベースを直接クエリできます。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
モデル コンテキスト プロトコルを介して SQLite データベースに保存されているログ データをクエリできるようにし、ログ分析での自然言語による対話を可能にします。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides database interaction capabilities through SQLite, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos.Last updated -17MIT License
- -securityAlicense-qualityA Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.Last updated -7MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs like Claude to interact with SQLite and SQL Server databases, allowing for schema inspection and SQL query execution.Last updated -3,221204MIT License
- -securityFlicense-qualityA Model Context Protocol server providing tools for SQLite database operations (query, add, update, delete users) and mathematical calculations including basic arithmetic, expression evaluation, and statistical analysis.Last updated -1