// CONNECTOR_GUIDE
PostgreSQL Connector Setup & RBAC
Connect your PostgreSQL database securely to AI agents using the MakeYourMCP gateway — with credential vaulting, granular RBAC, and full audit logging.
The PostgreSQL MCP connector allows agents to discover tables, read records, and execute structured SQL queries inside designated boundaries — without ever exposing connection credentials to the LLM context.
Connection Parameters
Configure the connector under the MakeYourMCP credentials screen using the following parameters:
- Host: Your database server IP or DNS name.
- Port: Default:
5432. - Database Name: The target schema database.
- Credential Vault Reference: The reference ID of your database credentials stored securely in the MakeYourMCP Vault. The raw password is never passed to the LLM.
Why PostgreSQL Needs RBAC in AI Agent Pipelines
When an LLM agent has unrestricted access to a PostgreSQL database, it can inadvertently (or through prompt injection) execute DELETE, UPDATE, or DROP commands on production tables. A customer support agent should read orders — not modify them. An analytics agent should query aggregated data — not export full PII columns. MakeYourMCP enforces schema-level and operation-level boundaries so each agent role only touches the data it is authorised to access.
Example RBAC Policy
version: "mcp/v1alpha1"
metadata:
id: "policy_postgres_support_agent"
name: "Support Agent — Read-Only Customer Access"
rules:
- id: "rule_read_orders"
role: "support_agent"
resource: "postgres_prod.public.orders"
actions:
- "read"
- "query"
constraints:
row_limit: 200
approval:
required: false
- id: "rule_block_pii_export"
role: "support_agent"
resource: "postgres_prod.public.customers"
actions:
- "read"
constraints:
masked_columns:
- "credit_card_number"
- "ssn"
- "date_of_birth"
Common Pitfalls
- Overly broad wildcard actions (
*): Avoid grantingactions: ["*"]to any agent role on a production database. Start withreadonly and expand incrementally. - Missing
row_limitconstraints: Without row limits, a misconfigured agent can accidentally export entire tables into LLM context windows, triggering token quota overruns and potential data leaks. - Reusing the same credential reference across environments: Always create separate vault credentials for dev, staging, and production. Mixing environments bypasses environment-scoped RBAC rules.
See Also
- Snowflake Connector Setup Guide — for analytical workloads alongside Postgres
- Salesforce Connector Setup Guide — CRM data access with agent RBAC
- Slack Connector Setup Guide — notification and approval gate workflows
- GitHub Connector Setup Guide — source code and PR access for code agents
- Policy YAML Schema Reference — full policy declaration specification
- Full Documentation Index
- Understanding RBAC in MCP Gateways — the theory behind these policy rules
- Credential Vaulting for AI Workflows — how server-side hydration protects credentials
- MakeYourMCP Security & Trust Center — full security architecture overview