Tablyn

SQLite for AI agents,
built in Rust.

A high-quality SQLite MCP server. Every meaningful SQLite capability surfaced as a discoverable tool with structured JSON output — safe for many agents to share one database file.

tablyn
$ curl -fsSL https://dl.velaintelligence.com/tablyn/latest/install.sh | sh

Then register with your AI: tablyn config add claude-code · tablyn config add codex · tablyn config add all --global

Full SQLite surface

Query, execute, transactions, schema introspection, EXPLAIN plans, PRAGMAs, VACUUM, ANALYZE, integrity checks — every meaningful SQLite capability exposed as its own tool.

Structured JSON output

Every tool returns predictable JSON. Rows, schemas, plans, and pragmas come back in shapes a model can parse without scraping text. BLOBs round-trip as { "$blob_b64": "..." }.

Many agents, one file

Opens databases with journal_mode=WAL and synchronous=NORMAL, so multiple tablyn processes can safely share the same SQLite file — many concurrent readers, one writer at a time.

Reader pool + single writer

One serialized writer connection plus a pool of reader connections. Read-only tools execute concurrently with each other and with the writer — fast for indexed lookups, safe for mutations.

Safe by default

Extension loading is off unless you pass --allow-extensions. Foreign keys on. safe_query rejects anything that would mutate the database, even in read/write mode.

Saved scripts

Persist named SQL scripts inside the database itself with bind parameters and run-time stats. save_script, list_scripts, run_script — building blocks for agent workflows that survive restarts.

Backup & portability

Online backup through SQLite's backup API, .dump-style SQL export, and JSON import/export — to memory, to disk, or directly to another tablyn-managed database.

Inspect, profile, sample

inspect_database, profile_table, sample_table, find_tables, table_dependencies — high-level introspection tuned for agents that need to learn an unfamiliar schema fast.

Single static binary

Bundled SQLite, zero runtime dependencies. tablyn install drops the binary into ~/.local/bin and tablyn config add non-destructively edits each AI tool's config file.

35 tools, one binary

backup Online backup through SQLite's backup API — safe to run while the database is in use.
close_database Release a previously opened handle. Reader pool and writer connection are torn down cleanly.
create_database Create a new database file at a given path and bind it under a handle name.
database_info SQLite version, page size, page count, encoding, journal mode, attached schemas, and file size.
delete_script Remove a saved script from the database.
describe_table Columns, foreign keys, indexes, and CREATE SQL for a single table — everything you need in one call.
execute Run a single non-row-returning statement. Returns rows_affected and last_insert_rowid.
execute_batch Run a multi-statement SQL script in one call. Useful for migrations and seed data.
explain Return the EXPLAIN bytecode for a statement — every SQLite opcode and operand.
explain_query_plan Return the EXPLAIN QUERY PLAN tree — how SQLite intends to satisfy the query, index by index.
export_json Export a table or query result as JSON — to the tool's response, or directly to a file path.
find_tables Locate tables matching a pattern across attached databases, with column hints.
get_schema JSON view of the schema — tables, columns, types, defaults, foreign keys — for fast model consumption.
get_script Fetch a saved script — its SQL, parameters, and stats — for review before running.
import_json Bulk-insert JSON rows into a table. Creates the table from the data if it does not yet exist.
inspect_database High-level summary — tables, views, indexes, row counts, page stats — in one call. Great as the first step on an unfamiliar database.
list_indexes List indexes for one table or the whole database, including the columns covered.
list_open_databases Enumerate every currently bound database handle — name, path, read-only flag.
list_scripts List saved scripts with their kind (statement vs query), creation time, last run, and run count.
list_tables List user tables in the database, with optional inclusion of sqlite_* internals.
list_triggers List triggers with their event, target table, and full body.
list_views List views with their CREATE statements.
load_extension Load a SQLite runtime extension. Gated behind --allow-extensions at startup.
open_database Open an existing database file (or :memory:) and bind it under a handle name.
profile_table Column-level profile: nulls, distinct counts, min, max, mean, and a small histogram per column.
query Run a SQL statement and return rows. Supports ? positional and :name named bind parameters.
run_script Execute a saved script with bound parameters. Updates run-time stats on success.
safe_query Read-only convenience wrapper — rejects anything that would mutate the database, even when tablyn is in read/write mode.
sample_table Return a representative sample of rows from a table — head, tail, or random — for quick reconnaissance.
save_script Persist a named SQL script inside the database with bind parameters and a description. Versioned with timestamps.
schema_sql Concatenated CREATE statements for the entire database — drop-in schema export.
sql_dump .dump-style SQL export — schema and data as portable CREATE / INSERT statements.
sql_restore Replay a SQL dump into the current database. Mirror of sql_dump.
table_dependencies Resolve foreign-key dependencies between tables. Topological view of the schema graph.
transaction Run a sequence of statements atomically inside BEGIN IMMEDIATE … COMMIT with automatic rollback on error.