plan_tool_callsLABSCO SUMMARY
Approval is inside the loop, not bolted on afterwards.
Generated SQL is shown before it runs, and even the convenience tool that does the whole decision loop locally still stops for approval. Schema memory keeps metadata and never rows, and the model runs on your own Ollama instance — which is the point of the design: the credentials and the data both stay where they are.
What it is
A Python CLI and MCP server for read-oriented database work. It discovers the schema, remembers it, generates SQL, shows that SQL for approval, runs the approved statement and summarises the result — with the model call going to a local Ollama instance rather than a hosted API.
What you get
- Schema discovered and stored as a local snapshot at
.db-insight/schema_memory.json, so later questions do not rediscover the same structure —discover_schema,refresh_schema_memory,schema_memory_status,catalog_overview,inspect_table - SQL generated for a question, explained, and executed only after approval —
generate_safe_sql,explain_sql,run_approved_sql - The whole loop in one call when you want it, still requiring explicit approval before execution —
ask_database,plan_tool_calls - Schema memory that holds metadata only, never table rows
Requirements
A connection string in DATABASE_URL for Postgres or SQLite, plus DB_INSIGHT_MODEL and DB_INSIGHT_OLLAMA_URL for the local model. Install into a venv with pip install -e ".[dev]", or run the published image ghcr.io/enclavex-labs/db-insight:latest and ollama pull gemma3:latest on the host. For team use, db-insight mcp --transport streamable-http with DB_INSIGHT_MCP_HOST and DB_INSIGHT_MCP_PORT serves at /mcp — put it behind your own auth, VPN or private network. The project's stated positioning is a read-only replica, an analytics database or staging, not production.
Setup effort
One command plus credentials — docker pull ghcr.io/enclavex-labs/db-insight:latest, then supply credentials
USE CASES
Investigating a number that moved
Ask why revenue dropped last week, read the SQL it proposes, and approve it once the joins look right.
Getting oriented in an unfamiliar schema
Pull the catalogue overview and inspect the tables that matter before writing a single query.
Letting an analyst self-serve on a replica
Serve it over HTTP behind your own network controls, pointed at a read-only replica rather than the primary.
Refreshing after a migration
Re-run schema discovery so the model stops planning against columns that no longer exist.
10 tools
Listed in project docs. Your client may show a different list.
discover_schemarefresh_schema_memoryschema_memory_statuscatalog_overviewinspect_tableexplain_sqlgenerate_safe_sqlrun_approved_sqlask_databaseBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
- docker on PATH
- DATABASE_URL in your environment
Where it runs
All 3 documented setups run the server on your machine.
INSTALLATION
Connect your client
Server setup
docker pull ghcr.io/enclavex-labs/db-insight:latestMCP Clients
Any MCP client — Docker, Postgres
{
"mcpServers": {
"db-insight": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--add-host=host.docker.internal:host-gateway",
"-e",
"DATABASE_URL",
"-e",
"DB_INSIGHT_MODEL",
"-e",
"DB_INSIGHT_OLLAMA_URL",
"ghcr.io/enclavex-labs/db-insight:latest"
],
"env": {
"DATABASE_URL": "postgresql://readonly:<YOUR_DB_PASSWORD>@host.docker.internal:5432/app_db",
"DB_INSIGHT_MODEL": "gemma3:latest",
"DB_INSIGHT_OLLAMA_URL": "http://host.docker.internal:11434"
}
}
}
}Any MCP client — Docker, SQLite
{
"mcpServers": {
"db-insight": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--add-host=host.docker.internal:host-gateway",
"-v",
"<YOUR_PATH_TO_DATA>:/data:ro",
"-e",
"DATABASE_URL",
"-e",
"DB_INSIGHT_MODEL",
"-e",
"DB_INSIGHT_OLLAMA_URL",
"ghcr.io/enclavex-labs/db-insight:latest"
],
"env": {
"DATABASE_URL": "sqlite:////data/app.sqlite",
"DB_INSIGHT_MODEL": "gemma3:latest",
"DB_INSIGHT_OLLAMA_URL": "http://host.docker.internal:11434"
}
}
}
}GitHub Copilot in VS Code
{
"servers": {
"db-insight": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--add-host=host.docker.internal:host-gateway",
"-e",
"DATABASE_URL",
"-e",
"DB_INSIGHT_MODEL",
"-e",
"DB_INSIGHT_OLLAMA_URL",
"ghcr.io/enclavex-labs/db-insight:latest"
],
"env": {
"DATABASE_URL": "postgresql://readonly:<YOUR_DB_PASSWORD>@host.docker.internal:5432/app_db",
"DB_INSIGHT_MODEL": "gemma3:latest",
"DB_INSIGHT_OLLAMA_URL": "http://host.docker.internal:11434"
}
}
}
}