
sqlite-mcp-server
Read-only MCP server giving AI assistants safe query access to local SQLite databases
The repository was last updated 57 days ago and is published under MIT.
sqlite-mcp-server is an open-source MCP server for databases. It is available on CLI, Self-hosted, macOS, Windows and Linux.
- Pricing
- Open source
- Platforms
- CLI, Self-hosted, macOS
- What it can do
- Read-only
- GitHub stars
- 0
- Last commit
- Language
- Python
Similar MCP servers
About sqlite-mcp-server
Gives assistants such as Claude Desktop and Cursor a way to browse and query a local SQLite file without being able to change it. Schema details, including tables, views, columns, keys, indexes and DDL, can be pulled through dedicated tools, and free-form SELECT or EXPLAIN queries run through a validator that rejects write statements, chained statements and dangerous PRAGMAs.
Safety is enforced in two places: the query parser blocks mutation keywords, and the database connection itself is opened in read-only mode with query_only turned on. Large result sets are truncated by a configurable row limit, and errors come back as structured JSON with a type, message and suggested fix so the model can correct its own SQL.
It suits people who want an assistant to explore or analyse a local database, such as a developer inspecting an app's data, without risking accidental writes. The database path can be set at launch or per call.
Tools this server provides (4)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, all 4 tools only read data.
From the server's own tool labels and tool names; not verified by us.
- list_tablesName suggests: reads
- Lists all tables and views in the database with estimated row counts.
- describe_tableName suggests: reads
- Retrieves column definitions, data types, nullability, default values, primary keys, foreign keys, and indexes for a specific table.
- get_database_schemaName suggests: reads
- Returns the complete DDL schema definition for all tables, views, and indexes.
- read_queryName suggests: reads
- Safely executes a read-only SELECT or EXPLAIN query and returns structured row records.
What it does
- Schema discovery
- Lists tables and views with estimated row counts, then describes columns, keys, indexes and full DDL.
- Read-only query enforcement
- Blocks write and schema-altering SQL at parse time and opens the database read-only at the engine level.
- Row limit protection
- Truncates large query results at a configurable maximum and nudges the model toward LIMIT and OFFSET.
- Structured error responses
- Returns typed JSON errors with the offending query and a suggestion so models can retry correctly.
- Resources and prompts
- Exposes schema and table list as MCP resources, plus guided prompts for schema analysis and safe query writing.
- Flexible database path
- Accepts the database location from a command-line flag, an environment variable or each tool call.
Good for
- Letting an assistant explore an unfamiliar local SQLite database and explain its structure
- Asking natural-language questions of a local app database without risking changes to the data
- Generating optimised SELECT queries against a local file with the model checking its own syntax errors
- Reviewing a database's relationships and normalisation with the schema analysis prompt
Pricing
Open source
Free and MIT licensed.
More servers for the same service
sqlite-mcp-server FAQ
Can the server modify my database?
No. Write statements are rejected by the parser, and the connection is opened in read-only mode with query_only enabled.
Which AI clients can use sqlite-mcp-server?
The README gives setup steps for Claude Desktop and Cursor, and it runs as a standard MCP server over stdio.
How do I install sqlite-mcp-server?
It can be run instantly with uvx using the sqlite-mcp-server package, or installed from source with pip in editable mode.
What happens with very large query results?
Results are cut off at max_rows, which defaults to 1000, and the model is advised to page with LIMIT and OFFSET.
Is sqlite-mcp-server free?
Yes. sqlite-mcp-server is open source, so you can use and self-host it for free.
What are the best alternatives to sqlite-mcp-server?
The closest alternatives to sqlite-mcp-server are sqlite-explorer-fastmcp-mcp-server, Sqlite, mcp-sqlite, mysql_mcp_server and postgres_mcp.
Where this comes from
- Description: written from the project's README.



