litedb-mcp

v0.1.7
litedb-mcp Checked 3 hours ago Published 21 days ago

MCP server exposing a local SQLite or PostgreSQL database through LiteDB's write-safety layer

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_tables List tables

Every table in the database, with its column count, approximate row count and primary key. The place to start.

describe_table Describe a table

Columns and types for one table, with primary keys, NOT NULL, defaults, foreign keys, indexes, and, for low-cardinality text columns, the distinct values they actually contain. Read this before writing SQL against a table you have not seen.

ParameterTypeDescription
table *stringTable name. Case-insensitive.
include_sample_valuesbooleanInclude a few distinct values for enumerated columns (default true). These are real values from the table.

query Run SQL

Run SQL against the database. A read executes and returns rows. Anything that would change the database does NOT execute: it comes back classified, with the number of rows it would affect and the query plan, plus a single-use token for execute_approved. A statement the policy forbids is refused and says why.

ParameterTypeDescription
sql *stringOne or more SQL statements, separated by semicolons.

execute_approved Execute an approved statement

Second step, after query. Runs the statements a previous `query` call previewed. Takes only the token, the SQL is held server-side, so what runs is exactly what was previewed. Single-use, and expires five minutes after the preview. Confirm the row count with the person you are working for before calling this. While LiteDB is open, the request appears in its window and nothing runs until they approve it there: a call can come back WAITING, and then you call again with the same token once they have answered.

ParameterTypeDescription
token *stringThe token from the query tool's preview.

write Write in one call

Run a write in one call, where the person has allowed that for this connection in LiteDB (Settings → Agents): an INSERT of listed rows, or an UPDATE or DELETE with a WHERE clause, that changes no more rows than the limit they set. The limit is checked before it runs and enforced while it runs. Anything else, or any write when it is not allowed, comes back as a preview with a token for execute_approved, exactly as from query, with the reason it did not run.

ParameterTypeDescription
sql *stringOne or more SQL statements, separated by semicolons.

list_vector_columns List pgvector columns

Vector columns in the database and their dimensions. PostgreSQL with the pgvector extension only.

audit_log Read the audit log

The most recent statements recorded against this database, newest first , from this server and from the LiteDB desktop app, which share the file. Shows what was proposed, what was approved, and what ran.

ParameterTypeDescription
limitintegerDefault 20.