mcp-sqlite

v1.0.0Databasesstable

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.

aitoolingcursordatabasedevelopmentequill-service
Share:
106
Stars
0
Downloads
0
Weekly
0/5

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

SQLite database querying
Schema exploration and inspection
Canned query execution
panasenco

Maintainer

LicenseApache 2.0
Languagejavascript
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-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 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
1

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

Test 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.yml
3

Inspect 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.yml
4

Configure 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"
      ]
    }
  }
}
5

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=:age
6

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

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": { "mcp-sqlite": { "command": "npx", "args": ["-y", "mcp-sqlite"] } } }

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

Read the full setup guide →

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.

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