# Database MCP Libsql

> Database MCP Libsql is an open-source MCP server for databases. Read-only-by-default MCP server for local or remote libSQL and Turso databases. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/arifulislamat/database-mcp
- **MCP Registry name:** io.github.arifulislamat/database-mcp-libsql
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-23

## About

The libSQL build of a five-engine family points at either a local database file or a libsql:// URL for a remote Turso database. You set LIBSQL_URL at launch, plus LIBSQL_AUTH_TOKEN for remote databases; credentials are never accepted through a chat tool call.

It exposes just two tools. search_objects reveals the schema step by step: no arguments lists tables, and a table name returns columns, indexes and foreign keys. execute_sql runs statements with guardrails on: a conservative SQL guard plus a session-level read-only setting, a default cap of 1000 rows and a 30-second statement timeout.

The registry lists the same server as an npm package (@database-mcp/libsql), a PyPI package and a Rust crate, all MIT-licensed and tested against one shared conformance suite.

## Features

- **Local or remote:** Connects to a database file or a libsql:// Turso URL.
- **Two-tool surface:** Keeps model context small with execute_sql and search_objects only.
- **Two-layer read-only:** Combines a SQL guard with a read-only database session.
- **Row and time limits:** Caps results at 1000 rows and statements at 30 seconds by default.
- **Three install routes:** Available through npm, PyPI and cargo.
- **Secrets kept out of logs:** Passwords use secret types and DSNs are sanitized before logging.

## Good for

- Let an assistant explore a Turso database safely
- Inspect a local libSQL file's schema
- Answer ad hoc data questions with read-only SQL
- Prototype queries before writing application code

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add database-mcp-libsql --env LIBSQL_URL='<LIBSQL_URL>' --env LIBSQL_AUTH_TOKEN='<LIBSQL_AUTH_TOKEN>' -- npx -y @database-mcp/libsql
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add database-mcp-libsql --env LIBSQL_URL='<LIBSQL_URL>' --env LIBSQL_AUTH_TOKEN='<LIBSQL_AUTH_TOKEN>' -- npx -y @database-mcp/libsql
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.database-mcp-libsql]
command = "npx"
args = ["-y", "@database-mcp/libsql"]
env = { LIBSQL_URL = "<LIBSQL_URL>", LIBSQL_AUTH_TOKEN = "<LIBSQL_AUTH_TOKEN>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e LIBSQL_URL='<LIBSQL_URL>' -e LIBSQL_AUTH_TOKEN='<LIBSQL_AUTH_TOKEN>' database-mcp-libsql npx -- -y @database-mcp/libsql

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "database-mcp-libsql": {
      "command": "npx",
      "args": [
        "-y",
        "@database-mcp/libsql"
      ],
      "env": {
        "LIBSQL_URL": "<LIBSQL_URL>",
        "LIBSQL_AUTH_TOKEN": "<LIBSQL_AUTH_TOKEN>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 2 tools changes data. From the server's own tool labels and tool names; not verified by us.

- `execute_sql` (name suggests: changes): Run SQL against the database, read-only by default.
- `search_objects` (name suggests: reads): List tables, or show columns, indexes and foreign keys for a table.

## FAQ

### How do I connect to Turso?

Set LIBSQL_URL to the libsql:// address and LIBSQL_AUTH_TOKEN to your token.

### Can Database MCP Libsql write to my database?

Not by default; read-only mode is on unless you change it.

### Which runtimes are supported?

Node via npm, Python via uvx and a native Rust binary via cargo.

### What licence is Database MCP Libsql?

MIT.

### Is Database MCP Libsql free?

Yes. Database MCP Libsql is open source, so you can use and self-host it for free.

### How do I add Database MCP Libsql to Claude Code?

Run this command in your terminal: claude mcp add database-mcp-libsql --env LIBSQL_URL='<LIBSQL_URL>' --env LIBSQL_AUTH_TOKEN='<LIBSQL_AUTH_TOKEN>' -- npx -y @database-mcp/libsql

### What are the best alternatives to Database MCP Libsql?

The closest alternatives to Database MCP Libsql are Midplane, Datatomcp, Gulliver, GaussDB Read-Only MCP and Zektor.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Datatomcp](https://ai-powered.com/mcp/datatomcp-2): Datatomcp is a freemium MCP server for analytics and data.
- [Gulliver](https://ai-powered.com/mcp/gulliver): Gulliver is an open-source MCP server for databases.
- [GaussDB Read-Only MCP](https://ai-powered.com/mcp/gaussdb-read-only-mcp): GaussDB Read-Only MCP is an open-source MCP server for databases.
- [Zektor](https://ai-powered.com/mcp/zektor): Zektor is a freemium MCP server for databases.
- [Sqlite Graph MCP](https://ai-powered.com/mcp/sqlite-graph-mcp): Sqlite Graph MCP is an MCP server for databases.
- [Trino](https://ai-powered.com/mcp/trino-2): Trino is an open-source MCP server for databases.
- [APoint MS SQL](https://ai-powered.com/mcp/apoint-ms-sql): APoint MS SQL is a free MCP server for databases.

---
Source: https://ai-powered.com/mcp/database-mcp-libsql
