📹 The future of AI infrastructure: optimize and shard your database with agents.Watch the talk
Navigation

MCP server: Replica targeting and Postgres RLS detection

The PlanetScale MCP server has two improvements for read queries.

Replica targeting

The planetscale_execute_read_query tool now accepts an optional use_replica parameter. When true (the default), read queries route to a replica when your branch has replicas configured. Set use_replica to false to run the query against the primary instead. Works for both Vitess and Postgres databases.

Postgres RLS detection

For Postgres databases with row-level security enabled, the MCP server detects when RLS policies may be filtering results. When a read query returns zero rows or a zero count, and RLS is active on accessible tables, the response includes a warning explaining that rows may be hidden by policy rather than absent from the table.

The MCP server's read role uses pg_read_all_data, which does not bypass RLS. Agents that see empty results on RLS-protected tables now get context about why.

Read more about the MCP server