home / mcp / sqllite mcp server
Provides an MCP server to access an SQLite database of parsed logs via a local CLI command.
Configuration
View docs{
"mcpServers": {
"direkt-mcp-test": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"mcp-server-sqlite-npx",
"--config",
"{\"databasePath\":\"/path/to/thedatbase/logs.db\"}"
]
}
}
}You can create an SQLite database from compressed log files and access it through an MCP SQLite server. This setup lets you store, query, and analyze logs efficiently using a lightweight MCP interface that runs locally.
You interact with the MCP SQLite server through an MCP client. The server exposes your parsed log data via the standard MCP workflows, so you can run queries and retrieve structured results against the logs, stack_traces, and parsing_errors tables.
With the server running, you can explore the following data sources and actions: create or inspect the SQLite database containing parsed log data; query for specific timestamps, levels, modules, or messages; review associated stack traces for errors; and identify parsing issues that occurred during log ingestion.
Prerequisites: you need Node.js and npm or npx installed to run the MCP server command. You also need Python only if you plan to reproduce the log parsing utilities locally.
Install the local tooling and dependencies using the following command sequence.
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
```
Place log files in the folder as .gz files, then run:
```
python3 create_log_db.pyConfiguration for the MCP SQLite server uses a remote command issued through npx to start the server in the MCP environment. The command to launch the MCP server is shown here as the exact snippet you should execute in your MCP client. The server expects a database path where the SQLite file will be stored.
npx -y @smithery/cli@latest run mcp-server-sqlite-npx --config "{\"databasePath\":\"/path/to/thedatbase/logs.db\"}"Contents of the project include scripts to build and query the database:
- create_log_db.py: Script to extract and parse log files into an SQLite database
- query_logs.py: Script to directly query the SQLite database
- logs.db: SQLite database containing parsed log data
The MCP server is configured to run via a standard stdio command that executes a local CLI tool. Use the exact command shown in the configuration snippet when starting the server from your MCP client.
Parses compressed log files (.gz) from a folder and inserts the extracted data into an SQLite database as the logs, stack_traces, and parsing_errors tables.
Provides direct querying capabilities against the SQLite database to retrieve logs, stack traces, and parsing errors.