db-mcp — SQLite MCP server: what it does, how to install
An MCP server that lets your coding agent read and change a SQLite database: queries, schema, audit trail, full-text and vector search.
claude mcp add db-mcp -- npx -y db-mcpWhat db-mcp (SQLite MCP Server) does
db-mcp exposes a SQLite file to the agent as a set of tools: inspect schema, tables and indexes, run CRUD operations, pull statistics, work with JSON, use FTS5 and vector search. An audit log and DDL snapshots keep a record of what changed, so structural edits can be traced afterwards.
It starts through npx; WASM and better-sqlite3 builds are both available. Settings can live in a YAML or JSON file passed with --config, and some of them change at runtime without a restart. The --tool-filter flag trims which tool groups the agent sees, otherwise it gets the whole set at once. Network access comes with HTTP/SSE and OAuth 2.1.
Point it at a scratch database first. Granular access control exists, but an agent allowed to run destructive statements will run them, so the permissions you grant decide the blast radius.
What it helps with
- inspect a SQLite schema and indexes from the chat
- run filtered queries with aggregates instead of hand-writing SQL
- find rows with full-text or hybrid search
- trace which DDL changes an agent made
- share a database over HTTP with authentication
Example prompts for the agent
- Show the schema of the
orderstable and suggest indexes for frequent queries - Find all March orders and total them per customer
- Switch on verbose logging without restarting the server
How to install db-mcp (SQLite MCP Server)
Platform CLI
claude mcp add db-mcp -- npx -y db-mcpPlatform CLI
codex mcp add db-mcp-sqlite-mcp-server -- npx -y db-mcpConfig file
{
"mcpServers": {
"db-mcp-sqlite-mcp-server": {
"command": "npx",
"args": [
"-y",
"db-mcp"
]
}
}
}Config file
{
"servers": {
"db-mcp-sqlite-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"db-mcp"
]
}
}
}Platform CLI
gemini mcp add db-mcp-sqlite-mcp-server npx -y db-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about db-mcp (SQLite MCP Server)
How do I install db-mcp in Claude Code?
Run claude mcp add db-mcp -- npx -y db-mcp. The alternative form claude mcp add db-mcp-sqlite-mcp-server -- npx -y db-mcp does the same thing.
What does db-mcp do?
It gives an agent tools to read and modify a SQLite database: schema, queries, indexes, audit, search. It runs as a local MCP server via npx.
How do I set up db-mcp in Cursor?
Add an mcpServers entry named db-mcp-sqlite-mcp-server with command npx and args -y and db-mcp.