mcp-server-sqlite
Enables querying local SQLite databases, inspecting table schemas, and explaining query plans, supporting both read-only and optional write operations.
mcp-server-sqlite
Query SQLite databases, inspect schemas, and explain queries from your AI assistant. Read-only by default for safety.
npx mcp-sqlite-serverWorks with Claude Desktop, Cursor, VS Code Copilot, and any MCP client. Reads local
.dbfiles, no auth needed.

Demo built with remotion-readme-kit
Why
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.
Related MCP server: mcp-database
Tools
Tool | What it does |
| Execute SQL (SELECT, PRAGMA, EXPLAIN, WITH). Returns results as a table. |
| Get full schema: all tables with columns, types, and row counts. |
| Detailed info for a single table: columns, constraints, row count. |
| Run EXPLAIN QUERY PLAN to optimize queries. |
| List .db, .sqlite, .sqlite3 files in a directory. |
Quick Start
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["mcp-sqlite-server"]
}
}
}Claude Desktop
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["mcp-sqlite-server"]
}
}
}VS Code
Configure the MCP server in your VS Code settings to run npx mcp-sqlite-server.
Example prompts
"Show me the schema of my database at ./data.db"
"Query the users table: SELECT * FROM users LIMIT 10"
"Explain the query plan for this complex join"
"What tables are in this database?"
"Find all .db files in the current directory"
Safety
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.
Development
npm install
npm run typecheck
npm run build
npm test
npm run format
npm run lintSee also
More MCP servers and developer tools on my portfolio.
Author
README built with README Builder
License
MIT © 2026 Ofer Shapira
Available Tools
5 toolsexplainC
Explain the query plan for a SQL query (EXPLAIN QUERY PLAN). Helps optimize queries.
Inputs: db (required), sql (required).
list_databasesB
List all SQLite database files (.db, .sqlite, .sqlite3) in a directory.
Inputs: directory.
queryA
Execute a SQL query against a SQLite database. Returns results as a formatted table. Read-only by default.
Inputs: db (required), sql (required), readonly.
schemaA
Get the schema of a SQLite database: all tables with columns and row counts.
Inputs: db (required).
table_infoA
Get detailed info about a single table: columns, types, constraints, and row count.
Inputs: db (required), table (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The tools have some overlap that could cause confusion, particularly between 'schema' and 'table_info', which both provide table structure information. However, 'explain', 'list_databases', and 'query' are clearly distinct in purpose, and descriptions help differentiate the overlapping tools.
The naming is mostly consistent with a verb_noun pattern (e.g., 'list_databases', 'table_info'), but 'explain' and 'query' deviate as standalone verbs without nouns. This minor inconsistency does not severely impact readability or predictability.
With 5 tools, the server is well-scoped for SQLite database operations. Each tool serves a clear and necessary function, such as listing databases, querying, and inspecting schemas, making the count appropriate without being too sparse or bloated.
The toolset covers core SQLite operations like listing databases, querying, and schema inspection, with minor gaps such as the lack of write operations (e.g., insert, update, delete) and database management tools (e.g., create, delete). Agents can work around these gaps for read-only use cases.
Maintenance
Related MCP Connectors
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA lightweight MCP server that provides read-only access to SQLite databases, allowing users to execute SELECT queries, list tables, and describe table schemas.1MIT
- AlicenseAqualityCmaintenanceMCP server for querying and managing multiple databases (SQLite, PostgreSQL, MySQL) with read-only mode and schema inspection.213MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that provides SQLite database operations. Allows AI assistants to query, modify and manage SQLite databases through the Model Context Protocol.-
- AlicenseCqualityCmaintenanceAn MCP server for interacting with SQLite databases, enabling SQL query execution, schema inspection, and CRUD operations.7MIT