# xexr/mcp-libsql [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/Xexr/mcp-libsql  
**GitHub Stars:** 21  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/xexr-mcp-libsql

## Description
Production-ready MCP server for libSQL databases with comprehensive security and management tools.

## Claude Desktop Quick Installation
Heuristic fallback — verify the package name and runner against the repository README before running it. Uses `npx` (confidence: low):

```json
"mcpServers": {
  "mcp-libsql": {
    "command": "npx",
    "args": ["-y","xexr-mcp-libsql"],
    "env": {
      "LIBSQL_AUTH_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `LIBSQL_AUTH_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What xexr/mcp-libsql MCP server does

The xexr/mcp-libsql MCP server connects MCP-compatible clients to libSQL databases. It supports local database files and remote endpoints, including Turso URLs, through a command-line server written in TypeScript for Node.js.

The server provides six database operations: executing read-only SELECT statements, applying INSERT/UPDATE/DELETE statements, creating tables, changing table structures, listing tables, and inspecting table schemas. Table and query responses can be formatted for readability, including handling for NULL values. Operations also expose performance information and return errors with contextual details.

## How it works

Start the server with a database URL supplied through the `--url` option. Examples in the project use `file:///tmp/test.db` for a local database, an HTTP URL for a remote endpoint, and a `libsql://` URL for Turso. MCP clients start the process and communicate with it using their normal server configuration.

For authenticated databases, the server accepts a token through `LIBSQL_AUTH_TOKEN` or the `--auth-token` command-line option. The documentation recommends the environment variable because command-line arguments can be visible in process listings. File-based databases do not require a token.

The xexr/mcp-libsql MCP server applies multiple layers of SQL injection validation. Write operations support transactions, with rollback when an operation fails. Connection pooling, health checks, retry behavior, and audit logging are included in the documented reliability and security features.

## Setup and configuration

Node.js 20 or newer and a package manager such as pnpm or npm are required. The documented global installation command is:

```bash
pnpm install -g @xexr/mcp-libsql
```

After installation, run `mcp-libsql` with a database URL. The project also supports installation from source by cloning the repository, installing dependencies, building the project, and starting `node dist/index.js`.

Claude Desktop configuration uses the installed `mcp-libsql` executable and passes `--url` in the server's `args` array. The README includes platform-specific examples for macOS, Linux, and Windows through WSL2. Development mode is available with `--dev`, and logging can target the console, a file, or both through `--log-mode`.

## Tools and capabilities

- Run validated SELECT queries with `read-query`.
- Apply data changes with `write-query`, including transaction support.
- Create tables with `create-table`.
- Add, rename, or drop table structures with `alter-table`.
- Browse database metadata with filtered `list-tables` requests.
- Inspect schemas using `describe-table` and its supported output formats.
- Use parameterized queries for safer value handling.

## Limitations and notes

The server requires a libSQL-compatible database URL and does not document support for unrelated database engines. Remote credentialed databases need an authentication token, while local file databases can run without one. The README describes Claude Desktop, Claude Code, Cursor, and other MCP-compatible clients; client-specific configuration may differ. Tokens placed in MCP configuration files should be protected from version control, and the project recommends scoped tokens, secret management, and regular rotation for production use.

_Full upstream README: https://allmcps.com/mcp/xexr-mcp-libsql/readme_

