Provides AI clients with safe, structured access to libSQL or Turso databases using predefined SQL execution and schema search tools.
Also known as arifulislamat/database-mcp, database-mcp, @database-mcp/libsql
- Stars
- 5
- Tools
- —
- Downloads, 30 days
- 642
- Latest version
- 0.5.0
- Last commit
- Nov 1, 2026
- License
- MIT
What is libSQL MCP?
libSQL provides AI clients with safe, structured access to libSQL or Turso databases using predefined SQL execution and schema search tools.
Summary generated from the project's README
About libSQL MCP server
Connecting AI clients to libSQL or Turso databases is what this server enables through a controlled and structured interface. It provides developers with two specific tools, execute_sql and search_objects, to interact with database schemas and run queries without cluttering the model context window. The server is designed to be safe by default, utilizing a read-only mode, statement timeouts, and row caps to prevent runaway queries or accidental data modification.
Users can set up the server using TypeScript, Python, or Rust implementations. Connection details such as the LIBSQL_URL or LIBSQL_AUTH_TOKEN are provided through environment variables, YAML configuration files, or command line flags rather than through chat prompts. This ensures that sensitive credentials remain secure and are never exposed in logs or passed through the model's conversation history.
What you can do with it
- 1Explore database schemaAsk the AI to list all available tables and their specific columns or foreign keys.
- 2Execute read-only queriesRequest the AI to retrieve specific data from your Turso database using SQL.
- 3Prevent resource exhaustionEnsure that large queries do not crash the client by relying on built-in limits.
Written from the project's README. Every use case is checked against a quote from it.
How to install libSQL MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall libSQL MCP in Claude Code
$ claude mcp add --env 'LIBSQL_URL=<LIBSQL_URL>' --env 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' database-mcp -- npx -y @database-mcp/libsqlInstall libSQL MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"database-mcp": {
"command": "npx",
"args": [
"-y",
"@database-mcp/libsql"
],
"env": {
"LIBSQL_URL": "<LIBSQL_URL>",
"LIBSQL_AUTH_TOKEN": "<YOUR_LIBSQL_AUTH_TOKEN>"
}
}
}
}Install libSQL MCP in VS Code
.vscode/mcp.json
{
"servers": {
"database-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@database-mcp/libsql"
],
"env": {
"LIBSQL_URL": "<LIBSQL_URL>",
"LIBSQL_AUTH_TOKEN": "<YOUR_LIBSQL_AUTH_TOKEN>"
}
}
}
}Install libSQL MCP in VS Code CLI
$ code --add-mcp '{"name":"database-mcp","type":"stdio","command":"npx","args":["-y","@database-mcp/libsql"],"env":{"LIBSQL_URL":"<LIBSQL_URL>","LIBSQL_AUTH_TOKEN":"<YOUR_LIBSQL_AUTH_TOKEN>"}}'Install libSQL MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"database-mcp": {
"command": "npx",
"args": [
"-y",
"@database-mcp/libsql"
],
"env": {
"LIBSQL_URL": "<LIBSQL_URL>",
"LIBSQL_AUTH_TOKEN": "<YOUR_LIBSQL_AUTH_TOKEN>"
}
}
}
}Install libSQL MCP in Codex
$ codex mcp add database-mcp --env 'LIBSQL_URL=<LIBSQL_URL>' --env 'LIBSQL_URL=<LIBSQL_URL>' --env 'LIBSQL_URL=<LIBSQL_URL>' --env 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' --env 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' --env 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' -- npx -y @database-mcp/libsqlInstall libSQL MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.database-mcp] command = "npx" args = ["-y", "@database-mcp/libsql"] [mcp_servers.database-mcp.env] LIBSQL_URL = "<LIBSQL_URL>" LIBSQL_AUTH_TOKEN = "<YOUR_LIBSQL_AUTH_TOKEN>"
Install libSQL MCP in Gemini CLI
$ gemini mcp add -s user -e 'LIBSQL_URL=<LIBSQL_URL>' -e 'LIBSQL_URL=<LIBSQL_URL>' -e 'LIBSQL_URL=<LIBSQL_URL>' -e 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' -e 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' -e 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' database-mcp npx -- -y @database-mcp/libsqlInstall libSQL MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"database-mcp": {
"command": "npx",
"args": [
"-y",
"@database-mcp/libsql"
],
"env": {
"LIBSQL_URL": "<LIBSQL_URL>",
"LIBSQL_AUTH_TOKEN": "<YOUR_LIBSQL_AUTH_TOKEN>"
}
}
}
}Needs a key before it starts
Started on 16 Nov 2026 with no keys, it stopped and asked for one, so a client sees no tools until you set the variables above.
Configuration
LIBSQL_URLRequiredDatabase URL (file path or libsql://... remote)
LIBSQL_URLRequiredDatabase URL (file path or libsql://... remote)
LIBSQL_URLRequiredDatabase URL (file path or libsql://... remote)
LIBSQL_AUTH_TOKENSecretAuth token for remote libSQL/Turso databases
LIBSQL_AUTH_TOKENSecretAuth token for remote libSQL/Turso databases
LIBSQL_AUTH_TOKENSecretAuth token for remote libSQL/Turso databases
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesPass
README
View on GitHubdatabase-mcp
MCP servers that give AI clients safe, structured access to SQL databases.
One installable package per database engine, in TypeScript (npm), Python
(PyPI), and Rust (crates.io). Every package exposes the same minimal
two-tool surface, execute_sql and search_objects, with guardrails on by
default: read-only mode, row caps, and statement timeouts.
Packages
| Engine | TypeScript (npm) | Python (PyPI) | Rust (crates.io) |
|---|---|---|---|
| SQLite | @database-mcp/sqlite |
database-mcp-sqlite |
database-mcp-rs-sqlite |
| libSQL | @database-mcp/libsql |
database-mcp-libsql |
database-mcp-rs-libsql |
| MySQL | @database-mcp/mysql |
database-mcp-mysql |
database-mcp-rs-mysql |
| MariaDB | @database-mcp/mariadb |
database-mcp-mariadb |
database-mcp-rs-mariadb |
| Postgres | @database-mcp/postgres |
database-mcp-postgres |
database-mcp-rs-postgres |
All three lines are published and pass the same language-agnostic conformance suite against real databases in CI, so behavior is identical regardless of language. Every engine is also listed on the MCP Registry with all three install options: npm, PyPI, and cargo.
Rust crates are named database-mcp-rs-<engine> because the plain names are
taken on crates.io; the command each one installs is still
database-mcp-<engine>. Go is planned.
Design principles
- Two tools, no more. A tiny tool surface keeps the model's context window
clean.
search_objectsprogressively discloses schema: call it with no arguments to list tables, with a table name to get columns, indexes, and foreign keys. - Safe by default. Read-only mode is enforced in two layers: a conservative SQL guard, plus a session-level read-only setting in the database itself. Rows are capped (default 1000) and statements time out (default 30s).
- Configured at launch, never via chat. Connection details come from flags, a YAML config file, or environment variables. Credentials are never accepted through a tool call.
- Secrets never appear in logs. Passwords live in non-printable secret types, DSNs are sanitized before logging, and a redaction filter guards the log boundary.
Quick start
Pick your engine's package; each README has the full config surface. SQLite via npm:
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["-y", "@database-mcp/sqlite", "--dsn", "/absolute/path/to/database.db"]
}
}
}
Or via PyPI: use "command": "uvx" and
"args": ["database-mcp-sqlite", "--dsn", "/absolute/path/to/database.db"].
Or as a native binary, with no Node or Python runtime: run
cargo install database-mcp-rs-sqlite, then use
"command": "database-mcp-sqlite" with the same args minus the package
name.
Flags, environment variables, and YAML config are identical across all three lines.
Networked engines take credentials from the environment (MYSQL_*,
MARIADB_*, POSTGRES_*/DATABASE_URL, LIBSQL_URL/LIBSQL_AUTH_TOKEN),
*_FILE mounted secrets, or a YAML file via --config. Never from a chat
prompt.
Contributing
See CONTRIBUTING.md. The short version: the conformance
suite is the definition of done. A change is mergeable only when
conformance/run.mjs passes against every affected server.
License
libSQL MCP questions
How do I add libSQL MCP to Claude Code?
Run claude mcp add --env 'LIBSQL_URL=<LIBSQL_URL>' --env 'LIBSQL_AUTH_TOKEN=<YOUR_LIBSQL_AUTH_TOKEN>' database-mcp -- npx -y @database-mcp/libsql in your terminal. Add --scope user to make it available in every project.
How do I add libSQL MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What safety guardrails are included by default?
The server includes read-only mode, row caps (defaulting to 1000), and statement timeouts (defaulting to 30s).
How are database credentials handled?
Credentials are provided via flags, environment variables, or configuration files at launch and are never accepted through chat prompts.
What tools are available for the AI to use?
The server provides two primary tools: execute_sql for running queries and search_objects for discovering the database schema.