Secure SQL proxy for AI agents β NLβSQL, AST safety, per-agent RLS, audit log.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Secure SQL proxy between AI agents and enterprise databases.
Agents call a single endpoint in plain English (or structured SQL). QueryShield:
SELECT is allowed, no
stacked statements, no forbidden functions, LIMIT required.WHERE clause injection.Agents never see connection strings.
Generate a Fernet key for VAULT_KEY once and never lose it:
Listed in the official MCP Registry as io.github.bch1212/queryshield.
Install the client:
Then drop this into your Claude Desktop / Cursor / agent config:
Source for the standalone PyPI package lives in packages/queryshield-mcp/.
For MCP directory evaluators such as Glama, the repository root also includes a slim Dockerfile that launches the published queryshield-mcp stdio server for tool introspection. The container does not need QUERYSHIELD_API_KEY for MCP initialization/tool discovery; the key is only required when a discovered tool is actually invoked against a QueryShield API tenant.
Drop this into any MCP-aware client (Claude Desktop, Cursor, custom agents):
Tools exposed:
query_database(database_alias, question, max_rows) β natural-languagequery_database_sql(database_alias, sql, max_rows) β pre-built SELECTget_audit_log(limit) β recent attempts for the calling agent| Threat | Defense |
|---|---|
Agent crafts a DROP TABLE | sqlglot AST refuses non-SELECT |
Agent sneaks ; and a second statement | parser rejects len(statements) > 1 |
Agent uses pg_sleep, xp_cmdshell, ... | function deny-list at the AST node level |
| Agent reads tables outside its scope | RLS schema + table whitelist |
| Agent reads other tenants' rows | row_filters injected via AST .where() |
| Connection string leaks via stack traces | Fernet-encrypted, never returned in any API |
| Audit log becomes the data exfil vector | only metadata is stored β never rows |
VAULT_KEY rotation | re-encrypt rows under new key (script-driven) |
safety.py is the single most important module. Every additional check
that lands there should ship with a test in tests/test_safety.py.
| Tier | Monthly | Databases | Queries / month | Notes |
|---|---|---|---|---|
| Starter | $500 | 3 | 1,000,000 | |
| Pro | $1,500 | 10 | 10,000,000 | audit export |
| Enterprise | $3,500 | unlimited | unlimited | SSO, SIEM webhook |
Targets $32.5K MRR @ 15 customers (10 Pro + 5 Enterprise).
The repo is Railway-ready. python -m queryshield.start is the entrypoint
(reads PORT via os.getenv, since Railway exec's the start command without
a shell). Provision Postgres + (optionally) Redis from Railway's marketplace
and the rest is env vars.
/health is the liveness check. /ready returns 503 if the control-plane
DB is unreachable.
42 tests cover:
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/queryshield)<a href="https://allmcps.com/mcp/queryshield"><img src="https://allmcps.com/api/badge/queryshield?style=directory" alt="Queryshield on AllMCPs" /></a>