SCHEMAS environment variable lets you restrict visibility to only the schemas you choose.
Configuration
Set theSCHEMAS environment variable to a comma-separated list:
Behavior
When SCHEMAS is not set (default)
All non-system schemas are visible. System schemas (pg_catalog, information_schema, pg_toast) are always excluded.
The AI can discover and query any user-created schema in the database.
When SCHEMAS is set
Only the listed schemas are visible. All tools respect this filter:
| Tool | Effect |
|---|---|
discover | Only returns the allowed schemas and their tables |
describe_table | Only works for tables in allowed schemas |
query | Queries can reference any table, but schema discovery is limited |
Use cases
- Multi-tenant databases — expose only the tenant’s schema
- Staging vs. production — hide staging schemas from the AI
- Large databases — reduce noise by focusing on the schemas that matter
- Compliance — limit discovery of schemas containing sensitive data
Example
A database with schemaspublic, analytics, staging, and internal: