mcp-sqlite
Enables AI agents to query and explore SQLite databases through schema inspection, arbitrary SQL execution, and predefined canned queries. Compatible with Datasette metadata for enriching database structure with descriptions.
What is mcp-sqlite?
mcp-sqlite is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai agents to query and explore sqlite databases through schema inspection, arbitrary sql execution, and predefined canned queries. compatible with datasette metadata for enriching database str...
Enables AI agents to query and explore SQLite databases through schema inspection, arbitrary SQL execution, and predefined canned queries. Compatible with Datasette metadata for enriching database structure with descriptions.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables AI agents to query and explore SQLite databases thro
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-sqliteConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use mcp-sqlite
mcp-sqlite is an MCP server that gives AI agents structured access to SQLite databases through three core tools: catalog inspection, arbitrary SQL execution, and auto-generated canned query tools. It supports Datasette-compatible YAML/JSON metadata files that enrich the database schema with human-readable descriptions, hide sensitive tables, and define parameterized canned queries that become first-class MCP tools. Developers and analysts who want their AI assistant to explore, query, and reason about local SQLite databases — including existing Datasette projects — will find this server immediately useful.
Prerequisites
- Python 3.9 or later and the uv package manager (https://docs.astral.sh/uv/)
- A SQLite database file to explore
- An MCP client such as VS Code with GitHub Copilot, Claude Desktop, or Cursor
- Optionally, a Datasette-compatible metadata YAML/JSON file for enriched schemas
Install uv
Install the uv package manager, which is used to run mcp-sqlite without a manual install step.
curl -LsSf https://astral.sh/uv/install.sh | shTest the server with a sample database
Run the server against your SQLite file using uvx. Pass an optional metadata file with the --metadata flag to enrich the schema.
uvx mcp-sqlite your-database.db
# With Datasette-compatible metadata
uvx mcp-sqlite your-database.db --metadata your-metadata.ymlInspect with MCP Inspector (optional)
Use the MCP Inspector to browse available tools and test queries before wiring into a full client.
npx @modelcontextprotocol/inspector uvx mcp-sqlite your-database.db --metadata your-metadata.ymlConfigure your MCP client
Add mcp-sqlite to your MCP client configuration. Adjust the database path and optional metadata path as needed.
// claude_desktop_config.json
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": [
"mcp-sqlite",
"/absolute/path/to/your-database.db",
"--metadata",
"/absolute/path/to/your-metadata.yml"
]
}
}
}Define canned queries in metadata (optional)
Add predefined SQL queries to your metadata YAML file. Each canned query becomes its own MCP tool that the AI can call by name.
# your-metadata.yml
tables:
passengers:
title: Titanic Passengers
description: Passenger manifest with survival data
canned_queries:
survivors_by_age:
title: Survivors by Age
description: Find survivors filtered by age
sql: SELECT * FROM passengers WHERE survived=1 AND age=:ageQuery your database through natural language
Ask your AI assistant questions about your database. It will use sqlite_get_catalog to understand the schema and sqlite_execute to run queries.
mcp-sqlite Examples
Client configuration
Claude Desktop config running mcp-sqlite with a database and metadata file via uvx
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": [
"mcp-sqlite",
"/Users/yourname/data/titanic.db",
"--metadata",
"/Users/yourname/data/titanic.yml"
]
}
}
}Prompts to try
Example natural language queries for exploring a SQLite database
- "What tables are in this database and what do they contain?"
- "Get all Titanic survivors who were 28 years old."
- "How many passengers survived grouped by passenger class?"
- "Show me the schema for the orders table."
- "Run the survivors_by_age canned query for age 35."Troubleshooting mcp-sqlite
uvx command not found
Install uv from https://docs.astral.sh/uv/ and run 'source ~/.bashrc' or open a new terminal. Verify with 'which uvx'.
sqlite_execute returns an error about a read-only database
Ensure the SQLite file and its parent directory are writable by the current user. If using a canned query with write restrictions, check the metadata file's write settings.
Canned query tools do not appear in the MCP tool list
Verify the metadata file is valid YAML/JSON and that the canned_queries section is correctly indented. Run 'uvx mcp-sqlite your.db --metadata your.yml --verbose' to see any parsing errors.
Frequently Asked Questions about mcp-sqlite
What is mcp-sqlite?
mcp-sqlite is a Model Context Protocol (MCP) server that enables ai agents to query and explore sqlite databases through schema inspection, arbitrary sql execution, and predefined canned queries. compatible with datasette metadata for enriching database structure with descriptions. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install mcp-sqlite?
Follow the installation instructions on the mcp-sqlite GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with mcp-sqlite?
mcp-sqlite works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is mcp-sqlite free to use?
Yes, mcp-sqlite is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.
mcp-sqlite Alternatives — Similar Databases Servers
Looking for alternatives to mcp-sqlite? 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 mcp-sqlite 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 mcp-sqlite?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.