SQLite MCP server tools: what write_query really runs, and how to make your agent ask
All 6 tools of the archived SQLite MCP server (mcp-server-sqlite 2025.4.25), checked by running it against a throwaway database: why it no longer starts from PyPI with today's MCP SDK, how write_query dropped a table and copied the database to another folder, which writes it reported but never saved, and the Claude Code settings that make the rest ask.
Checked on by running mcp-server-sqlite 2025.4.25 (PyPI, run with uvx and mcp 1.30.0, and the mcp/sqlite Docker image) from modelcontextprotocol/servers-archived and reading its tools/list answer. Each tier is the tool risk checker’s reading, with our reason wherever we changed it. Written by the people who make VariantGate.
The short answer
Archived, with no read-only switch, and installed with uvx it crashes on start with today's MCP SDK; the mcp/sqlite Docker image still starts. Let its 4 look-only tools run, and make write_query and create_table ask: write_query runs any statement but SELECT, DROP TABLE and VACUUM INTO included.
- Can run on their own
- 4
- Should ask a person
- 2
Which SQLite server this is
This page is about the reference SQLite server from the MCP project, mcp-server-sqlite on PyPI. Its repository has been archived: the archive’s README says the servers in it are no longer maintained and get no security updates. Its last release, 2025.4.25, is from April 2025, yet pypistats counted about 42,000 downloads of it in the 30 days to 23 November 2026. We ran it with uvx against a throwaway database file. It offers the same 6 tools every time, with no read-only or destructive hints. Its only option is --db-path: there is no read-only mode and no flag to switch a tool off.
It no longer starts the way its README says
The package asks for mcp[cli]>=1.6.0 with no upper limit, so uvx mcp-server-sqlite now installs version 2 of the MCP Python SDK, 2.3.0 for us. The server then stopped before answering anything, with AttributeError: 'Server' object has no attribute 'list_resources'. It failed the same way with mcp 2.0.0, released in July 2026. With --with mcp==1.30.0, the last 1.x release, it started, and every run on this page used that. The mcp/sqlite Docker image, built in June 2025 with its packages fixed, still starts: it listed the same six tools, and its write_query dropped a table too. The setup below uses that image, pinned to the digest we ran.
write_query runs any statement but SELECT
Its description says INSERT, UPDATE or DELETE, but the code only refuses a query that starts with SELECT. Everything else we sent ran:
DROP TABLE customersdropped the table and answeredaffected_rows: -1.VACUUM INTO '…/elsewhere/copy.db'wrote a full copy of the database, every customer’s email included, into another folder. It refused a file that already had data in it and a folder that did not exist. Otherwise it can write anywhere the server process can.ATTACH DATABASEon a path that did not exist created an empty file there.PRAGMA user_version = 7andPRAGMA journal_mode = WALchanged the database file’s settings.WITH t AS (SELECT 1) DELETE FROM customers WHERE id = 1deleted the row.WITH … SELECTandVALUES (1)returned rows, so the write tool reads too.
Writes it reported but never saved
The server commits only when the statement starts with INSERT, UPDATE, DELETE, CREATE, DROP or ALTER. Python’s sqlite3 opens a transaction before REPLACE too, and before a write that follows a comment, so those were rolled back when the connection closed. REPLACE INTO customers …, /* add Eve */ INSERT … and -- remove Bob followed by a DELETE each answered [], the same answer VACUUM INTO gives when it works, and none of them changed a row. An agent has no way to tell, and may report a deletion that did not happen. WITH … DELETE does stick, because Python opens no transaction for a statement starting with WITH.
What read_query does stop
read_query refuses anything that does not start with SELECT, and Python runs one statement per call: SELECT 1; DELETE FROM customers WHERE id = 1 came back as “You can only execute one statement at a time” and the row stayed. SELECT load_extension(…) was “not authorized”. Each call opens a fresh connection, so a database attached through write_query was gone by the next read_query. It reads every table in the one file it was given, though, and errors come back as ordinary answers starting with “Error:” or “Database error:”, not as failed calls. describe_table puts the table name straight into its SQL; a name carrying a second statement was refused the same way.
Safe setup
claude mcp add sqlite -- docker run -i --rm -v ~/agent-db:/mcp:ro mcp/sqlite@sha256:efbc05ccace18df122f26b674bd1730c76ece716551df2b3961d519909c34696 --db-path /mcp/app.dbMount a folder holding a copy, not the database your app uses. The container sees only that folder, as /mcp. The server creates a missing file without a word, so a typo gives the agent a new, empty database. For an agent that only reads, mount it read-only with :ro, as above. With that, DELETE, DROP TABLE and VACUUM INTO the mounted folder all failed for us, and VACUUM INTO /tmp only wrote inside the container, which --rm throws away. Making the file itself read-only is weaker: chmod 444 on our copy, run with uvx, stopped DELETE but not VACUUM INTO another folder, and the container runs as root, which ignores the file’s mode. So write_query keeps asking either way.
The server also offers a prompt, mcp-demo, which only runs when you pick it. Its text tells the model not to ask what data is needed but to go ahead and create tables and insert rows, and to record findings with append_insight. That tool only adds a line to a memo held in memory, shown as the memo://insights resource; a restart emptied it.
All 6 tools
Hard to undo1 toolAsk a person every time. Consider two people, or deny it if the agent never needs it.
write_queryExecute an INSERT, UPDATE, or DELETE query on the SQLite database
Server gives no read-only or destructive hint
Our call: Runs any one statement that does not start with SELECT. DROP TABLE dropped the table, VACUUM INTO wrote a full copy of the database to another folder, and WITH … DELETE deleted a row.
Changes data1 toolAsk a person. Once it is routine, a standing rule can answer.
create_tableCreate a new table in the SQLite database
Server gives no read-only or destructive hint
Our call: Checks only that the statement starts with CREATE TABLE, so CREATE TABLE … AS SELECT copied a table's rows into a new one. A second statement was refused.
Only looks4 toolsLet it run. It only looks.
read_queryExecute a SELECT query on the SQLite database
Server gives no read-only or destructive hint
Our call: Refuses anything that does not start with SELECT, and runs one statement per call: SELECT 1; DELETE … was refused, and load_extension was not authorized.
list_tablesList all tables in the SQLite database
Server gives no read-only or destructive hint
Our call: Runs one fixed query on sqlite_master that the server writes itself, and takes no arguments.
describe_tableGet the schema information for a specific table
Server gives no read-only or destructive hint
Our call: Puts the table name straight into PRAGMA table_info(…), but a name carrying a second statement was refused, because only one statement runs per call.
append_insightAdd a business insight to the memo
Server gives no read-only or destructive hint
Our call: Only adds a line to a memo the server keeps in memory and shows as the memo://insights resource. Nothing reaches the database or the disk, and a restart emptied it.
Let the reads run in Claude Code
Claude Code asks before every MCP tool it has no rule for. Added as sqlite, this server’s tools are named mcp__sqlite__<tool>. These allow rules, in .claude/settings.json or ~/.claude/settings.json, let the tools that only look run without a prompt. Everything else keeps asking, including any tool a later version of the server adds.
{
"permissions": {
"allow": [
"mcp__sqlite__read_query",
"mcp__sqlite__list_tables",
"mcp__sqlite__describe_table",
"mcp__sqlite__append_insight"
]
}
}The command that adds the server:
claude mcp add sqlite -- docker run -i --rm -v ~/agent-db:/mcp:ro mcp/sqlite@sha256:efbc05ccace18df122f26b674bd1730c76ece716551df2b3961d519909c34696 --db-path /mcp/app.dbSend the rest to a person, not the terminal
A prompt in the terminal only works while someone is watching it. With this hook, every other tool of the server becomes a request in your VariantGate inbox, on your phone or in Slack, and Claude Code waits for the answer. The matcher names the look-only tools, so a tool added later is sent too. Put the key in VARIANTGATE_KEY, or run the one-command setup for Claude Code first.
{
"hooks": {
"PreToolUse": [
{
"matcher": "mcp__sqlite__(?!(read_query|list_tables|describe_table|append_insight)$).*",
"hooks": [
{ "type": "command", "command": "variantgate hook claude-code", "timeout": 180 }
]
}
]
}
}Disagree with a tier, or run the server with other flags? Open these tools in the tool risk checker, change what you like, and copy the settings for your own setup. It runs in your browser and starts from its own reading, so a tool we marked as only looking by hand asks there until you change it.
Any MCP client: put the proxy in front
Claude Desktop, Cursor and most other MCP clients have no hook to send a call to a person. The VariantGate MCP proxy does it in the server’s place: it starts the server, lets the look-only tools above through, and holds every other call until someone approves it in the inbox. Run npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz login once to save a key, then use this in claude_desktop_config.json or ~/.cursor/mcp.json:
{
"mcpServers": {
"sqlite": {
"args": [
"-y",
"https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz",
"mcp-proxy",
"--name",
"sqlite",
"--look-only",
"read_query,list_tables,describe_table,append_insight",
"--",
"docker",
"run",
"-i",
"--rm",
"-v",
"<home>/agent-db:/mcp:ro",
"mcp/sqlite@sha256:efbc05ccace18df122f26b674bd1730c76ece716551df2b3961d519909c34696",
"--db-path",
"/mcp/app.db"
],
"command": "npx"
}
}
}Already have it in Claude Desktop? One command rewrites the file for you, with these look-only tools filled in, and keeps the old one (setup vscode does the same for VS Code; how it works):
npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz setup claude-desktopThe same in Claude Code, instead of the hook. The proxy now asks about every call that matters, so an allow rule for the whole server, mcp__sqlite, keeps Claude Code from asking a second time in the terminal:
claude mcp add sqlite -- npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz mcp-proxy --name sqlite --look-only read_query,list_tables,describe_table,append_insight -- docker run -i --rm -v ~/agent-db:/mcp:ro mcp/sqlite@sha256:efbc05ccace18df122f26b674bd1730c76ece716551df2b3961d519909c34696 --db-path /mcp/app.dbWhen the agent should write
For an agent that has to change data, add the server a second time under its own name, such as sqlite-write, so the allow rules above, written for mcp__sqlite__, do not cover it. Every tool of that server should ask. When you approve write_query, read the statement for paths in VACUUM INTO or ATTACH, and after a write that answered [], check with read_query that it really happened.
See it before you decide.
The playground runs the whole approval loop in your browser, no account needed. When it fits, the free plan covers 100 requests a month.