SQLite MCP

v0.0.2β€’Databasesβ€’stable

πŸ“‡ 🏠 - SQLite operations β€” query databases, inspect schemas, explain queries, and expo

aiai-integrationclaudecursordata-analysis
Share:
13
Stars
0
Downloads
0
Weekly
0/5

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

Query and inspect SQLite databases
Data analysis and schema exploration
eduresser

Maintainer

LicenseMIT License
Languagepython
Versionv0.0.2
UpdatedApr 3, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y mcp-server-sqlite

Manual Installation

npx -y mcp-server-sqlite

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 .
2

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.db
3

Optionally 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=30
4

Test 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-mcp
5

Add 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.

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.

Quick Config Preview

{ "mcpServers": { "sqlite": { "command": "npx", "args": ["-y", "mcp-server-sqlite"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide β†’

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides