Exposing a privately networked flexible server to AI clients through MCP does not make the data secure. The post walks through three architectures and explains why identity, authorization and row-level security must be designed separately from the network boundary.
Key points
- Private connectivity protects the database's network boundary, not the application's identity, authority or intent.
- Control, runtime and data planes each need their own controls instead of a single assumed security boundary.
- App Service VNet integration only gives outbound access; it does not make the MCP endpoint private.
- With APIM or an AI Gateway as the only ingress, the MCP backend must not expose a public endpoint that bypasses it.
- Give the MCP runtime identity narrow SQL grants and enforce row limits in the database with `NOBYPASSRLS`.
- RLS and CLS constrain rows in the database rather than trusting MCP to add the correct `WHERE` predicate.
Real-world use
- An enterprise employee chatbot whose MCP server queries a private flexible server for sales data
- A setup where several approved AI clients reach MCP tools through a single APIM or AI Gateway ingress
- A multi-tenant analytics app where tenant claims propagate into the transaction so RLS enforces row boundaries
- An MCP server exposing tools such as support-request lookup or bounded analytical queries
This summary was generated by the agent from the original post on Azure Database for PostgreSQL Blog. The full text and all rights belong to its author and publisher. Go to original