Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio xexr-mcp-libsql node dist/index.js \
  --env LIBSQL_AUTH_TOKEN="your-turso-auth-token-here (optional, for Turso/credentialed databases)"

How to use

mcp-libsql is a Node.js-based MCP server that exposes libSQL database operations through the MCP protocol. It implements the six core MCP tools for database interactions: read-query, write-query, create-table, alter-table, list-tables, and describe-table. These tools enable secure SELECT, INSERT/UPDATE/DELETE with transaction support, DDL operations, and metadata inspection, all with parameterized queries and audit logging. To connect from Claude Desktop or other MCP clients, run the server via Node (for example with dist/index.js) and point the client at the server's URL or local socket as configured. Common usage includes testing with a file-based database, a Turso/remote database (with an auth token if required), or an HTTP database endpoint, then performing read/write operations and schema changes through the MCP tools.

How to install

Prerequisites:

  • Node.js 20+ (as indicated by the project requirements)
  • pnpm, npm, or yarn for package installation
  • A libSQL database (file-based or remote)

Installation steps (global) with pnpm:

  1. Install the MCP server globally
pnpm install -g @xexr/mcp-libsql
  1. Verify installation
mcp-libsql -v

Alternatively, install from source:

git clone https://github.com/Xexr/mcp-libsql.git
cd mcp-libsql
pnpm install
pnpm build
node dist/index.js -v

Usage example after installation:

mcp-libsql --url file:///tmp/test.db

You can customize the configuration (for Claude Desktop or your environment) by pointing to the built dist/index.js or by using a global install as shown above.

Additional notes

Tips and notes:

  • If you’re using Turso or credentialed databases, you may need LIBSQL_AUTH_TOKEN. Provide it via environment variable or CLI parameter as described in the README discussions.
  • When configuring Claude Desktop, you can either run the global installed command or invoke the local build via node dist/index.js to ensure compatibility with your environment.
  • Ensure your Node.js CLI path is accessible in your system PATH when using Claude Desktop on macOS/Linux.
  • For development/testing, you can run with --dev and --log-mode console to see verbose output for debugging.
  • The server supports common MCP clients; verify that the tooling version matches your MCP protocol expectations.
  • If you encounter issues with Windows/WSL, use the recommended wsl.exe invocation patterns described in the README configuration examples.

Related MCP Servers

Sponsor this space

Reach thousands of developers