sqlite-mcp
An MCP server that enables AI agents to interact with SQLite databases by querying schemas, executing SQL, and inspecting table metadata. It supports safe database access through configurable read-only modes, query timeouts, and dry-run execution plans.
README
sqlite-mcp
An MCP (Model Context Protocol) server that exposes SQLite databases as tools for AI agents. Connect any SQLite database and let LLMs query schemas, run SQL, and inspect tables through a standardized interface.
Features
execute_sql— Run arbitrary SQL statements with support for dry-run mode (EXPLAIN QUERY PLAN), automatic result truncation, and configurable row limits.get_table_info— Retrieve complete table metadata in a single call: columns, types, DDL, indexes, foreign keys, and row count.- Read-only mode — Optionally block all write operations for safe, production-friendly access.
- Query timeout — Configurable per-query timeout to prevent runaway queries.
Requirements
- Python 3.11+
- uv (recommended) or pip
Installation
# Clone the repository
git clone https://github.com/<owner>/sqlite-mcp.git
cd sqlite-mcp
# Install with uv
uv sync
Or with pip:
pip install .
Usage
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
SQLITE_DB_PATH |
Yes | — | Path to the SQLite database file |
SQLITE_READ_ONLY |
No | false |
Set to true to disable write operations |
SQLITE_TIMEOUT |
No | 30 |
Query timeout in seconds |
Running the Server
SQLITE_DB_PATH=./my_database.db sqlite-mcp
The server communicates over stdio and is designed to be launched by an MCP-compatible client (e.g., Cursor, Claude Desktop).
MCP Client Configuration
Add the server to your MCP client config (e.g., .cursor/mcp.json):
{
"mcpServers": {
"sqlite": {
"command": "uv",
"args": ["run", "--directory", "/path/to/sqlite-mcp", "sqlite-mcp"],
"env": {
"SQLITE_DB_PATH": "/path/to/database.db",
"SQLITE_READ_ONLY": "true"
}
}
}
}
Tools
execute_sql
Execute a SQL statement against the connected database.
| Parameter | Type | Default | Description |
|---|---|---|---|
sql |
str |
— | The SQL statement to execute |
dry_run |
bool |
false |
Return the query plan instead of executing |
max_rows |
int |
100 |
Maximum rows to return |
Example response (SELECT):
{
"results": [{"id": 1, "name": "Alice"}],
"row_count": 1,
"truncated": false
}
Example response (dry run):
{
"query_plan": [{"id": 0, "parent": 0, "detail": "SCAN users"}]
}
get_table_info
Get complete schema and metadata for a table.
| Parameter | Type | Description |
|---|---|---|
table |
str |
The table name to inspect |
Example response:
{
"table": "users",
"columns": [
{"name": "id", "type": "INTEGER", "nullable": false, "default": null, "primary_key": true},
{"name": "name", "type": "TEXT", "nullable": true, "default": null, "primary_key": false}
],
"ddl": "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)",
"indexes": [],
"foreign_keys": [],
"row_count": 42
}
License
This project is licensed under the MIT License. See LICENSE for details.
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
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.