Allows an AI client to perform safe, local SQLite database operations including reading, writing, schema management, and CSV imports/exports.
Also known as spences10/mcp-sqlite-tools
- Stars
- 20
- Tools
- 19
- Downloads, 30 days
- —
- Latest version
- 0.0.11
- Last commit
- Nov 16, 2026
- License
- MIT
What is sqlite-tools MCP?
sqlite-tools allows an AI client to perform safe, local SQLite database operations including reading, writing, schema management, and CSV imports/exports. It exposes 19 tools, such as open_database, close_database, list_databases.
Summary generated from the project's README
About sqlite-tools MCP server
Managing local SQLite databases through an AI client is what this server enables for developers and data analysts. It provides a structured way to interact with database files using tools for reading, writing, and schema management. Users can perform tasks ranging from simple paginated queries to complex operations like importing headered CSV files or managing transactions with nested savepoints. The server runs locally via Node.js and connects to MCP clients like Claude Code, Cursor, or VS Code using stdio.
Security is a core focus, as the server classifies tools by intent to help clients implement approval policies for destructive actions. It uses the SQLite authorizer API to ensure read-only queries cannot modify data and employs parameter binding to prevent injection. Administrators can configure environment variables to restrict database paths, set busy timeouts, or define specific journal modes like WAL. This setup allows for controlled, safe database maintenance and manipulation directly from a chat interface.
What you can do with it
- 1Perform safe data analysisAn AI can run read-only queries to inspect table contents without risking accidental data modification.
- 2Manage database schemasDevelopers can instruct an AI to create new tables or modify existing structures using specialized schema tools.
- 3Migrate data via CSVYou can ask the AI to move data between files and the database using import and export functions.
- 4Maintain database healthThe AI can perform routine maintenance tasks like rebuilding the database to reclaim storage space.
Written from the project's README. Every use case is checked against a quote from it.
How to install sqlite-tools MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall sqlite-tools MCP in Claude Code
$ claude mcp add mcp-sqlite-tools -- npx -y mcp-sqlite-toolsInstall sqlite-tools MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"mcp-sqlite-tools": {
"command": "npx",
"args": [
"-y",
"mcp-sqlite-tools"
]
}
}
}Install sqlite-tools MCP in VS Code
.vscode/mcp.json
{
"servers": {
"mcp-sqlite-tools": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-sqlite-tools"
]
}
}
}Install sqlite-tools MCP in VS Code CLI
$ code --add-mcp '{"name":"mcp-sqlite-tools","type":"stdio","command":"npx","args":["-y","mcp-sqlite-tools"]}'Install sqlite-tools MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"mcp-sqlite-tools": {
"command": "npx",
"args": [
"-y",
"mcp-sqlite-tools"
]
}
}
}Install sqlite-tools MCP in Codex
$ codex mcp add mcp-sqlite-tools -- npx -y mcp-sqlite-toolsInstall sqlite-tools MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.mcp-sqlite-tools] command = "npx" args = ["-y", "mcp-sqlite-tools"]
Install sqlite-tools MCP in Gemini CLI
$ gemini mcp add -s user mcp-sqlite-tools npx -- -y mcp-sqlite-toolsInstall sqlite-tools MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"mcp-sqlite-tools": {
"command": "npx",
"args": [
"-y",
"mcp-sqlite-tools"
]
}
}
}Started by HostedMCP on 16 Nov 2026
We ran this command for mcp-sqlite-tools 0.0.11 in an isolated container with no network and no keys. It answered and listed 19 tools.
sqlite-tools MCP tools 19
Read from the server with tools/listopen_database✓ SAFE: Open or create a SQLite database file
close_database✓ SAFE: Close a database connection
list_databases✓ SAFE: List available database files in a directory
database_info✓ SAFE: Get information about a database (size, tables, etc.)
list_tables✓ SAFE: List all tables and views in a database
describe_table✓ SAFE: Get schema information for a table
create_table⚠️ SCHEMA CHANGE: Create a new table with specified columns
drop_table⚠️ DESTRUCTIVE: Permanently delete a table and all its data
backup_database✓ SAFE: Create a backup copy of a database
vacuum_database✓ MAINTENANCE: Optimize database storage by reclaiming unused space
execute_read_query✓ SAFE: Execute read-only SQL queries (SELECT, PRAGMA, EXPLAIN)
execute_write_query⚠️ DESTRUCTIVE: Execute SQL that modifies data (INSERT, UPDATE, DELETE)
Show all 19 toolsShow fewer tools
execute_schema_query⚠️ SCHEMA CHANGE: Execute DDL queries (CREATE, ALTER, DROP)
bulk_insert⚠️ DESTRUCTIVE: Insert multiple records efficiently in batches
begin_transaction⚠️ TRANSACTION: Begin a database transaction
commit_transaction✓ TRANSACTION: Commit the current database transaction
rollback_transaction⚠️ TRANSACTION: Rollback the current database transaction
export_schema✓ SAFE: Export database schema as SQL or JSON
import_schema⚠️ SCHEMA CHANGE: Import and execute schema from SQL or JSON
Configuration
SQLITE_ALLOW_ABSOLUTE_PATHSSQLITE_BACKUP_PATHSQLITE_BUSY_TIMEOUTSQLITE_DEFAULT_PATHSQLITE_JOURNAL_MODE
Automated checks
Ran Nov 16, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work · What to fix for more points
- Source repository linked and reachablespences10/mcp-sqlite-tools is public and reachablegithub.com/spences10/mcp-sqlite-tools ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-16github.com/spences10/mcp-sqlite-tools ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from mcp-sqlite-toolsPass
- No critical advisory in the package or its dependencies51 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model19 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelleddrop_table has no destructiveHintFinding
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubmcp-sqlite-tools
A Model Context Protocol (MCP) server for safe, local SQLite database operations. It gives MCP clients explicit read, write, schema, transaction, CSV, backup, and maintenance tools.
Features
- Open, create, inspect, back up, vacuum, and close SQLite databases
- List, describe, create, and drop tables
- Run paginated read queries with named or positional parameters
- Run explicit write and schema queries
- Import and export headered CSV files
- Use transactions with nested savepoints
- Export and import schemas as SQL or JSON
- Restrict database and CSV paths through configuration
- Classify destructive tools for client approval policies
- Use Node's built-in SQLite driver with no native addon dependency
Requirements
- Node.js 24.12 or later
- An MCP client with stdio server support
Configure your MCP client
The MCP client starts this server through npx; a global installation
is not required.
Install with MCPick
MCPick can add the server to a supported client without manual JSON editing. This command targets Claude Code's local scope by default:
npx -y mcpick add \
--name sqlite-tools \
--command npx \
--args "-y,mcp-sqlite-tools"
Select a client and scope explicitly when needed:
npx -y mcpick add \
--name sqlite-tools \
--command npx \
--args "-y,mcp-sqlite-tools" \
--client vscode \
--scope project
The add command supports Claude Code, Gemini CLI, VS Code, Cursor,
Windsurf, OpenCode, and Pi. Run npx mcpick clients to see current
client capabilities, scopes, and configuration locations.
The examples track the latest package release. For reproducible
configuration, replace mcp-sqlite-tools in --args with an exact
version such as mcp-sqlite-tools@x.y.z.
Manual configuration
For unsupported clients or advanced configuration, add the server manually:
{
"mcpServers": {
"mcp-sqlite-tools": {
"command": "npx",
"args": ["-y", "mcp-sqlite-tools"],
"env": {
"SQLITE_DEFAULT_PATH": ".",
"SQLITE_ALLOW_ABSOLUTE_PATHS": "true",
"SQLITE_BUSY_TIMEOUT": "30000",
"SQLITE_JOURNAL_MODE": "wal",
"SQLITE_BACKUP_PATH": "./backups"
}
}
}
}
VS Code uses a servers object instead of mcpServers. See the
configuration guide
for more client-specific examples.
Environment variables
| Variable | Purpose | Default |
|---|---|---|
SQLITE_DEFAULT_PATH |
Base directory for database files | . |
SQLITE_ALLOW_ABSOLUTE_PATHS |
Allow paths outside the default directory | true |
SQLITE_BACKUP_PATH |
Default backup directory | Default database path |
SQLITE_BUSY_TIMEOUT |
SQLite lock busy timeout in milliseconds | 30000 |
SQLITE_JOURNAL_MODE |
delete, truncate, persist, or wal |
wal |
DEBUG |
Enable diagnostic logging | false |
When SQLITE_ALLOW_ABSOLUTE_PATHS=false, relative and absolute paths
must resolve inside SQLITE_DEFAULT_PATH. Symbolic links cannot be
used to escape that directory.
Use SQLITE_JOURNAL_MODE=delete for databases in file-synchronized
directories. The unsafe SQLite modes memory and off are not
accepted.
SQLITE_MAX_QUERY_TIME remains available as a deprecated alias for
SQLITE_BUSY_TIMEOUT. It does not limit wall-clock query runtime.
Tools
Tools are separated by intent so MCP clients can apply clear approval rules.
Safe and read-only
| Tool | Purpose |
|---|---|
open_database |
Open an existing database |
close_database |
Close one database connection |
list_databases |
Find database files in a directory |
database_info |
Read file and SQLite metadata |
list_tables |
List tables and views |
describe_table |
Read columns and constraints |
backup_database |
Create a consistent online backup |
export_csv |
Export a table or read-only query |
export_schema |
Export schema as SQL or JSON |
execute_read_query |
Run one SQLite read-only statement |
Writes, schema, and maintenance
| Tool | Purpose |
|---|---|
create_database |
Create a new database file |
create_table |
Create a table from validated columns |
drop_table |
Drop a table and its data |
execute_write_query |
Run INSERT, UPDATE, or DELETE |
execute_schema_query |
Run one schema statement |
bulk_insert |
Insert records in batches |
import_csv |
Import a headered CSV file |
import_schema |
Apply SQL or JSON schema objects |
vacuum_database |
Rebuild a database to reclaim space |
begin_transaction |
Begin a transaction or nested savepoint |
commit_transaction |
Commit or release a savepoint |
rollback_transaction |
Roll back a transaction or savepoint |
See the complete API reference for parameters, responses, examples, pagination, and CSV options.
Safety model
The server does not treat every SQL string as equivalent:
execute_read_queryuses SQLite's authorizer API to reject writes, schema changes, unsafe PRAGMAs, attachment, and multiple statements.- Write, schema, transaction, and destructive administration actions use separate tools so clients can request approval.
- Database and CSV paths are resolved and validated before access.
- Identifiers generated by tools are quoted.
- Values are bound as parameters rather than interpolated into SQL.
- Backups use SQLite's online backup API and include committed WAL data.
A client can allow read-only tools and require approval for destructive tools. Always review SQL and file paths before approving changes. Back up important databases before schema changes, imports, or large writes.
Why native SQLite?
Using node:sqlite removes the native addon, its install script, and
its platform-specific binaries. A clean production install fell from
31.3 MB with better-sqlite3 to 3.6 MB with native SQLite, an 88.5%
reduction. The npm tarball itself is similar in size: 63.1 KB native
versus 60.0 KB published. The large saving is in the installed
dependency tree.
The migration also removes better-sqlite3 and its type package. It
makes installation independent of prebuilt addon availability or a
working native compiler.
Driver benchmark
Lower times are better. These medians use 20,000 rows, two warmups, and seven measured runs per driver. Each sample uses a new database and the driver order alternates. Setup is outside the measured region except for the insert workload.
| Workload | node:sqlite |
better-sqlite3 |
Native result |
|---|---|---|---|
| Insert transaction | 11.13 ms | 23.78 ms | 2.14× faster |
| Indexed point reads | 25.23 ms | 21.40 ms | 17.9% slower |
| Full row scan | 6.39 ms | 3.29 ms | 94.3% slower |
| Update transaction | 8.04 ms | 15.40 ms | 1.92× faster |
| Online backup | 0.55 ms | 0.38 ms | 45.0% slower |
Measured on Linux x64 with Node.js 24.15.0 and an AMD Ryzen AI 9
HX 370. Node used SQLite 3.51.3; better-sqlite3@13.0.1 used SQLite
3.53.3. These microbenchmarks show driver trade-offs, not complete MCP
performance. MCP transport and validation costs are not included.
Development
git clone https://github.com/spences10/mcp-sqlite-tools.git
cd mcp-sqlite-tools
pnpm install
pnpm run check
pnpm test
pnpm run build
See development and architecture for module responsibilities and other development commands.
Documentation
Contributing
Issues and pull requests are welcome.
License
MIT License. See LICENSE.
sqlite-tools MCP questions
How do I add sqlite-tools MCP to Claude Code?
Run claude mcp add mcp-sqlite-tools -- npx -y mcp-sqlite-tools in your terminal. Add --scope user to make it available in every project.
How do I add sqlite-tools MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does sqlite-tools MCP provide?
It exposes 19 tools, including open_database, close_database, list_databases, database_info, list_tables.
How do I install this server?
You can install it using npx via MCPick or by manually adding it to your MCP client configuration.
Can I restrict which files the server can access?
Yes, you can restrict database and CSV paths through configuration using environment variables like SQLITE_DEFAULT_PATH.
Is it safe to run write queries?
The server classifies destructive tools separately so clients can require explicit approval for write, schema, and maintenance actions.
What are the system requirements?
You need Node.js version 24.12 or later and an MCP client that supports stdio servers.