mcp-sqlite-explorer
Provides read-only exploration and querying of SQLite databases, including listing tables and views, describing schemas, running bounded SELECT queries, inspecting query plans, and generating token-dense database summaries.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-sqlite-explorer describe the users table in ./app.sqlite"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-sqlite-explorer
Zero-dependency, read-only SQLite explorer and query sandbox for AI agents and developers.
Inspect databases, extract relational schemas, run bounded read-only queries, and generate token-dense database summaries for Claude, Cursor, and MCP-compatible coding agents β without risking accidental data modification or context window flooding.
β¨ Features
π‘οΈ Multi-Layer Read-Only Safety:
AST-level query validator blocks all mutating statements (
INSERT,UPDATE,DELETE,DROP,ALTER,ATTACH, mutatingPRAGMAs).Multi-query injection detection (disallows statement chaining via
;).Native SQLite engine-level read-only mode (
PRAGMA query_only = ON;andreadOnly: true).
β‘ Zero Native Dependencies:
Built entirely on Node 22+ native
node:sqlite.No
node-gyp, no Python runtime requirement, no C++ compilation errors on Windows, macOS, or Linux.
π§ Token-Optimized AI Context Summaries:
sqlite_summarize_databaseproduces high-density schema maps (tables, row counts, PKs, foreign keys, indexes) formatted specifically to conserve LLM context budgets.
π Bounded Query Sandbox:
Enforces pagination (
limit&offset) with default cap (50 rows, max 500) and truncation indicators.Formats results into GitHub-flavored markdown tables, compact TSV, or JSONL.
π Query Plan Explainer:
Inspect SQLite index utilization and execution plans with
EXPLAIN QUERY PLAN.
π» Standalone CLI:
Dual-mode: works as both an MCP stdio server and a standalone terminal utility.
Related MCP server: db-query-mcp
π Quick Start
1. Claude Desktop Configuration
Add mcp-sqlite-explorer to your claude_desktop_config.json:
{
"mcpServers": {
"sqlite-explorer": {
"command": "npx",
"args": ["-y", "mcp-sqlite-explorer", "serve", "--db", "/path/to/database.sqlite"]
}
}
}2. Standalone CLI Usage
# List all tables and views with row counts
npx mcp-sqlite-explorer tables ./mydb.sqlite
# Describe table columns, primary keys, and foreign keys
npx mcp-sqlite-explorer describe ./mydb.sqlite users
# Run a safe read-only query
npx mcp-sqlite-explorer query ./mydb.sqlite "SELECT id, name FROM users LIMIT 10"
# Generate agent-ready database summary
npx mcp-sqlite-explorer summary ./mydb.sqlite
# Inspect query plan
npx mcp-sqlite-explorer explain ./mydb.sqlite "SELECT * FROM posts WHERE user_id = 1"π οΈ MCP Tools Reference
Tool | Description | Key Parameters |
| List user tables and views with row and column counts |
|
| Full schema detail: columns, types, PKs, FKs, indexes, DDL |
|
| Execute read-only query ( |
|
| Inspect SQLite execution plan |
|
| Token-dense database overview for LLM context |
|
π Security Model
Strict SQL Whitelist: Only
SELECT,WITH ... SELECT,EXPLAIN, and safe read-only PRAGMAs (table_info,database_list,index_list,foreign_key_list) are permitted.Comment Stripping: SQL comments (
--and/* */) are parsed and removed prior to analysis to prevent comment-cloaked attacks.No Database Writes: Any attempt to write or mutate triggers an immediate
UnsafeQueryErrorbefore reaching SQLite.
π§ͺ Testing
npm test # Run Vitest test suite (35+ unit & e2e tests)
npm run typecheck # Validate TypeScript types
npm run build # Compile TypeScript to dist/π License
MIT Β© KaryawanSurga
Available Tools
5 toolssqlite_describe_tableDescribe SQLite Table SchemaARead-only
Inspect columns, types, primary keys, foreign keys, indexes, and CREATE TABLE DDL for a specific table or view in SQLite.
Inputs: table (required), db_path.
sqlite_explain_queryExplain SQLite Query Execution PlanARead-only
Run EXPLAIN QUERY PLAN on a query to inspect SQLite index usage, table scans, and optimization steps.
Inputs: query (required), db_path.
sqlite_list_tablesList SQLite TablesARead-only
List all user tables and views in a SQLite database with row counts and column counts. Use this to discover database schema without loading data.
Inputs: db_path, include_views.
sqlite_read_queryExecute Safe Read-Only QueryARead-only
Execute a read-only SQL query (SELECT, WITH, PRAGMA info) safely on SQLite. All write/mutation queries are blocked.
Inputs: query (required), limit, format, offset, +1 more.
sqlite_summarize_databaseSummarize SQLite Database for AI AgentARead-only
Generate a token-dense markdown summary of the entire database (tables, row counts, columns, PKs, FK relationships, indexes) optimized for AI agent context windows.
Inputs: db_path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Most tools have clearly distinct purposes: listing, describing, querying, explaining, and summarizing. However, sqlite_summarize_database overlaps substantially with sqlite_list_tables and sqlite_describe_table because it aggregates similar schema/count information, and sqlite_read_query can also surface PRAGMA-style schema details.
All tools use a consistent sqlite_verb_noun naming pattern: sqlite_list_tables, sqlite_describe_table, sqlite_read_query, sqlite_explain_query, sqlite_summarize_database. The convention is predictable and easy for an agent to follow.
Five tools is well-scoped for a read-only SQLite exploration server. Each tool earns its place: schema discovery, table inspection, querying, query-plan inspection, and context-friendly summarization.
The server explicitly targets safe read-only exploration, and its surface covers the full workflow: discover tables, inspect schema, run read-only queries, analyze query plans, and summarize a database for agent context. No obvious read-only lifecycle gap remains.
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view detβ¦
Query 40 databases from Claude, ChatGPT, or Cursor β on any device. Read-only, encrypted, audited.
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to safely explore and query a SQLite database in read-only mode, allowing them to inspect schema and run analytical SQL queries without risking data modification.3MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to safely run read-only SQL against SQLite databases through whitelist-validated queries, capped result sets, and confined file paths. It also exposes schema inspection so models can discover tables and columns before querying.2MIT
- AlicenseAqualityBmaintenanceEnables AI agents to inspect database schemas and run strictly read-only SQL queries with guardrails against destructive statements, multi-statement chaining, and unbounded scans. Supports SQLite natively and PostgreSQL optionally.484 PyPIMIT
- AlicenseAqualityCmaintenanceEnables AI agents to explore and query SQLite databases through read-only, sandboxed tools for listing tables, describing schemas, fetching DDL, and running a single capped SELECT statement. Also supports plain-English questions that are converted to SQL and routed through the same sandbox.4MIT