Repository navigation
Done
Labels
area:cliCommand-line toolarea:integrationsRecipes for LLM frameworks and MCParea:securityGuarantees of the threat modellang:pythonPython package and the enginep0Prioridad 0: urgentesize:l3-5 daystype:featureNew capability
Description
Parent epic: #214
Priority: P0
Problem
Direct competitors (safedb-mcp, sql-shield, mcp-read-only-sql) ask users to replace their database MCP server. The audience is in the servers people already run: MCP Toolbox for Databases (~17k stars), dbhub (~4k) and Postgres MCP Pro (~3.5k). sqlguardllm proxy (#172) can already guard dbhub, Postgres MCP Pro and a SQL Server server, but setting it up takes a policy, a map and a hand-edited client config. Most people stop before that.
Proposal
sqlguardllm protect # dry run: shows what it found and the diff it would apply
sqlguardllm protect --apply # writes policy.yaml, map.yaml and the new client config (with a backup)
sqlguardllm protect --undo # restores the backup- Find MCP client configs: Claude Desktop, Cursor (
~/.cursor/mcp.json,.cursor/mcp.json) and VS Code (.vscode/mcp.jsonand user settings). - Recognize known database servers by command and package: dbhub, Postgres MCP Pro and MCP Toolbox for Databases. Read the DSN from args or env.
- Draft a policy with
Policy.from_database(): every table it finds and a row limit. Columns whose names look personal or secret (email,phone,ssn,password,token,secret,iban,card,birth…) are proposed as hidden or masked, with the reason shown. Runlint --stricton the draft. - Wrap the server: rewrite the client entry so it launches
sqlguardllm proxy … -- <original command>. Keep a timestamped backup. - Add
examples/proxy/mcp-toolbox.yamlfor MCP Toolbox's prebuiltexecute_sqltool, and verify the tool name against the current release.
Security impact
- Dry run by default. Nothing is written without
--apply, and--undoalways works from the backup. - Never print or log credentials: mask passwords in DSNs in every output, including the diff.
- The draft policy is a starting point. The output says so and lists every table it exposes.
- Unknown servers are reported and left untouched. Unmapped tools stay hidden and refused (proxy default).
Acceptance criteria
-
protect,protect --applyandprotect --undowork for Claude Desktop, Cursor and VS Code configs, with fixture tests for each. - dbhub, Postgres MCP Pro and MCP Toolbox are recognized, with an end-to-end test on PostgreSQL for at least dbhub.
- PII name heuristics tested on a fixture schema, EN and ES column names included.
- No credential appears in stdout, stderr or files other than the client config itself (test).
- Docs: "Protect the database MCP server you already use in one command" (EN / ES), with a 30-second demo.
Files
src/sqlguardllm/protect.py(new) ·cli.py·introspect.py·examples/proxy/mcp-toolbox.yaml(new) ·docs/PROXY.md
Size
L
Metadata
Metadata
Assignees
Labels
area:cliCommand-line toolarea:integrationsRecipes for LLM frameworks and MCParea:securityGuarantees of the threat modellang:pythonPython package and the enginep0Prioridad 0: urgentesize:l3-5 daystype:featureNew capability
Activity
Add sqlguardllm protect (#216) (#232)