mcp-libsql

v1.0.0Databasesstable

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.

ai-toolsclaudedatabaselibsqlmcp
Share:
20
Stars
0
Downloads
0
Weekly
0/5

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

LibSQL database access and management
Connection pooling and transactions
Multi-client database integration
Xexr

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMar 30, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @xexr/mcp-libsql

Manual Installation

npx -y @xexr/mcp-libsql

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-libsql
2

Identify 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.io
3

Add 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.

4

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 console
5

Enable 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 file

mcp-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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-libsql": { "command": "npx", "args": ["-y", "@xexr/mcp-libsql"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides