MCP server for libSQL/Turso (local files and remote databases) with read-only guardrails, row caps, and statement timeouts
Project description
database-mcp-libsql
MCP server giving AI clients safe, structured access to a libSQL database: a local file or a remote libSQL/Turso server. Two tools, guardrails on by default.
Quick start (Claude Desktop / Claude Code / Cursor)
{
"mcpServers": {
"libsql": {
"command": "uvx",
"args": ["database-mcp-libsql", "--dsn", "libsql://your-db.turso.io"],
"env": { "LIBSQL_AUTH_TOKEN": "your-token" }
}
}
}
For a local file, use --dsn /absolute/path/to/database.db and skip the token.
Configuration
Connection
- Flag:
--dsn <file-or-libsql-url> - Environment:
LIBSQL_URL - Config file:
connection.dsnin--config /path/to/database-mcp.yaml
Auth token (remote servers)
Three ways, strongest first:
LIBSQL_AUTH_TOKEN_FILE=/run/secrets/token(file contents, never in the environment or any committed file)LIBSQL_AUTH_TOKEN=...- In YAML:
connection.password: ${LIBSQL_AUTH_TOKEN}(env expansion, never a literal)
The token is held in a non-printable type and redacted from all output.
Tools
execute_sql: run a single SQL statement. Returns a summary line and compact JSON{columns, rows}.search_objects: list tables with estimated row counts, or describe one table (columns, indexes, foreign keys).
Guardrails
- Read-only by default, enforced twice: a SQL guard plus
PRAGMA query_only = ON. Remote servers may not honor the pragma; use a read-only Turso token for real protection. Pass--allow-writeto enable writes. - Results capped at
maxRows(default 1000,MAX_ROWS). - Statements exceeding
queryTimeoutMs(default 30000,QUERY_TIMEOUT_MS) are aborted.
Full contract: docs/tool-contract.md
mcp-name: io.github.arifulislamat/database-mcp-libsql
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file database_mcp_libsql-0.1.0.tar.gz.
File metadata
- Download URL: database_mcp_libsql-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02dcd185ccb28679e8d593c7f3423c8651865221babbd421d1635941049a364e
|
|
| MD5 |
600ab3fca75dcc0697413740a44e74a9
|
|
| BLAKE2b-256 |
bc8a9c0cb0866e1e08bc99f73b926b25359a72f2fa145f2c4d4421cb7de3112f
|
File details
Details for the file database_mcp_libsql-0.1.0-py3-none-any.whl.
File metadata
- Download URL: database_mcp_libsql-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e5c33716f94ea1019abd13145899efe2a8be0672ef6fe7947ee8d02c6dbfc5d
|
|
| MD5 |
c3a7377d7a1f4707396807d5f1d059a0
|
|
| BLAKE2b-256 |
e6f3ac2a53513b0cc6f5cac05d06702d8c59ea66d9b36a0c3c72d39ee2bb27fc
|