A TypeScript reimplementation of SQLite database access for MCP clients, since the official reference server is Python only. Exposes five tools: query (SELECT, PRAGMA, EXPLAIN, WITH), schema (all tables with columns and types), table_info (single table details), explain (query plan analysis), and list_databases (find .db files in a directory). Opens databases read-only by default so you can explore safely, but supports an opt-in write mode for mutations. Built for Node.js environments where you want Claude to inspect local SQLite files, run analytical queries, or help optimize slow statements. Works with Claude Desktop, Cursor, and VS Code through npx, no authentication needed since it's all local filesystem access.
Public tool metadata for what this MCP can expose to an agent.
sqlite_queryExecute a SELECT query on the SQLite database and return rows as a JSON array. Use this for reading data — supports any valid SELECT statement with optional parameter binding for safe queries.2 paramsExecute a SELECT query on the SQLite database and return rows as a JSON array. Use this for reading data — supports any valid SELECT statement with optional parameter binding for safe queries.
sqlstringparamsarraysqlite_executeExecute a write statement (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP) on the SQLite database. Returns the number of rows changed and the last inserted row ID. Use parameter binding for safe writes.2 paramsExecute a write statement (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP) on the SQLite database. Returns the number of rows changed and the last inserted row ID. Use parameter binding for safe writes.
sqlstringparamsarraysqlite_run_scriptExecute multiple SQL statements in a single transaction. All statements succeed or all fail (atomic). Separate statements with semicolons. Use for migrations, seed data, or batch operations.1 paramsExecute multiple SQL statements in a single transaction. All statements succeed or all fail (atomic). Separate statements with semicolons. Use for migrations, seed data, or batch operations.
sqlstringsqlite_list_tablesList all tables and views in the database with their row counts. Use this as the first step to explore an unfamiliar database. Returns table name, type (table or view), and row count.1 paramsList all tables and views in the database with their row counts. Use this as the first step to explore an unfamiliar database. Returns table name, type (table or view), and row count.
_fieldsstringsqlite_describe_tableGet the column schema of a table — column names, data types, NOT NULL constraints, default values, and primary key flags. Also returns the CREATE TABLE SQL statement.1 paramsGet the column schema of a table — column names, data types, NOT NULL constraints, default values, and primary key flags. Also returns the CREATE TABLE SQL statement.
tablestringsqlite_list_indexesList all indexes on a table — index name, uniqueness, origin (manual or auto-created), and whether it is a partial index.1 paramsList all indexes on a table — index name, uniqueness, origin (manual or auto-created), and whether it is a partial index.
tablestringsqlite_list_foreign_keysList foreign key constraints on a table — referenced table, local and remote columns, ON UPDATE and ON DELETE actions.1 paramsList foreign key constraints on a table — referenced table, local and remote columns, ON UPDATE and ON DELETE actions.
tablestringsqlite_create_tableCreate a new table with column definitions. Each column has a name, type, and optional constraints (PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT). Use ifNotExists to skip if the table already exists.3 paramsCreate a new table with column definitions. Each column has a name, type, and optional constraints (PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT). Use ifNotExists to skip if the table already exists.
tablestringcolumnsarrayifNotExistsbooleansqlite_alter_tableAlter an existing table — add a new column, rename a column, or rename the table. SQLite does not support dropping columns via ALTER TABLE.9 paramsAlter an existing table — add a new column, rename a column, or rename the table. SQLite does not support dropping columns via ALTER TABLE.
typestringtablestringactionstringadd_column · rename_column · rename_tablecolumnstringdefaultvaluenewNamestringnotNullbooleanoldNamestringnewTableNamestringsqlite_drop_tableDrop (delete) a table and all its data permanently. This action is irreversible. Use ifExists to avoid errors if the table does not exist.2 paramsDrop (delete) a table and all its data permanently. This action is irreversible. Use ifExists to avoid errors if the table does not exist.
tablestringifExistsbooleansqlite_create_indexCreate an index on one or more columns to speed up queries. Optionally create a UNIQUE index to enforce uniqueness. Index name is auto-generated if not provided.5 paramsCreate an index on one or more columns to speed up queries. Optionally create a UNIQUE index to enforce uniqueness. Index name is auto-generated if not provided.
tablestringuniquebooleancolumnsarrayindexNamestringifNotExistsbooleansqlite_drop_indexDrop (delete) an index by name. Does not affect the table data, only removes the index. Use ifExists to avoid errors if the index does not exist.2 paramsDrop (delete) an index by name. Does not affect the table data, only removes the index. Use ifExists to avoid errors if the index does not exist.
ifExistsbooleanindexNamestringsqlite_get_infoGet database metadata — file path, file size, table count, page count, page size, journal mode, WAL status, encoding, and SQLite version. Use this to understand the database state.1 paramsGet database metadata — file path, file size, table count, page count, page size, journal mode, WAL status, encoding, and SQLite version. Use this to understand the database state.
_fieldsstringsqlite_vacuumOptimize and compact the database file by rebuilding it. Reclaims space from deleted rows and defragments the file. Returns file size before and after. May take time on large databases.1 paramsOptimize and compact the database file by rebuilding it. Reclaims space from deleted rows and defragments the file. Returns file size before and after. May take time on large databases.
_fieldsstringsqlite_integrity_checkRun PRAGMA integrity_check to verify the database is not corrupted. Returns "ok" if the database is healthy, or a list of issues found. Use after crashes or suspicious behavior.1 paramsRun PRAGMA integrity_check to verify the database is not corrupted. Returns "ok" if the database is healthy, or a list of issues found. Use after crashes or suspicious behavior.
_fieldsstringQuery SQLite databases, inspect schemas, and explain queries from your AI assistant. Read-only by default for safety.
npx mcp-sqlite-server
Works with Claude Desktop, Cursor, VS Code Copilot, and any MCP client. Reads local
.dbfiles, no auth needed.

Demo built with remotion-readme-kit
SQLite is everywhere. It's the default database for mobile apps, Electron apps, local-first tools, and increasingly for server-side projects too (Turso, Cloudflare D1, Bun's built-in SQLite). The official MCP reference includes a basic SQLite server, but it's Python-only. If you're working in a TypeScript/Node.js environment and want to ask your assistant "what tables are in this database?" or "run this query and show me the results," this server handles that. It opens the database read-only by default so you can explore safely, and you can opt into write mode when you need it.
| Tool | What it does |
|---|---|
query | Execute SQL (SELECT, PRAGMA, EXPLAIN, WITH). Returns results as a table. |
schema | Get full schema: all tables with columns, types, and row counts. |
table_info | Detailed info for a single table: columns, constraints, row count. |
explain | Run EXPLAIN QUERY PLAN to optimize queries. |
list_databases | List .db, .sqlite, .sqlite3 files in a directory. |
Add to .cursor/mcp.json:
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["mcp-sqlite-server"]
}
}
}
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["mcp-sqlite-server"]
}
}
}
Configure the MCP server in your VS Code settings to run npx mcp-sqlite-server.
Read-only by default. The query tool accepts only SELECT, PRAGMA, EXPLAIN, and WITH in readonly mode. Set readonly=false in the tool args to enable INSERT, UPDATE, DELETE, etc.
npm install
npm run typecheck
npm run build
npm test
npm run format
npm run lint
More MCP servers and developer tools on my portfolio.
README built with README Builder
MIT © 2026 Ofer Shapira
hovecapital/read-only-local-postgres-mcp-server
cocaxcode/database-mcp
io.github.infoinlet-marketplace/mcp-mysql
io.github.cybeleri/database-admin
io.github.yash-0620/postgres-mcp-secured