A SQLite MCP server with JSONB support, database administration tools, and advanced database operations
Project description
SQLite MCP Server
Last Updated: October 3, 2025
Enterprise-grade SQLite with AI-native JSON operations & intelligent workflow automation โ v2.6.1
Transform SQLite into a powerful, AI-ready database engine with 73 specialized tools for advanced analytics, JSON operations, text processing, vector search, geospatial operations, and intelligent workflow automation.
๐ Table of Contents
Quick Start
- โ Quick Test - Verify Everything Works
- ๐ Quick Start
- ๐ฅ Core Capabilities
- ๐ข Enterprise Features
Configuration & Usage
Resources & Information
- ๐ Why Choose SQLite MCP Server?
- ๐ AI-Powered Wiki Search
- ๐ Complete Documentation
- ๐ Additional Resources
- ๐ Quick Links
- ๐ Project Stats
โ Quick Test - Verify Everything Works
Test all 73 tools in 30 seconds!
Quick smoke test:
python test_runner.py --quick
Standard comprehensive test (recommended):
python test_runner.py --standard
Full test suite with edge cases:
python test_runner.py --full
Expected output:
๐ SQLite MCP Server Comprehensive Test Suite v2.6.1
================================================================
๐ Environment Detection:
โ
SQLite 3.50.4 (JSONB supported)
โ
Python 3.12.11
โ
MCP 1.14.0
๐ Testing 73 Tools across 14 categories...
โ
Core Database Operations (8/8 passed)
โ
JSON Helper Tools (6/6 passed)
โ
JSON Operations (12/12 passed)
โ
Text Processing (8/8 passed)
๐ SUCCESS: All 73 tools tested successfully!
๐ก๏ธ Security Testing
NEW: Comprehensive SQL injection protection testing
Test SQL injection protection (from tests directory):
cd tests && python test_sql_injection.py
Expected result: ๐ก๏ธ Overall security posture: STRONG
What it tests:
- Protection against the SQL injection vulnerability found in original Anthropic SQLite MCP server
- 11 different attack vectors including multiple statements, UNION injection, blind injection
- Parameter binding protection with malicious payloads
- Stacked queries and comment-based injection attempts
โฌ๏ธ Back to Table of Contents
๐ Quick Start
Option 1: Docker (Recommended)
Pull and run instantly:
docker pull writenotenow/sqlite-mcp-server:latest
Run with volume mount:
docker run -i --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server:latest \
--db-path /workspace/database.db
๐ก๏ธ Supply Chain Security
For enhanced security and reproducible builds, use SHA-pinned images:
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 pull writenotenow/sqlite-mcp-server:master-YYYYMMDD-HHMMSS-<commit>
Option 2: Multi-arch manifest digest (maximum security)
docker pull writenotenow/sqlite-mcp-server@sha256:<manifest-digest>
Example: Run with cryptographically verified image
docker run -i --rm \
-v $(pwd):/workspace \
writenotenow/sqlite-mcp-server:master-YYYYMMDD-HHMMSS-<commit> \
--db-path /workspace/database.db
How 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
- โ Reproducible Builds - Exact image verification for compliance
Option 2: Python Installation
Install from PyPI:
pip install sqlite-mcp-server-enhanced
Or install from source:
git clone https://github.com/neverinfamous/sqlite-mcp-server.git
Navigate to directory:
cd sqlite-mcp-server
Install requirements:
pip install -r requirements.txt
Run the server:
python start_sqlite_mcp.py --db-path ./database.db
Option 3: Test in 30 Seconds
Clone repository:
git clone https://github.com/neverinfamous/sqlite-mcp-server.git
Navigate to directory:
cd sqlite-mcp-server
Run quick test:
python test_runner.py --quick
๐ NEW in v2.6.0: Complete JSON Operations Suite
5 Major Improvements in this release:
- ๐ฏ JSON Helper Tools - 6 specialized tools for simplified JSON operations with path validation and merging
- ๐ค JSON Auto-Normalization - Automatically fixes Python-style JSON with configurable strict mode
- ๐ก๏ธ Parameter Binding Interface - Enhanced MCP tools with SQL injection prevention
- ๐ฆ Automatic Parameter Serialization - Direct object/array parameters, no manual JSON.stringify()
- ๐ง Enhanced JSON Error Diagnostics - Intelligent error categorization with contextual guidance
๐ฅ Core Capabilities
- ๐ Statistical Analysis - Descriptive stats, percentiles, time series analysis
- ๐ Advanced Text Processing - Regex, fuzzy matching, phonetic search, similarity
- ๐ง Vector/Semantic Search - AI-native embeddings, cosine similarity, hybrid search
- ๐บ๏ธ SpatiaLite Geospatial - Enterprise GIS with spatial indexing and operations
- ๐ Transaction Safety - Auto-wrapped transactions with rollback protection
- ๐๏ธ 73 Specialized Tools - Complete database administration and analytics suite
๐ข Enterprise Features
- ๐ Business Intelligence - Integrated insights memo and workflow automation
- ๐ Backup/Restore - Enterprise-grade operations with integrity verification
- ๐ฏ Full-Text Search (FTS5) - Advanced search with BM25 ranking and snippets
- ๐๏ธ Virtual Tables - Smart CSV/JSON import with automatic type inference
- โ๏ธ Advanced PRAGMA - Complete SQLite configuration and optimization
โฌ๏ธ Back to Table of Contents
๐ MCP Client Configuration
Claude Desktop
{
"mcpServers": {
"sqlite-mcp-server": {
"command": "python",
"args": ["/path/to/sqlite-mcp-server/start_sqlite_mcp.py", "--db-path", "/path/to/database.db"]
}
}
}
Docker with Claude Desktop
{
"mcpServers": {
"sqlite-mcp-server": {
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "/path/to/project:/workspace", "writenotenow/sqlite-mcp-server:latest", "--db-path", "/workspace/database.db"]
}
}
}
โฌ๏ธ Back to Table of Contents
๐จ Usage Examples
Data Analysis Workflow
- Quick validation:
python test_runner.py --quick
- Start with your data:
python start_sqlite_mcp.py --db-path ./sales_data.db
- Use with Claude/Cursor for:
- Statistical analysis of your datasets
- Text processing and pattern extraction
- Vector similarity search
- Geospatial analysis and mapping
- Business intelligence insights
Docker Development
Development with live reload:
docker run -i --rm \
-v $(pwd):/workspace \
-e SQLITE_DEBUG=true \
writenotenow/sqlite-mcp-server:latest \
--db-path /workspace/dev.db
๐ฏ JSON Helper Tools - Simplified JSON Operations
NEW in v2.6.0: Six powerful JSON helper tools that make complex JSON operations simple:
// โ
Insert JSON with auto-normalization
json_insert({
"table": "products",
"column": "metadata",
"data": {'name': 'Product', 'active': True, 'price': None}
})
// โ
Update JSON by path
json_update({
"table": "products",
"column": "metadata",
"path": "$.price",
"value": 29.99,
"where_clause": "id = 1"
})
// โ
Query JSON with complex filtering
json_query({
"table": "products",
"column": "metadata",
"filter_paths": {"$.category": "electronics"},
"select_paths": ["$.name", "$.price"]
})
JSON Helper Tools:
- ๐ฏ json_insert - Insert JSON data with auto-normalization
- ๐ json_update - Update JSON by path with creation support
- ๐ json_select - Extract JSON data with multiple output formats
- ๐ json_query - Complex JSON filtering and aggregation
- โ json_validate_path - Validate JSON paths with security checks
- ๐ json_merge - Merge JSON objects with conflict resolution
Auto-normalization still works:
- ๐ง Single quotes โ Double quotes
- ๐ง Python
True/Falseโ JSONtrue/false - ๐ง Python
Noneโ JSONnull - ๐ง Trailing commas removed
- ๐ก๏ธ Security validation prevents malicious input
๐ง Enhanced JSON Error Diagnostics
Enhanced in v2.6.0: When JSON validation fails, get intelligent, contextual error messages with specific guidance:
// โ Invalid JSON input:
validate_json('{key_without_quotes: "value"}')
// โ
Enhanced error response:
{
"valid": false,
"error": "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)",
"enhanced_message": "JSON validation failed (structural_syntax): Expecting property name...",
"error_context": {
"error_type": "structural_syntax",
"security_concern": false,
"suggestions": [
"Ensure all object keys are properly quoted strings",
"Check for missing colons (:) between keys and values",
"Verify proper key-value pair structure: \"key\": \"value\""
]
}
}
Enhanced Error Categories:
- ๐ง Structural Issues - Missing quotes, colons, brackets with specific fix suggestions
- ๐ก๏ธ Security Warnings - Detects potential SQL injection patterns in JSON strings
- ๐ Encoding Problems - Character encoding and escape sequence guidance
- ๐ฏ Context-Aware Tips - Line/column position with targeted recommendations
๐ก๏ธ Enhanced Parameter Binding + Auto-Serialization
NEW in v2.6.0: Built-in SQL injection protection with automatic JSON serialization:
// โ
SECURE: Parameter binding prevents injection
read_query({
"query": "SELECT * FROM users WHERE name = ? AND age > ?",
"params": ["John", 25]
})
// โ
NEW: Direct object/array parameters (auto-serialized)
write_query({
"query": "INSERT INTO products (metadata, tags) VALUES (?, ?)",
"params": [
{"name": "Product", "price": 29.99, "active": true}, // Auto-serialized to JSON
["electronics", "featured", "new"] // Auto-serialized to JSON
]
})
// โ
SIMPLIFIED: No more manual JSON.stringify()
// Before v2.6.0:
write_query({
"query": "INSERT INTO table (data) VALUES (?)",
"params": [JSON.stringify({"key": "value"})] // Manual serialization required
})
// After v2.6.0:
write_query({
"query": "INSERT INTO table (data) VALUES (?)",
"params": [{"key": "value"}] // Automatic serialization!
})
v2.6.0 Benefits:
- ๐ก๏ธ SQL Injection Prevention - Parameter binding treats malicious input as literal data
- ๐ฆ Auto-Serialization - Objects and arrays automatically converted to JSON strings
- ๐ Backward Compatible - Existing queries continue to work unchanged
- โก Better Performance - Query plan caching and parameter optimization
- ๐ Cleaner API - No manual JSON.stringify() or parameter preparation needed
โฌ๏ธ Back to Table of Contents
๐ Tool Categories
The SQLite MCP Server provides 73 specialized tools across 14 categories:
๐ก Want the complete tool list? See the detailed tool reference with descriptions for all 73 tools, 7 resources, and 7 prompts.
| Category | Tool Count | Description |
|---|---|---|
| Core Database | 15 | CRUD operations, schema management, transactions |
| JSON Helper Tools | 6 | Simplified JSON operations, path validation, merging |
| Text Processing | 9 | Regex, fuzzy matching, phonetic search, similarity |
| Statistical Analysis | 8 | Descriptive stats, percentiles, time series |
| Virtual Tables | 8 | CSV, R-Tree, series generation |
| Semantic Search | 8 | Embeddings, similarity, hybrid search |
| Geospatial | 7 | Spatial indexing, geometric operations |
| PRAGMA Operations | 5 | Configuration, optimization, introspection |
| Full-Text Search | 3 | FTS5 creation, indexing, BM25 ranking |
| Vector Optimization | 2 | ANN search, clustering, performance |
| Data Analysis | 2 | Smart CSV/JSON import with type inference |
| Resources | 7 | Database meta-awareness, performance insights |
| Prompts | 7 | Guided workflows, optimization recipes |
๐ก Cursor Users: You can enable only the categories you need in your MCP client settings to reduce tool noise and improve stability. Each number above shows the count of tools in that category.
โฌ๏ธ Back to Table of Contents
๐ Why Choose SQLite MCP Server?
โ
AI-Friendly - JSON auto-normalization and intelligent error messages reduce debugging time
โ
Just Works - Built-in security and parameter binding with zero configuration
โ
Smart Diagnostics - Enhanced error context provides actionable guidance when issues occur
โ
Instantly Testable - Validate all 73 tools in 30 seconds
โ
Production Ready - Enterprise-grade testing and validation
โ
Comprehensive - Everything you need in one package
โ
Docker Ready - Containerized for easy deployment
โ
Zero Breaking Changes - All existing code continues to work
โฌ๏ธ Back to Table of Contents
๐ AI-Powered Wiki Search
โ Search the Documentation with AI
Can't find what you're looking for? Use our AI-powered search interface to query the complete wiki documentation:
- ๐ค AI-Enhanced Mode - Get natural language answers with source attribution
- โก Vector Search Mode - Find relevant documentation chunks instantly
- ๐ Searches All 73 Tools - Complete coverage of the entire wiki
- ๐ฏ Context-Aware - Understands your questions and provides relevant examples
Example queries:
- "How do I prevent SQL injection attacks?"
- "What statistical analysis tools are available?"
- "How do I set up vector search with embeddings?"
The search interface uses Cloudflare's AutoRAG technology to provide intelligent, context-aware answers from our comprehensive wiki documentation.
โฌ๏ธ Back to Table of Contents
๐ Complete Documentation
โ Wiki: Comprehensive Documentation & Examples
Comprehensive documentation including:
- Detailed tool reference - All 73 tools with examples
- Advanced configuration - Performance tuning and optimization
- Integration guides - MCP clients, Docker, CI/CD
- Feature deep-dives - Text processing, vector search, geospatial
- Best practices - Query patterns, troubleshooting, workflows
- API reference - Complete tool schemas and parameters
โฌ๏ธ Back to Table of Contents
๐ Additional Resources
- Testing Guide - Comprehensive testing documentation
- Contributing - How to contribute to the project
- Security Policy - Security guidelines and reporting
- Code of Conduct - Community guidelines
- Docker Hub - Container images
- GitHub Releases - Version history
- Adamic Support Blog - Project announcements and releases
โฌ๏ธ Back to Table of Contents
๐ Quick Links
| Action | Command |
|---|---|
| AI-Powered Search | search.adamic.tech |
| Test Everything | python test_runner.py --standard |
| Docker Quick Start | docker run -i --rm -v $(pwd):/workspace writenotenow/sqlite-mcp-server:latest |
| Install from PyPI | pip install sqlite-mcp-server-enhanced |
| View Full Docs | docs/sqlite-mcp-server.wiki |
| Report Issues | GitHub Issues |
โฌ๏ธ Back to Table of Contents
๐ Project Stats
- 73 Tools across 14 categories
- 2,000+ lines of comprehensive documentation
- Multi-platform support (Windows, Linux, macOS)
- Docker images for amd64 and arm64
- Enterprise testing with comprehensive validation
- Active development with regular updates
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlite_mcp_server_enhanced-2.6.1.tar.gz.
File metadata
- Download URL: sqlite_mcp_server_enhanced-2.6.1.tar.gz
- Upload date:
- Size: 206.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8a9b609d334ac444d2c180e8c33b9a0b83810034f01f8beaed894fb3ba4ffb6
|
|
| MD5 |
7edc470d75882241d58d98237dcff93f
|
|
| BLAKE2b-256 |
eec2400cb246e164a52c259ae2020d8f20678cc810d5539bbc67e4e59212892f
|
File details
Details for the file sqlite_mcp_server_enhanced-2.6.1-py3-none-any.whl.
File metadata
- Download URL: sqlite_mcp_server_enhanced-2.6.1-py3-none-any.whl
- Upload date:
- Size: 85.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06746d19906ff0124313f27c0f9942a13e4ab59742a577112c4637f7dab60bc0
|
|
| MD5 |
817f456abfdd9d2d1d05749a61c2ca88
|
|
| BLAKE2b-256 |
7c084c8629d931c1cf7e3687a7a5c8ba043fe3a7f926735086dce1ca2e8c7ffc
|