Mcp Server Sqlite
About
MCP server for SQLite — query databases, inspect schemas, explain queries
Details
- Author
- ofershap
- GitHub stars
- 3
- Downloads
- 304
- Categories
- Database
Jump to
- Execute SQL queries (SELECT, PRAGMA, EXPLAIN, WITH) via the query tool.
- Retrieve full schema with tables, columns, types, and row counts via schema.
- Get detailed table info including constraints and row counts via table_info.
- Run EXPLAIN QUERY PLAN to optimize queries via explain.
- List .db, .sqlite, and .sqlite3 files in a directory via list_databases.
- Read-only by default; optional write mode via readonly=false.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Mcp Server SqliteCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Run npx mcp-sqlite-server to start the server, then configure it in your MCP client by adding a server entry with command "npx" and arguments ["mcp-sqlite-server"]. No additional installation steps are needed.
query
Execute a SQL query against a SQLite database. Returns results as a formatted table. Read-only by default.
schema
Get the schema of a SQLite database: all tables with columns and row counts.
table_info
Get detailed info about a single table: columns, types, constraints, and row count.
explain
Explain the query plan for a SQL query (EXPLAIN QUERY PLAN). Helps optimize queries.
list_databases
List all SQLite database files (.db, .sqlite, .sqlite3) in a directory.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp server sqlite": {
"sqlite": {
"command": "npx",
"args": [
"-y",
"mcp-sqlite-server"
]
}
}
}
}
McpServers
{
"sqlite": {
"command": "npx",
"args": [
"-y",
"mcp-sqlite-server"
]
}
}
mcp-server-sqlite
Query 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 .db files, no auth needed.

<sub>Demo built with <a href="https://github.com/ofershap/remotion-readme-kit">remotion-readme-kit</a></sub>
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.
Tools
| 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. |
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 lint
See also
More MCP servers and developer tools on my portfolio.
Author
---
<sub>README built with README Builder</sub>
License
MIT © 2026 Ofer Shapira
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



