Safety-railed database access for agents: Postgres, MySQL, Redis. Read-only by default.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
The database workbench built for the AI era β one kernel, many faces (CLI / GUI / MCP / agent skill).
δΈζζζ‘£ β Β· Website β
Every database tool you know β DBeaver, TablePlus, pgAdmin β assumes a human at the keyboard. But increasingly, the entity running your queries is an AI agent, and agents need different guarantees:
Quarry inverts the traditional design: it is a query kernel with an agent-safe contract first, and the human faces (CLI, GUI) are thin shells grown from the same kernel. Whether a query comes from a person in the browser, a script in CI, or Claude running a skill, it uses shared query policies. CLI formats render rows; the GUI, MCP and Python API expose a structured QueryResult. See the interface and support contract for the exact boundaries.
One core, many faces. Connection management, query execution, schema introspection, and safety rails live in an importable kernel (quarry.core). The CLI (qy), the GUI, the MCP server, and agent skills are thin shells. Fix a bug once, every face gets it.
Read-only by default; escalation is explicit and graduated. CLI writes require --write; prod additionally needs confirmation or --yes. MCP requires server and per-call authorization, plus confirm_prod for prod. GUI queries are read-only; Python callers obtain authorization before passing allow_write=True. Read queries without an outer LIMIT default to a 500-row cap; --max-rows 0 explicitly disables it. PostgreSQL/MySQL query execution also uses database read-only transactions unless writes are authorized.
A contract machines can trust. GUI/MCP/Python queries return {columns, rows, rowCount, truncated, elapsedMs, engine, sql, downloadBytes, sizeIsEstimated}. CLI JSON remains an array of rows; diagnostics and truncation notices go to stderr. Exit codes are stable API: 0 ok, 2 connection error, 3 SQL error, 8 safety block. CLI argument syntax errors also use 2; other commands have their own codes (for example ping returns 1 on failure). GUI/MCP/Python report structured errors.
Workspace as code. A workspace is just a directory: connections.toml + queries/**/*.sql (named queries with -- @meta headers). Share query files and credential-free templates through your repo; keep actual connection credentials local.
Nearly zero dependencies. The base package and GUI use Python 3.11+ stdlib. PostgreSQL uses system psql, Redis needs redis-cli 6+, SSH uses system ssh, and MySQL uses the optional quarry-db[mysql] dependencies. No Electron or cloud service; the optional qy up keeper runs in the background.
PostgreSQL uses the system psql binary; MySQL needs pip install "quarry-db[mysql]".
A workspace directory is the source of connections + queries:
Resolution order: --workspace PATH β ~/.config/quarry/config.toml β current directory.
See COMPATIBILITY.md for lossless number/string representations, write support by entry point, stable interfaces and tested environment boundaries.
| Command | Purpose |
|---|---|
qy connections [list|add|set|remove|test] | Manage connections |
qy ping <db>|--all [--timeout N] [--format text|json] | Reachability probe (ok/fail + latency; exit 1 if any fail) |
qy exec <db> --sql "..." [--format json|ndjson|csv|table] [--timeout N] | Run ad-hoc SQL |
qy speedtest <db> [--env dev] [--bytes N] [--runs N] | Benchmark the current PostgreSQL/MySQL tunnel path |
qy schema <db> <table> | Live table structure |
qy run <name> [k=v ...] | Run a saved named query |
qy save <name> --db X --sql "..." | Save a named query |
qy list / describe / validate / fingerprint / audit | Manage named queries |
qy workspace list/add/remove | Manage aggregated workspaces |
qy up/down/status [--format text|json] | Workspace tunnel keep-alive keeper |
qy local up/down/status/sync [--engine postgres|redis|neptune|all] | Local dev services (see below) |
qy gui | Launch the local GUI |
qy mcp [--write] | Serve the MCP face over stdio (for AI agents) |
qy mcp speaks the Model Context Protocol over stdio β pure stdlib, no SDK dependency. Agents get six tools (list_connections, list_tables, describe_table, exec_sql, list_saved_queries, run_saved_query) with the exact same kernel rails: read-only unless the server was started with --write and the call passes write: true; a prod env additionally requires confirm_prod: true.
Published in the MCP Registry as mcp-name: io.github.Wangggym/quarry.
8; --write to allow--max-rows N, disable with --max-rows 0 (utility/locking queries are not rewritten; Redis caps after receipt)--write β prod needs --write plus an interactive confirmation (--yes for automation)0 success (rows optional), 1 usage, 2 connection or CLI argument syntax, 3 execution, 8 safety block; other commands have their own documented codesQuery execution and connection establishment (including SSH tunnel setup) are capped independently, so an unreachable host fails fast instead of eating the whole query budget:
The effective execute timeout is resolved in priority order:
--timeout N (CLI, on qy exec/qy run)QUARRY_TIMEOUT env vartimeout field in connections.toml (set via qy connections add/set --timeout N)On PostgreSQL, qy also sets a server-side statement_timeout (~90% of the execute timeout) before running the query; on MySQL/MariaDB it sets the equivalent session variable (MAX_EXECUTION_TIME / max_statement_time, whichever the server supports) best-effort. PostgreSQL enforces its statement timeout server-side. MySQL support is best-effort and its MAX_EXECUTION_TIME applies to SELECTs; a client timeout is not proof that a write was cancelled. A timeout error always tells you how to raise it (--timeout, QUARRY_TIMEOUT, or the connection's timeout setting). --timeout and the timeout field must be a positive number of seconds.
For databases only reachable via a bastion, add ssh_* fields and qy opens the tunnel automatically (system ssh, zero dependencies):
Neptune participates in the same tunnel path now: if a Neptune connection has
ssh_host (plus optional ssh_user/ssh_key/ssh_port), it joins tunnel
pooling/keep-alive the same way as Postgres/MySQL/Redis.
qy up/down/status)If you query the same SSH-backed connections repeatedly (CLI + GUI + MCP), run the workspace keeper once and reuse warm forwards across processes:
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/quarry)<a href="https://allmcps.com/mcp/quarry"><img src="https://allmcps.com/api/badge/quarry?style=directory" alt="Quarry on AllMCPs" /></a>