mcp-libsql
Secure MCP server for libSQL databases with comprehensive tools, connection pooling, and transaction support. Built with TypeScript for Claude Desktop, Claude Code, Cursor, and other MCP clients.
What is mcp-libsql?
mcp-libsql is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to secure mcp server for libsql databases with comprehensive tools, connection pooling, and transaction support. built with typescript for claude desktop, claude code, cursor, and other mcp clients.
Secure MCP server for libSQL databases with comprehensive tools, connection pooling, and transaction support. Built with TypeScript for Claude Desktop, Claude Code, Cursor, and other MCP clients.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Secure MCP server for libSQL databases with comprehensive to
Use Cases
Maintainer
Works with
Installation
NPM
npx -y @xexr/mcp-libsqlManual Installation
npx -y @xexr/mcp-libsqlConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use mcp-libsql
mcp-libsql is a TypeScript MCP server that gives AI assistants secure, structured access to libSQL databases — including local SQLite files, self-hosted libSQL servers, and Turso cloud databases. It exposes six dedicated tools covering query execution, table creation, schema inspection, and DDL operations, with built-in security validation to block dangerous statements. Teams building AI-powered data workflows use it to let Claude or Cursor query production and development databases without writing raw SQL drivers.
Prerequisites
- Node.js 18 or later (or pnpm for global installation)
- A libSQL-compatible database: a local .db file, a self-hosted libSQL server, or a Turso account
- For Turso cloud databases: a Turso auth token (LIBSQL_AUTH_TOKEN)
- An MCP client such as Claude Desktop, Claude Code, or Cursor
Install the package globally
Install mcp-libsql globally so the mcp-libsql binary is available on your PATH for use in MCP client configurations.
pnpm install -g @xexr/mcp-libsql
# or with npm:
npm install -g @xexr/mcp-libsqlIdentify your database connection string
Determine the correct connection string for your database type. Local SQLite files use a file:// URI, self-hosted libSQL servers use http://, and Turso cloud databases use the libsql:// scheme.
# Local SQLite file
file:///Users/yourname/mydb.db
# Self-hosted libSQL server
http://localhost:8080
# Turso cloud database
libsql://your-database.turso.ioAdd the server to your MCP client configuration
Open your MCP client config (e.g. claude_desktop_config.json) and add the mcp-libsql entry with your database URL and optional auth token.
Verify the connection
Test that the server starts and can see your database by running the binary directly with --version, then using the list-tables tool from your MCP client.
mcp-libsql --url file:///path/to/database.db --log-mode consoleEnable logging for troubleshooting
Use the --log-mode flag to control where logs are written. Options are file, console, both, or none. The --dev flag enables verbose development-mode logging.
mcp-libsql --url libsql://your-db.turso.io --auth-token $LIBSQL_AUTH_TOKEN --log-mode filemcp-libsql Examples
Client configuration
Example claude_desktop_config.json entries for both a local SQLite file and a Turso cloud database. The auth token is only needed for credentialed databases.
{
"mcpServers": {
"mcp-libsql-local": {
"command": "mcp-libsql",
"args": [
"--url", "file:///Users/yourname/myproject.db"
]
},
"mcp-libsql-turso": {
"command": "mcp-libsql",
"args": [
"--url", "libsql://your-database.turso.io",
"--auth-token", "YOUR_TURSO_AUTH_TOKEN"
]
}
}
}Prompts to try
Use these prompts in Claude Desktop or Cursor once connected to your libSQL database.
- "List all tables in my database."
- "Describe the schema of the users table."
- "Run a SELECT query to find all orders placed in the last 30 days."
- "Create a new table called events with columns id, name, and created_at."
- "Insert a test row into the products table with name='Widget' and price=9.99."Troubleshooting mcp-libsql
Connection to Turso database fails with authentication error
Ensure LIBSQL_AUTH_TOKEN is set correctly, or pass it via the --auth-token flag. Turso tokens can be generated with the Turso CLI using: turso db tokens create your-database-name.
write-query tool is rejected with a security validation error
The server validates SQL statements before execution. Ensure your INSERT/UPDATE/DELETE statements are syntactically correct and do not include DDL keywords. Use the create-table or alter-table tools for schema changes instead.
mcp-libsql command not found after global install
The global pnpm or npm bin directory may not be on your PATH. Run pnpm bin -g (or npm bin -g) to find the directory and add it to your shell's PATH variable, then restart your terminal.
Frequently Asked Questions about mcp-libsql
What is mcp-libsql?
mcp-libsql is a Model Context Protocol (MCP) server that secure mcp server for libsql databases with comprehensive tools, connection pooling, and transaction support. built with typescript for claude desktop, claude code, cursor, and other mcp clients. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install mcp-libsql?
Install via npm with the command: npx -y @xexr/mcp-libsql. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with mcp-libsql?
mcp-libsql works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is mcp-libsql free to use?
Yes, mcp-libsql is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
mcp-libsql Alternatives — Similar Databases Servers
Looking for alternatives to mcp-libsql? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up mcp-libsql in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use mcp-libsql?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.