mcpField
M
Mcp Server Sqlite

Mcp Server Sqlite

Local
github.com/ofershapDatabases4Updated 33w ago

About Mcp Server Sqlite

An MCP server for developers inspecting SQLite databases through an AI assistant. It provides queries, schema details, and query-plan explanations, and is read-only by default with optional write access.

Key features

  1. 01Execute SQL queries
  2. 02Inspect database and table schemas
  3. 03Review columns and constraints
  4. 04Explain query plans
  5. 05List database files in a directory

Use cases

  1. 01Check tables and columns in a database
  2. 02Run queries and review results
  3. 03Inspect query plans to optimize SQL

MCP support

The server exposes SQLite query and inspection tools to compatible MCP clients and can be started with npx mcp-sqlite-server. It is read-only by default, with write access available by configuration.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": [
"-y",
"mcp-sqlite-server"
]
}
}
}
Run commandnpx -y mcp-sqlite-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmmcp-sqlite-server1.0.1

Tools

5

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
dbstringYesPath to the .db or .sqlite file
sqlstringYesSQL query to execute
readonlybooleanNoIf true, only SELECT/PRAGMA/EXPLAIN allowed

Details

From the project README

mcp-server-sqlite

npm version npm downloads CI TypeScript License: MIT

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.

MCP server for querying SQLite databases and inspecting schemas

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.

Tools

ToolWhat it does
queryExecute SQL (SELECT, PRAGMA, EXPLAIN, WITH). Returns results as a table.
schemaGet full schema: all tables with columns, types, and row counts.
table_infoDetailed info for a single table: columns, constraints, row count.
explainRun EXPLAIN QUERY PLAN to optimize queries.
list_databasesList .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

Made by ofershap

LinkedIn GitHub


README built with README Builder

License

MIT © 2026 Ofer Shapira

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.