SuperAPIAI Directory

sqlite-mcp-server

github.com · AI developer platforms

sqlite-mcp-server is a lightweight open-source Model Context Protocol (MCP) server that lets LLM assistants such as Claude Desktop and Cursor safely inspect and query local SQLite databases. It provides automated database schema discovery, strict read-only query safety validation, query result row truncation protection, and structured JSON error responses designed for AI, helping models complete database analysis and queries within a controlled scope.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

sqlite-mcp-server is an open-source MCP server whose goal is to connect local SQLite databases to LLM assistants (such as Claude Desktop and Cursor) in a safe, controlled manner.

Purpose: to enable AI assistants to view database schemas and execute read-only queries while avoiding accidental data modification or dangerous operations.

Main capabilities:

  • Automated schema discovery: can inspect table lists, object types (table/view), row count estimates, columns, primary keys, foreign keys, and full DDL definitions.
  • Strict read-only safety: rejects mutating statements such as INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, ATTACH, VACUUM, and REINDEX at the parser level; blocks multi-statement execution chained with semicolons; restricts dangerous PRAGMAs; and opens connections in read-only URI mode (file:path?mode=ro) while enabling PRAGMA query_only = ON.
  • Context overflow protection: truncates oversized query results via max_rows and prompts the AI to use LIMIT and OFFSET.
  • AI-oriented structured errors: returns JSON error objects containing error_type, message, query, and suggestion, covering categories such as DisallowedQueryError, SyntaxError, TableNotFoundError, ColumnNotFoundError, DatabaseNotFoundError, DatabaseConfigError, and ValidationError, making it easy for models to self-correct.
  • Full MCP capabilities: provides Tools, direct Resources (sqlite://schema, sqlite://tables), and guided Prompts (schema_analysis, safe_query_assistant).

Usage:

  • The database path can be specified dynamically via the CLI argument --db-path, the environment variable SQLITE_DB_PATH, or the db_path parameter on each tool call.
  • Installation methods include running directly with uvx (recommended), or installing from source.
  • It can be configured in Claude Desktop's claude_desktop_config.json, or in Cursor's settings interface or the project-level .cursor/mcp.json.
  • The project provides an automated test suite based on pytest.

Use cases: developer scenarios that require an AI assistant to analyze local SQLite database schemas, generate safe SELECT queries, and perform read-only data exploration.

Limitations: only targets local SQLite databases; supports only read-only queries and does not support any data writes or schema changes; the specific installation commands and configuration examples are not fully provided in the materials and are not yet available.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools