sqlite-explorer-mcp
Read-only SQLite database explorer for MCP clients. Allows discovery of tables and columns via resources and running SELECT queries via a tool.
README
sqlite-explorer-mcp
A production-grade Model Context Protocol server that exposes a read-only SQLite database to any MCP client (Claude Code, Claude Desktop, …). It ships both transports, real input/output bounds, structured logging, auth, tests, CI, and a container.
Built on the official @modelcontextprotocol/sdk (v1.29.x).
Design
| Capability | MCP primitive | Why |
|---|---|---|
| Discover tables / columns | Resource (schema://tables, schema://table/{name}) |
Read-only context the model reads; cacheable, side-effect-free |
| Run a query | Tool (query) |
An action with cost/risk: validated input, can fail, auditable |
The server is defined once (src/server.ts) and exposed over two transports from shared code:
src/stdio.ts— for local clients (the client launches it as a subprocess).src/http.ts— Streamable HTTP for remote clients on other machines.
Safety
- The read-only boundary is the engine, not a string check. The DB is opened
{ readonly: true }withPRAGMA query_only = ON; SQLite rejects any write regardless of the SQL sent. The single-statement / SELECT-only gate insrc/db.tsonly produces clearer errors. - Output is bounded —
MAX_ROWScap +busy_timeoutso a runaway scan can't exhaust memory. - Secrets via Zod-validated env (
src/env.ts); nothing hardcoded. HTTP requires a 32+ charMCP_BEARER_TOKEN, checked with a constant-time compare and fail-closed. - The stdout rule — on stdio, stdout is the JSON-RPC channel. All logging goes to stderr
(
src/logger.ts); an ESLintno-consolerule enforces it.
Quick start
npm install
npm run seed # creates data.db (sample customers + orders)
npm test # unit + in-memory integration tests
npm run build
Run locally (stdio) + connect to Claude Code
npx @modelcontextprotocol/inspector node build/stdio.js # debug standalone first
claude mcp add --transport stdio sqlite -- node "$(pwd)/build/stdio.js"
Run remotely (Streamable HTTP)
export MCP_BEARER_TOKEN=$(openssl rand -hex 32)
npm run start:http
# from any machine (behind TLS in production):
claude mcp add --transport http sqlite https://your-host/mcp \
--header "Authorization: Bearer $MCP_BEARER_TOKEN"
Confirm with claude mcp list and /mcp inside a session.
Docker
docker build -t sqlite-explorer-mcp .
docker run --rm -p 8080:8080 \
-e MCP_BEARER_TOKEN=$(openssl rand -hex 32) \
-e BIND_HOST=0.0.0.0 \
-v "$(pwd)/data.db:/app/data.db:ro" \
sqlite-explorer-mcp
Terminate TLS at a reverse proxy in front of the container; never expose the plain HTTP port publicly. For per-user identity/revocation, Streamable HTTP also supports OAuth 2.0 — ship the bearer token first and add OAuth only when compliance requires named-user attribution.
Configuration
All via environment (see .env.example): SQLITE_PATH, PORT, BIND_HOST, MCP_BEARER_TOKEN,
MAX_ROWS, QUERY_TIMEOUT_MS, LOG_LEVEL.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.