-
Notifications
You must be signed in to change notification settings - Fork 0
Installation and Configuration
Temp edited this page Oct 19, 2025
·
7 revisions
Last Updated: October 4, 2025 7:00 AM EST
Complete installation and configuration guide for the SQLite MCP Server across different environments and use cases.
Click the button below to install directly into Cursor:
Or copy this deep link and paste into your browser:
cursor://anysphere.cursor-deeplink/mcp/install?name=SQLite%20MCP%20Server&config=eyJzcWxpdGUtbWNwIjp7ImFyZ3MiOlsicnVuIiwiLWkiLCItLXJtIiwiLXYiLCIkKHB3ZCk6L3dvcmtzcGFjZSIsIndyaXRlbm90ZW5vdy9zcWxpdGUtbWNwLXNlcnZlcjpsYXRlc3QiLCItLWRiLXBhdGgiLCIvd29ya3NwYWNlL3NxbGl0ZV9tY3AuZGIiXSwiY29tbWFuZCI6ImRvY2tlciJ9fQ==
Requirements:
- β Docker installed and running
- β ~500MB disk space available
What happens:
- Cursor prompts you to install the server
- Automatically configures the Docker setup
- Creates a
./sqlite_mcp.dbfile for your database - Restarts Cursor and connects to SQLite MCP
# Run instantly with Docker (creates a project-local database)
docker run -i --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server:latest \
--db-path /workspace/sqlite_mcp.dbFor enhanced security and reproducible builds:
# Find available SHA tags at: https://hub.docker.com/r/writenotenow/sqlite-mcp-server/tags
# Look for tags starting with "master-" or "sha256-" for cryptographically verified builds
# Option 1: Human-readable timestamped builds (recommended)
docker run -i --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server:master-YYYYMMDD-HHMMSS-<commit> \
--db-path /workspace/sqlite_mcp.db
# Option 2: Multi-arch manifest digest (maximum security)
docker run -i --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server@sha256:<manifest-digest> \
--db-path /workspace/sqlite_mcp.dbHow to Find SHA Tags:
- Visit Docker Hub Tags
-
For convenience: Use
master-YYYYMMDD-HHMMSS-<commit>tags (human-readable, multi-arch) -
For maximum security: Use
sha256-<hash>tags (manifest digests, immutable)
Understanding SHA Tags:
- π·οΈ
master-YYYYMMDD-HHMMSS-<commit>- Human-readable, timestamped, multi-arch safe - π
sha256-<manifest-digest>- Multi-arch manifest digest (works on all architectures) β οΈ Architecture-specific digests - Only for debugging specific architectures
Security Features:
- β Build Provenance - Cryptographic proof of build process
- β SBOM Available - Complete software bill of materials
- β Supply Chain Attestations - Verifiable build integrity
# Install from PyPI
pip install sqlite-mcp-server-enhanced
# Or install with uv (faster)
uv add sqlite-mcp-server-enhanced# Clone and install
git clone https://github.com/neverinfamous/sqlite-mcp-server.git
cd sqlite-mcp-server
pip install -e .# Basic usage with local database
docker run -i --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server:latest \
--db-path /workspace/my_database.db
# Interactive mode with shell access
docker run -it --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server:latest \
bash# docker-compose.yml
version: '3.8'
services:
sqlite-mcp:
image: writenotenow/sqlite-mcp-server:latest
volumes:
- ./data:/workspace
- ./backups:/backups
environment:
- SQLITE_DB_PATH=/workspace/app.db
- MCP_SERVER_NAME=sqlite-mcp
stdin_open: true
tty: true# Create named volume for persistence
docker volume create sqlite_data
# Run with named volume
docker run -i --rm \
-v sqlite_data:/data \
writenotenow/sqlite-mcp-server:latest \
--db-path /data/persistent.db# Create virtual environment
python -m venv sqlite-mcp-env
source sqlite-mcp-env/bin/activate # Linux/Mac
# or
sqlite-mcp-env\Scripts\activate # Windows
# Install package
pip install sqlite-mcp-server-enhanced# Install uv if not already installed
pip install uv
# Create project and install
uv init sqlite-mcp-project
cd sqlite-mcp-project
uv add sqlite-mcp-server-enhanced
# Run with uv
uv run python -m mcp_server_sqlite --db-path ./database.db# Clone repository
git clone https://github.com/neverinfamous/sqlite-mcp-server.git
cd sqlite-mcp-server
# Install in development mode
pip install -e .
# Install development dependencies
pip install -r requirements-dev.txt# Basic configuration
python -m mcp_server_sqlite \
--db-path ./my_database.db \
--host localhost \
--port 8080
# Advanced configuration
python -m mcp_server_sqlite \
--db-path ./my_database.db \
--host 0.0.0.0 \
--port 8080 \
--log-level INFO \
--enable-wal \
--cache-size 10000 \
--timeout 30# Set environment variables
export SQLITE_DB_PATH="./my_database.db"
export MCP_SERVER_HOST="localhost"
export MCP_SERVER_PORT="8080"
export MCP_LOG_LEVEL="INFO"
export SQLITE_ENABLE_WAL="true"
# Run with environment variables
python -m mcp_server_sqlite// mcp-config.json
{
"mcpServers": {
"sqlite-mcp": {
"command": "python",
"args": ["-m", "mcp_server_sqlite"],
"env": {
"SQLITE_DB_PATH": "./database.db",
"MCP_LOG_LEVEL": "INFO"
}
}
}
}# High-performance configuration
python -m mcp_server_sqlite \
--db-path ./database.db \
--enable-wal \
--cache-size 50000 \
--mmap-size 268435456 \
--synchronous NORMAL \
--journal-mode WAL# Security-focused configuration
python -m mcp_server_sqlite \
--db-path ./database.db \
--enable-foreign-keys \
--secure-delete \
--read-only false \
--max-connections 10 \
--timeout 30# Low-memory configuration
python -m mcp_server_sqlite \
--db-path ./database.db \
--cache-size 2000 \
--mmap-size 0 \
--temp-store file \
--synchronous FULL// Add to Claude Desktop MCP configuration
{
"mcpServers": {
"sqlite-mcp": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "${workspaceFolder}:/workspace",
"writenotenow/sqlite-mcp-server:latest",
"--db-path", "/workspace/claude_database.db"
]
}
}
}// Add to Cursor MCP settings
{
"mcpServers": {
"sqlite-database": {
"command": "python",
"args": ["-m", "mcp_server_sqlite"],
"env": {
"SQLITE_DB_PATH": "./cursor_workspace.db"
}
}
}
}# Python MCP client example
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def run_client():
server_params = StdioServerParameters(
command="python",
args=["-m", "mcp_server_sqlite"],
env={"SQLITE_DB_PATH": "./client_database.db"}
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize connection
await session.initialize()
# List available tools
tools = await session.list_tools()
print(f"Available tools: {[tool.name for tool in tools.tools]}")# Test basic functionality
python -c "
import sqlite3
from mcp_server_sqlite import create_server
print('β
Installation successful!')
print('β
SQLite version:', sqlite3.sqlite_version)
"# Run built-in test suite
python test_runner.py --quick
# Test specific features
python test_runner.py --json # JSON helper tools
python test_runner.py --fts # Full-text search
python test_runner.py --spatial # Spatial features
python test_runner.py --standard # Comprehensive test# Test Docker installation
docker run --rm writenotenow/sqlite-mcp-server:latest \
python -c "
from mcp_server_sqlite import create_server
print('β
Docker installation successful!')
"# If you get import errors
pip install --upgrade sqlite-mcp-server-enhanced
pip install --upgrade mcp
# Check Python version (requires 3.9+)
python --version# Fix database file permissions
chmod 666 ./database.db
chown $(whoami) ./database.db
# Or run with appropriate user in Docker
docker run -u $(id -u):$(id -g) -i --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server:latest# Check SQLite capabilities
import sqlite3
print("SQLite version:", sqlite3.sqlite_version)
print("Available extensions:", sqlite3.version_info)
# Test JSON support
conn = sqlite3.connect(':memory:')
try:
conn.execute("SELECT json('{\"test\": true}')")
print("β
JSON support available")
except:
print("β JSON support not available")# Enable WAL mode for better performance
python -m mcp_server_sqlite \
--db-path ./database.db \
--enable-wal \
--cache-size 20000
# Monitor performance
python -c "
import sqlite3
conn = sqlite3.connect('./database.db')
print('Cache size:', conn.execute('PRAGMA cache_size').fetchone())
print('Journal mode:', conn.execute('PRAGMA journal_mode').fetchone())
"# /etc/systemd/system/sqlite-mcp.service
[Unit]
Description=SQLite MCP Server
After=network.target
[Service]
Type=simple
User=mcp-user
WorkingDirectory=/opt/sqlite-mcp
Environment=SQLITE_DB_PATH=/data/production.db
Environment=MCP_LOG_LEVEL=INFO
ExecStart=/opt/sqlite-mcp/venv/bin/python -m mcp_server_sqlite
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target# Production Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN pip install -e .
# Create non-root user
RUN groupadd -r mcp && useradd -r -g mcp mcp
USER mcp
EXPOSE 8080
CMD ["python", "-m", "mcp_server_sqlite", "--host", "0.0.0.0", "--port", "8080"]# kubernetes-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: sqlite-mcp-server
spec:
replicas: 1
selector:
matchLabels:
app: sqlite-mcp-server
template:
metadata:
labels:
app: sqlite-mcp-server
spec:
containers:
- name: sqlite-mcp
image: writenotenow/sqlite-mcp-server:latest
ports:
- containerPort: 8080
env:
- name: SQLITE_DB_PATH
value: "/data/database.db"
volumeMounts:
- name: database-storage
mountPath: /data
volumes:
- name: database-storage
persistentVolumeClaim:
claimName: sqlite-mcp-pvc- Quick-Start - Getting started guide
- Best-Practices - Usage recommendations
- Troubleshooting - Common issues and solutions
- Core-Database-Tools - Basic functionality
π§ Installation Tip: Use Docker for the quickest start, but consider Python virtual environments for development and customization. Always test your installation with the built-in test suite.