MCP SQLite Server
Query, explore, and manage SQLite databases through the Model Context Protocol. Connect any MCP-compatible AI client to your databases.
README
šļø MCP SQLite Server
Query, explore, and manage SQLite databases through the Model Context Protocol. Connect any MCP-compatible AI client to your databases ā Claude Desktop, Cursor, VS Code, and more.
⨠Features
- š 3 Tools:
query,execute,list_tablesā full database interaction - š 2+ Resources:
sqlite://tables(full schema),sqlite://{table}/schema(per-table) - š¬ 1 Prompt:
database_analyst(question)ā guided analysis workflow - š Security-First: Read-only by default, explicit
--allow-writeflag for mutations - š WAL Mode: Write-Ahead Logging for better concurrent access
- š„ļø Dual Transport: stdio (local) and Streamable HTTP (remote)
- š² Sample Data: Seed script included for instant testing
š Quick Start
# 1. Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# 2. Create sample database
python seed_data.py --db-path /tmp/sample.db
# 3. Start server (read-only mode)
python sqlite_server.py --db-path /tmp/sample.db
š ļø Tools
query(sql: str) -> str
Execute a SELECT query. Only SELECT and PRAGMA statements are allowed.
Example: query("SELECT name, price FROM products WHERE category = 'Electronics'")
execute(sql: str) -> str
Run INSERT, UPDATE, or DELETE. Requires --allow-write flag.
Example (with --allow-write):
execute("INSERT INTO products (name, price, category, stock) VALUES ('Webcam 4K', 129.99, 'Electronics', 50)")
list_tables() -> str
List all tables with row counts.
š Security Model
| Feature | Default | With --allow-write |
|---|---|---|
| SELECT/PRAGMA queries | ā Allowed | ā Allowed |
| INSERT/UPDATE/DELETE | ā Blocked | ā Allowed |
| DROP/ALTER/CREATE | ā Blocked | ā Blocked |
| Row factory protection | ā Enabled | ā Enabled |
ā ļø Production tip: Always use read-only mode for public-facing or shared databases. Only enable
--allow-writein trusted environments.
š Resources
sqlite://tables
Returns complete database schema with column types, nullability, defaults, and primary keys.
sqlite://{table}/schema
Returns schema for a specific table.
š¬ Prompts
database_analyst(query_question: str)
Creates a structured prompt for analyzing database data.
š Connecting to Clients
Claude Desktop
{
"mcpServers": {
"sqlite": {
"command": "python",
"args": ["/ABSOLUTE/PATH/mcp-sqlite-server/sqlite_server.py", "--db-path", "/tmp/sample.db"]
}
}
}
Cursor
Settings ā Features ā MCP ā Add Server:
- Name:
sqlite - Type:
command - Command:
python /ABSOLUTE/PATH/mcp-sqlite-server/sqlite_server.py --db-path /tmp/sample.db
š Project Structure
mcp-sqlite-server/
āāā sqlite_server.py # Main server (FastMCP)
āāā seed_data.py # Sample database creator
āāā requirements.txt
āāā setup.sh
āāā README.md
āāā .gitignore
š 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.