SQLite MCP
π π - SQLite operations β query databases, inspect schemas, explain queries, and expo
What is SQLite MCP?
SQLite MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to π π - sqlite operations β query databases, inspect schemas, explain queries, and expo
π π - SQLite operations β query databases, inspect schemas, explain queries, and expo
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- read_query
- write_query
- create_table
- list_tables
- describe_table
Use Cases
Maintainer
Works with
Installation
NPM
npx -y mcp-server-sqliteManual Installation
npx -y mcp-server-sqliteConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use SQLite MCP
The sqlite-mcp server exposes a SQLite database file to AI assistants through a clean MCP interface, supporting both read and write SQL execution plus full table introspection. It provides two core toolsβexecute_sql for running arbitrary queries with dry-run (EXPLAIN QUERY PLAN) support, and get_table_info for retrieving column definitions, indexes, foreign keys, and row counts in a single call. Data engineers and developers use it to let AI assistants query local databases, analyze schemas, and assist with data exploration tasks without exposing raw file access.
Prerequisites
- Python 3.10+ installed
- uv package manager (recommended) or pip
- A SQLite database file (.db) to connect to
- No external API keys required
- An MCP-compatible client such as Claude Desktop or Cursor
Clone the repository and install dependencies
Clone the sqlite-mcp repository and install Python dependencies using uv or pip.
git clone https://github.com/eduresser/sqlite-mcp.git
cd sqlite-mcp
uv sync
# Or using pip:
pip install .Set the required environment variable
Set SQLITE_DB_PATH to the path of your SQLite database file. This is the only required configuration.
export SQLITE_DB_PATH=/path/to/your/database.dbOptionally enable read-only mode
Set SQLITE_READ_ONLY=true to prevent any write operations. This is recommended when giving an AI assistant access to a production database.
export SQLITE_READ_ONLY=true
export SQLITE_TIMEOUT=30Test the server directly
Run the server from the command line to verify it starts and connects to your database before wiring it to an MCP client.
SQLITE_DB_PATH=./my_database.db sqlite-mcpAdd to your MCP client configuration
Add the sqlite-mcp server to Claude Desktop or Cursor configuration using the uv run pattern so it launches with the correct environment.
SQLite MCP Examples
Client configuration
Cursor or Claude Desktop configuration using uv run to start sqlite-mcp with a specific database path and read-only mode enabled.
{
"mcpServers": {
"sqlite": {
"command": "uv",
"args": ["run", "--directory", "/path/to/sqlite-mcp", "sqlite-mcp"],
"env": {
"SQLITE_DB_PATH": "/path/to/your/database.db",
"SQLITE_READ_ONLY": "true",
"SQLITE_TIMEOUT": "30"
}
}
}
}Prompts to try
Example prompts for querying and exploring a SQLite database through an AI assistant.
- "List all tables in this database and describe their schemas."
- "How many rows are in the orders table? Show me the column names."
- "Run EXPLAIN QUERY PLAN on SELECT * FROM users WHERE email = '[email protected]'."
- "Find all foreign key relationships defined in this database."
- "What are the indexes on the products table and which columns do they cover?"
- "Query the top 10 customers by total order value from the orders and customers tables."Troubleshooting SQLite MCP
Server fails to start with 'SQLITE_DB_PATH not set' or similar error
The SQLITE_DB_PATH environment variable is required. Ensure it is set in your shell or in the MCP client configuration env block, and that the path points to an existing .db file.
Write queries fail even though SQLITE_READ_ONLY is not set
Check file permissions on the .db fileβthe process running sqlite-mcp must have write access. If the file is on a read-only filesystem or owned by another user, either fix permissions or set SQLITE_READ_ONLY=true to avoid confusing errors.
Queries time out on large datasets
Increase SQLITE_TIMEOUT beyond the default of 30 seconds. For very large tables, add LIMIT clauses to queries, or use EXPLAIN QUERY PLAN first to verify that queries use indexes.
Frequently Asked Questions about SQLite MCP
What is SQLite MCP?
SQLite MCP is a Model Context Protocol (MCP) server that π π - sqlite operations β query databases, inspect schemas, explain queries, and expo It connects AI assistants to external tools and data sources through a standardized interface.
How do I install SQLite MCP?
Install via npm with the command: npx -y mcp-server-sqlite. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with SQLite MCP?
SQLite MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is SQLite MCP free to use?
Yes, SQLite MCP is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
SQLite MCP Alternatives β Similar Databases Servers
Looking for alternatives to SQLite MCP? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
β 20.6kGo language library for reading and writing Microsoft Excelβ’ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
β 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
β 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
β 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
β 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
β 1.7kποΈ π βοΈ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up SQLite MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use SQLite MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.