# db-mcp (SQLite MCP Server)

An MCP server that lets your coding agent read and change a SQLite database: queries, schema, audit trail, full-text and vector search.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13
- Author: neverinfamous
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/neverinfamous/db-mcp
- Updated: 2026-09-29
- HTML: https://affpapa.org/en/nevibecode/mcp/db-mcp-sqlite-mcp-server

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add db-mcp -- npx -y db-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add db-mcp-sqlite-mcp-server -- npx -y db-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "db-mcp-sqlite-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "db-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "db-mcp-sqlite-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "db-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add db-mcp-sqlite-mcp-server npx -y db-mcp
```

## When to use it
- 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
- Show the schema of the `orders` table and suggest indexes for frequent queries
- Find all March orders and total them per customer
- Switch on verbose logging without restarting the server

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
