Skip to main content
Glama
CACTUSCASH

mcp-sqlite

by CACTUSCASH

mcp-sqlite

A Model Context Protocol server that gives Claude safe, read-only access to a SQLite database.

Point it at a .db file and you can ask, in plain language:

"What tables are in this database, and how many orders did we ship in July?"

Claude lists the tables, reads the schema, writes the SQL itself, and runs it — but it cannot write, drop, or attach. Every query is checked, so the worst it can do is read.

Why read-only matters

Handing a model a live database is one keystroke away from DELETE FROM users. This server closes that off at the door: the connection is opened read-only, and the query tool rejects anything that isn't a SELECT / WITH / EXPLAIN. You get the usefulness of "ask your database in English" without the "please don't drop the table" anxiety.

Related MCP server: SQLite Explorer

Tools

Tool

Input

Does

list_tables

—

Lists tables and views (hides SQLite internals)

describe_table

table

Columns, types, PKs, nullability (validated identifier)

query

sql

Runs a read-only query; caps results at 200 rows

Install

Needs Node ≥ 22.5 (it uses the built-in node:sqlite — no native build step, nothing to compile).

npm install
npm run build

Claude Desktop — claude_desktop_config.json:

{
  "mcpServers": {
    "sqlite": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-sqlite/dist/index.js", "/absolute/path/to/your.db"]
    }
  }
}

Claude Code:

claude mcp add sqlite node /absolute/path/to/mcp-sqlite/dist/index.js /absolute/path/to/your.db

Restart the client, then ask it about your data.

How it's built

  • TypeScript, ESM, the official @modelcontextprotocol/sdk, and zod for tool schemas.

  • Zero database dependencies — Node's built-in node:sqlite does the work.

  • Safety is layered: read-only connection + a query allow-list + identifier validation on table names, so a bad prompt can't turn into a bad write.

License

MIT © Sa'ood Williams

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to query and manage databases (SQLite, SQL Server, PostgreSQL, MySQL) through natural language, supporting read/write operations and schema management.
    1,126 npm
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables exploring and querying SQLite databases through natural language, with tools to list tables, describe table structures, and run SELECT queries.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables Claude and other MCP clients to map a SQLite database's schema and run read-only SQL queries against it, with writes blocked at the SQLite level through multiple enforcement layers. Results come back as context-friendly Markdown tables with row caps and a query timeout.
    2
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Lets Claude Desktop, Claude Code, and other MCP clients map the structure of a SQLite database and run read-only SQL queries against it, returning compact Markdown results. Multi-layered protections make any write impossible, so a database can be explored without reviewing each query first.
    MIT