Skip to main content
Glama
SQLite MCP Server

SQLite MCP Server

by node2flow-th

SQLite MCP Server

npm version License: MIT

MCP server for SQLite databases — local files or remote Turso/libSQL via URL. 15 tools for query, schema, indexes, and optimization.

Quick Start

Local Database (Claude Desktop / Cursor)

{
  "mcpServers": {
    "sqlite": {
      "command": "npx",
      "args": ["-y", "@node2flow/sqlite-mcp"],
      "env": {
        "SQLITE_DB_PATH": "/path/to/your/database.db"
      }
    }
  }
}

Remote Database (Turso/libSQL)

{
  "mcpServers": {
    "sqlite": {
      "command": "npx",
      "args": ["-y", "@node2flow/sqlite-mcp"],
      "env": {
        "SQLITE_DB_URL": "libsql://your-db-name.turso.io",
        "SQLITE_AUTH_TOKEN": "your-auth-token"
      }
    }
  }
}

HTTP Mode

# Local
SQLITE_DB_PATH=/path/to/database.db npx @node2flow/sqlite-mcp --http

# Remote
SQLITE_DB_URL=libsql://your-db.turso.io SQLITE_AUTH_TOKEN=xxx npx @node2flow/sqlite-mcp --http

MCP endpoint: http://localhost:3000/mcp

Cloudflare Worker (Remote Only)

Available at: https://sqlite-mcp-community.node2flow.net/mcp

POST https://sqlite-mcp-community.node2flow.net/mcp?SQLITE_DB_URL=libsql://your-db.turso.io&SQLITE_AUTH_TOKEN=xxx

CF Workers have no filesystem — only SQLITE_DB_URL is supported.


Related MCP server: Turso MCP Server

Configuration

Variable

Required

Mode

Description

SQLITE_DB_PATH

No

Local

Path to SQLite file (creates if not exists)

SQLITE_DB_URL

No

Remote

Turso/libSQL URL (e.g. libsql://db.turso.io)

SQLITE_AUTH_TOKEN

No

Remote

Auth token for Turso (required with URL)

SQLITE_TIMEOUT

No

Local

Busy timeout in ms (default: 5000)

Priority: SQLITE_DB_URL > SQLITE_DB_PATH (if both set, URL wins)


Tools (15)

Query & Execute (3)

Tool

Description

sqlite_query

Execute SELECT query, return rows as JSON

sqlite_execute

Execute write statement (INSERT/UPDATE/DELETE/CREATE)

sqlite_run_script

Execute multiple statements in transaction

Schema Inspection (4)

Tool

Description

sqlite_list_tables

List all tables with row counts

sqlite_describe_table

Get columns, types, constraints

sqlite_list_indexes

List indexes for a table

sqlite_list_foreign_keys

List foreign key constraints

Schema Management (3)

Tool

Description

sqlite_create_table

Create new table with column definitions

sqlite_alter_table

Add column, rename column, rename table

sqlite_drop_table

Drop a table

Index Management (2)

Tool

Description

sqlite_create_index

Create index on columns

sqlite_drop_index

Drop an index

Database Management (3)

Tool

Description

sqlite_get_info

Database metadata (size, tables, journal mode)

sqlite_vacuum

Optimize and compact database

sqlite_integrity_check

Check database health


Turso Setup

  1. Install Turso CLI: curl -sSfL https://get.tur.so/install.sh | bash

  2. Sign up: turso auth signup

  3. Create database: turso db create my-database

  4. Get URL: turso db show my-database --url

  5. Get token: turso db tokens create my-database

Free tier: 500 databases, 9GB storage, 25M reads/month.


Docker

docker compose up -d
# Endpoint: http://localhost:3025/mcp

Mount database files or use remote URL:

services:
  sqlite-mcp-community:
    build: .
    ports:
      - "127.0.0.1:3025:3000"
    environment:
      # Local mode:
      - SQLITE_DB_PATH=/data/database.db
      # OR Remote mode:
      # - SQLITE_DB_URL=libsql://your-db.turso.io
      # - SQLITE_AUTH_TOKEN=your-token
    volumes:
      - ./data:/data

License

MIT License - see LICENSE

Copyright (c) 2026 Node2Flow

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Operations toolchain for SQLite, Cloudflare D1, and Turso. Every command is available as both a CLI and an MCP tool: inspect, diff, migrate, monitor, back up, and repair databases. 22 stdio tools, read-only by default.
      14
      1
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables SQL queries, table listing, schema description, and data retrieval with pagination on Turso (libSQL) databases.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables agents to inspect and query local SQLite databases and, when write mode is enabled, perform inserts, updates, deletes, schema changes, and atomic transactions over stdio.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables coding agents to explore schemas, trace lineage and procedure call graphs, run bounded SQL and PostgreSQL diagnostics, and manage cryptographically governed changes across PostgreSQL, MySQL, and SQLite over stdio or HTTP.
      Apache 2.0