read-queryLABSCO SUMMARY
The read tool cannot write, and that is enforced rather than requested.
read-query rejects anything that is not a SELECT, refuses system tables, and blocks multi-statement queries and UNION-based injection — so a compromised prompt cannot turn a read into a write. Writes and DDL run inside a transaction that rolls back on error, which means a failed migration leaves the schema as it was.
What it is
A libSQL database server for MCP clients. It splits the SQL surface by intent — a tool that only runs SELECT, one that only runs INSERT, UPDATE and DELETE, and separate DDL tools — and validates each against the operations it is allowed to perform.
What you get
- read-query — SELECT only, with parameterised values, blocked from system tables and multi-statement queries
- write-query — INSERT, UPDATE or DELETE, wrapped in a transaction by default and rolled back on error
- create-table — CREATE TABLE with optional IF NOT EXISTS and a transaction wrapper
- alter-table — ADD COLUMN, RENAME TABLE and RENAME COLUMN
- list-tables — database objects with a LIKE filter, optionally including views and indexes, as a table, list or JSON
- describe-table — columns, types, nullability, defaults and keys, with indexes and foreign keys on request
- Every response reports the operation, the rows affected and how long it took
Requirements
Node with the package installed globally as @xexr/mcp-libsql. The database is passed as a URL on the command line with --url, which accepts a local file path; --log-mode console is useful when testing outside a client.
Setup effort
One command — npm install -g @xexr/mcp-libsql
USE CASES
Exploring a database you were handed
List the objects with a name filter, then read the columns, indexes and foreign keys of the interesting ones.
Answering a question from the data
Run a parameterised SELECT and read the rows and timing back.
Adding a column safely
Run the ALTER inside a transaction so a failure leaves the table untouched.
Seeding a new table
Create the table with IF NOT EXISTS, then insert the rows with parameters.
6 tools
Listed in project docs. Your client may show a different list.
write-querycreate-tablealter-tablelist-tablesdescribe-tableBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation.
Requires
Node.js 20+
Optional
LIBSQL_AUTH_TOKEN in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
npm install -g @xexr/mcp-libsqlMCP Clients
Claude Desktop
{
"mcpServers": {
"mcp-libsql": {
"command": "mcp-libsql",
"args": [
"--url",
"file:///Users/<YOUR_USERNAME>/database.db"
]
}
}
}A local file: database needs no token. For a Turso (or other credentialed) database, set --url to its libsql:// address and export LIBSQL_AUTH_TOKEN before starting your client — or pass --auth-token in args; the README prefers the environment variable.