Queryshield MCP server
Secure SQL proxy for AI agents — NL→SQL, AST safety, per-agent RLS, audit log.
1 stars18 downloads/wk
Reviews
Write oneNobody has reviewed Queryshield yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Queryshield tools (3, 2 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
get_audit_logRecent audit entries for the calling agent.
query_databasewrite actionRun a natural-language question against a registered database.
query_database_sqlwrite actionRun a structured SELECT statement against a registered database.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan4 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 13 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Queryshield compares
Against every graded Databases MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 83/100
- higher than 60% of 802 Databases servers
- Tools
- 3
- the typical Databases server has 8
- Tools that change things
- 67%
- typical: 9%. Fewer write tools means less an agent can break
- GitHub stars
- 1
- more than 45% of 602 Databases servers
- Downloads a week
- 18
- more than 5% of 330 Databases servers with a package
What its tools let an agent do: 1 read · 2 change
Install Queryshield in Claude Code, Cursor or VS Code
claude mcp add queryshield -- uvx queryshield-mcp
What the publisher says
From the Queryshield repository's README, as published. We do not edit it. Read it on GitHub
QueryShield
Secure SQL proxy between AI agents and enterprise databases.
Agents call a single endpoint in plain English (or structured SQL). QueryShield:
stacked statements, no forbidden functions, LIMIT required.
- Translates natural language → SQL via Claude with prompt caching.
- Validates every query at the AST level — only SELECT is allowed, no
WHERE clause injection.
- Applies per-agent row-level security: schema/table whitelists and
never row contents.
- Executes against the customer DB and returns rows.
- Logs every attempt to an append-only audit table — metadata only,
Agents never see connection strings.
Quickstart
pip install -r requirements.txt
cp .env.example .env
# Set ANTHROPIC_API_KEY, DATABASE_URL, VAULT_KEY (see below)
python -m queryshield.startGenerate a Fernet key for VAULT_KEY once and never lose it:
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"End-to-end flow (curl)
# 1) Boot a tenant. Returns the admin API key — copy it.
curl -X POST localhost:8000/v1/tenants?name=Acme
# 2) Register the customer DB. Connection string is encrypted at rest.
curl -X POST localhost:8000/v1/databases \
-H 'X-Admin-Key: qs_...' \
-H 'Content-Type: application/json' \
-d '{
"alias": "prod",
"db_type": "postgresql",
"connection_string": "postgresql://reader:secret@db.acme.internal:5432/app",
"allowed_tables": ["users", "orders"]
}'
# 3) Provision a scoped agent (different from admin) for your AI app.
curl -X POST localhost:8000/v1/agents \
-H 'X-Admin-Key: qs_...' \
-H 'Content-Type: application/json' \
-d '{ "name": "reporting", "tenant_id": "<tenant>" }'
# 4) Set the agent's RLS policy.
curl -X POST localhost:8000/v1/policies \
-H 'X-Admin-Key: qs_...' \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "<agent>",
"database_alias": "prod",
"allowed_tables": ["users", "orders"],
"row_filters": { "users": "tenant_id = 42" }
}'
# 5) The agent queries.
curl -X POST localhost:8000/v1/query \
-H 'X-API-Key: qs_...' \
-H 'Content-Type: application/json' \
-d '{
"database_alias": "prod",
"query":MCP integration
Listed in the official MCP Registry as io.github.bch1212/queryshield.
Install the client:
pip install queryshield-mcpThen drop this into your Claude Desktop / Cursor / agent config:
{
"queryshield": {
"command": "queryshield-mcp",
"env": { "QUERYSHIELD_API_KEY": "qs_..." }
}
}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 QUERYSHIELDAPIKEY for MCP initialization/tool discovery; the key is only required when a discovered tool is actually invoked against a QueryShield API tenant.
MCP integration (legacy)
Drop this into any MCP-aware client (Claude Desktop, Cursor, custom agents):
{
"queryshield": {
"command": "python",
"args": ["-m", "queryshield.mcp_server"],
"env": {
"QUERYSHIELD_API_KEY": "qs_...",
"QUERYSHIELD_BASE_URL": "https://api.queryshield.io"
}
}
}Tools exposed:
- querydatabase(databasealias, question, max_rows) — natural-language
- querydatabasesql(databasealias, sql, maxrows) — pre-built SELECT
- getauditlog(limit) — recent attempts for the calling agent
Security model
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Queryshield: common questions
- Is Queryshield MCP server safe?
- Mostly: it is graded B (83/100). Read the Queryshield safety report
- How do I install Queryshield?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Queryshield need an API key?
- Yes. The registry entry asks for
QUERYSHIELD_API_KEY. - Is Queryshield maintained?
- The last commit was 52 days ago (2026-09-14). The latest release is v1.0.1.
- What can I use instead of Queryshield?
- Servers from other publishers that do the same job: Januscope MCP server, CogniCore MCP server and DBHub MCP server.
- How does Queryshield compare with other Databases MCP servers?
- safety score 83/100 (higher than 60% of 802 Databases servers); tools 3 (the typical Databases server has 8); tools that change things 67% (typical: 9%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Queryshield
Same job from other publishers: the closest match first, then the best rated.
- JanuscopeLocal MCP proxy for tool restrictions, response redaction, audit logs, and database schema context.not reviewedGrowingA
- CogniCoreMemory, reflection and safety for AI agents. Hosted or local, no vector database.5.0(1)GrowingA
- DBHubToken-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLitenot reviewedWidely usedA
- MotherduckSQL analytics and data engineering for AI Assistants and IDEsnot reviewedEstablishedA
- KeboolaConnect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...not reviewedEstablishedA