Skip to main content
Glama

SQLite MCP サーバーによるログ分析

このプロジェクトは、圧縮されたログ ファイルから SQLite データベースを作成し、Model Context Protocol (MCP) SQLite サーバーを使用してそのデータベースと対話するためのツールを提供します。

インストール手順

python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt

ログ ファイルを .gz ファイルとしてフォルダーに配置し、次を実行します。

python3 create_log_db.py

MCP SQLite サーバー

カーソルでMCP SQLiteサーバーを構成するには、

  • カーソル設定

  • MCP

  • 新しい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

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    A 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 -
    18
    MIT License
    • Apple
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.
    Last updated -
    7
    MIT License
  • -
    security
    A
    license
    -
    quality
    A 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 -
    20,126
    243
    MIT License
    • Linux
    • Apple
  • -
    security
    F
    license
    -
    quality
    A 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

View all related MCP servers

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/direkt/mcp-test'

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