sqlite-ro-mcp
Provides read-only access to SQLite databases, with tools for listing databases, listing tables, describing table schemas, and running SELECT/WITH/EXPLAIN queries with parameter binding and result limits.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sqlite-ro-mcpWhat tables are in the sales database?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sqlite-ro-mcp
A read-only SQLite MCP server in one auditable Python file.
Most "read-only" SQLite MCP servers are write-capable servers with a switch: an env var, or even a tool argument the model itself can flip. This server takes a different position: the write path does not exist.
Defense in depth
No mutating tool is defined. There is nothing to toggle.
Every statement is validated - head whitelist (
SELECT/WITH/EXPLAIN) plus a write-keyword scan on comment- and literal-stripped SQL, soWITH cte AS (...) INSERT ...and keyword-in-string tricks are caught.Connections are opened
mode=ro. Even if a validation bug slipped through, SQLite itself refuses the write.
Layer 3 matters: SQLite accepts statements like WITH ... INSERT, which a
naive first-word check happily approves. Validation bugs are a when, not an
if - the connection flag is the guarantee, the validator is just the first
line. The test suite proves this directly: one test bypasses the validator
entirely (calls the connection layer straight) and confirms SQLite itself
still refuses the write.
The whole server is a single file of a few hundred lines with one dependency
(the official mcp SDK). You can audit the entire attack surface in a few
minutes.
Related MCP server: sqlite-explorer-mcp
Install
pipx install sqlite-ro-mcp # or: pip install sqlite-ro-mcpOr run from a checkout: pip install -e .
Use with Claude Code
claude mcp add sqlite-ro -- sqlite-ro-mcp --db sales=path/to/sales.db --db logs=path/to/logs.dbMultiple databases are exposed by named alias allowlist - only the files you name are reachable (no directory scanning).
Tools
tool | description |
| aliases and file paths this server exposes |
| tables and views |
| columns, types, nullability, primary key |
| single SELECT / WITH / EXPLAIN, |
Options
usage: sqlite-ro-mcp [-h] --db [NAME=]PATH [--timeout TIMEOUT] [--instructions INSTRUCTIONS]
Read-only SQLite MCP server
options:
-h, --help show this help message and exit
--db [NAME=]PATH SQLite file to expose; repeatable
--timeout TIMEOUT per-query timeout in seconds (default 30)
--instructions INSTRUCTIONS
override the instructions text advertised to clientsNon-goals
Writes of any kind, remote databases, authentication. If you need a write-capable server, use one that is honest about being one.
Authorship
Built with Claude Code. Requirements, the no-write-path design constraint,
and review are by the author; implementation is AI-assisted and covered by
the test suite in tests/.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceA lightweight MCP server that provides read-only access to SQLite databases, allowing users to execute SELECT queries, list tables, and describe table schemas.1MIT
- AlicenseAqualityCmaintenanceRead-only SQLite database explorer for MCP clients. Allows discovery of tables and columns via resources and running SELECT queries via a tool.2MIT
- Alicense-qualityCmaintenanceA read-only MCP server that enables LLMs to safely explore and query any SQLite database via natural language. It exposes tools for listing tables, describing schemas, and executing SELECT/WITH queries with built-in safety guards like write prevention and row limits.MIT
- Alicense-qualityCmaintenanceRead-only MCP server for SQLite databases, enabling AI assistants to safely query and inspect database schemas without write access.MIT
Related MCP Connectors
Explore your Messages SQLite database to browse tables and inspect schemas with ease. Run flexible…
UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pinggu17/sqlite-ro-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server