litedb-mcp
v0.1.7MCP 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.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name. Case-insensitive. |
include_sample_values | boolean | Include 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.
| Parameter | Type | Description |
|---|---|---|
sql * | string | One 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.
| Parameter | Type | Description |
|---|---|---|
token * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
sql * | string | One 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.
semantic_search Semantic search
Nearest-neighbour search over a pgvector column. Give `text` to search by meaning, it is embedded by a model running on this machine, so the text never leaves it, or `row_id` to find rows similar to an existing one. The first text search downloads the embedding model (~23 MB for the default) and may take a minute.
| Parameter | Type | Description |
|---|---|---|
column * | string | The vector column to search. |
table * | string | Table holding the vector column. |
limit | integer | Default 10. |
metric | string | Distance operator: cosine (default), L2, or inner product. |
row_id | string | Primary key of a row to find neighbours of. |
text | string | Text to search for. Embedded locally. Not with row_id. |
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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Default 20. |