MCP Server
SQLite MCP Server
A Model Context Protocol server that enables SQL operations (SELECT, INSERT, UPDATE, DELETE) and table management through a standardized interface with SQLite databases.
1
GitHub Stars
3/10/2026
Last Updated
MCP Server Configuration
1{
2 "name": "sqlite",
3 "command": "node",
4 "args": [
5 "/path/to/sqlite-mcp-server/build/index.js"
6 ]
7}
JSON7 lines
README Documentation
SQLite MCP Server
A Model Context Protocol (MCP) server that provides SQLite database operations. Supports both stdio (for Claude Desktop, Cursor, etc.) and Streamable HTTP (for remote clients) transports.
Features
- In-memory or file-based SQLite database
- Dual transport: stdio and Streamable HTTP
- SQL operations with input validation and injection protection
- Table management (CREATE, DROP, LIST, DESCRIBE)
- Database schema exposed as an MCP resource
- Business insights memo tracking
- Docker support
Quick Start
Stdio (Claude Desktop, Cursor, etc.)
npm install && npm run build
node build/index.js
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"sqlite": {
"command": "node",
"args": ["/path/to/sqlite-mcp-server/build/index.js"]
}
}
}
With a file-based database:
{
"mcpServers": {
"sqlite": {
"command": "node",
"args": ["/path/to/sqlite-mcp-server/build/index.js", "/path/to/database.db"]
}
}
}
Streamable HTTP (remote clients)
node build/index.js --http
The server exposes a single endpoint at http://localhost:3000/mcp following the MCP Streamable HTTP specification.
Docker
docker build -t sqlite-mcp-server .
docker run -d -p 3000:3000 --name sqlite-mcp sqlite-mcp-server
Configuration
| Option | Description | Default |
|---|---|---|
--http | Use Streamable HTTP transport instead of stdio | stdio |
| First non-flag argument | Path to SQLite database file | :memory: |
SQLITE_DB_PATH | Database path (env var alternative) | :memory: |
PORT | HTTP server port (HTTP mode only) | 3000 |
Examples:
# In-memory database on stdio
node build/index.js
# File-based database on stdio
node build/index.js ./data.db
# HTTP mode with custom port
PORT=8080 node build/index.js --http ./data.db
# Using environment variable
SQLITE_DB_PATH=./data.db node build/index.js --http
Available Tools
| Tool | Description |
|---|---|
read_query | Execute SELECT, WITH (CTE), or EXPLAIN queries |
write_query | Execute INSERT, UPDATE, DELETE, or REPLACE queries |
create_table | Create a new table with a CREATE TABLE statement |
drop_table | Drop a table (irreversible) |
list_tables | List all user-created tables |
describe_table | Get table schema: columns, indexes, and foreign keys |
append_insight | Add a business insight to the memo resource |
Resources
| URI | Description |
|---|---|
sqlite://{db}/schema | Full schema (CREATE statements) for all tables |
memo://insights | Accumulated business insights from analysis |
Prompts
| Name | Description |
|---|---|
mcp-demo | Guided walkthrough: creates tables, inserts sample data, runs queries for a given topic |
Remote Connection
Streamable HTTP
Connect any MCP-compatible client to http://your-host:3000/mcp. The server supports:
POST /mcp— send MCP messages (session created on initialize)GET /mcp— SSE stream for session resumabilityDELETE /mcp— terminate a sessionGET /health— health check endpoint
Sessions are managed via the Mcp-Session-Id header.
Security
- Query validation: each tool only accepts its intended SQL statement type
- Multi-statement injection blocked (semicolons within queries are rejected)
- Table names validated against
^[a-zA-Z_][a-zA-Z0-9_]*$ - WAL mode and foreign keys enabled by default
- DNS rebinding protection on HTTP transport
Development
npm install
npm run build
npm start # stdio mode
npm run start:http # HTTP mode
License
Quick Install
Quick Actions
Key Features
Model Context Protocol
Secure Communication
Real-time Updates
Open Source