Discussion: Need for Granular Schema & Column-Level Allowlisting #119
ahammednibras8
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🔍 Observation
In the current implementation of postgres-mcp:
AccessMode.RESTRICTEDenablesSafeSqlDriver, which blocks unsafe queries but still allowsSELECTon any table the DB user can access.SELECT *to enforce column-level filtering.config.yaml) to define which columns are safe for exposure.This means: once the MCP has SELECT access to a table, it gets all columns, regardless of sensitivity.
Real-world tables often mix public and sensitive fields:
users:id,loyalty_tier(safe) +email,phone,address(PII)products:price(safe) +cost_price,supplier_margin(internal financials)orders:status(safe) +shipping_address(PII leak)Under the current setup:
…returns everything, because the DB user has SELECT privileges — even if only certain fields should be visible to the agent.
This violates Zero-Trust data exposure principles and makes the system unsafe for production deployments.
✅ Proposed Enhancement: Column-Level Allowlisting
Introduce a schema configuration layer such as:
Suggested Behavior
SELECT *, rewrite to include only the allowed columns.💡 Why This Matters
This feature would significantly level-up postgres-mcp for real-world enterprise use.
Beta Was this translation helpful? Give feedback.
All reactions