# Connect PostgresAI to Your AI Agent (Universal MCP)

> Use your AI to manage databases, monitor performance, and run deployments in PostgresAI — and much more.

## Quick Connect (CLI / MCP)
- Claude Code: `claude mcp add --transport http postgresai https://api.universalmcp.app/mcp/postgresai`
- Remote MCP URL (ChatGPT, Claude, Cursor, VS Code): `https://api.universalmcp.app/mcp/postgresai` (unified: `https://api.universalmcp.app/mcp`)
- Actions & Discovery: `POST https://universalmcp.app/mcp/directory` (`get_software_actions({ slug: "postgresai", query })` & `search_software`); configs: https://universalmcp.app/install.md

## Key Facts
- Software: PostgresAI | Category: Legal & Compliance (PostgresAI) | Auth: Encrypted API key or guided local/on-prem setup | Deployment: hybrid
- Pricing: 100% Free (unlimited users, unlimited software, zero task metering)
- Permissions & Security: Per-person, per-area Off/Read/Write across Read rehearsal evidence, Read query plans, Change plans need approval; 1-click View Only lock; stateless pass-through; zero stored business records
- Connect: https://app.universalmcp.app/connect?system=postgresai | Guide: https://universalmcp.app/mcp/postgresai
- Built by: Alex Myers (Legal entity: Lancaster Agentic LLC; support@lancasteragentic.com)

## Supported Actions (3 actions: 0 Read, 3 Write)
Perform 3 actions across read rehearsal evidence, read query plans, and change plans need approval. Save hours of work each week by utilizing AI rather than using a traditional app interface.
- **Read rehearsal evidence (1):** Read rehearsal evidence (write)
- **Read query plans (1):** Read query plans (write)
- **Change plans need approval (1):** Change plans need approval (write)

## Example Prompts for PostgresAI
- **Rehearsal results:** "Using PostgresAI, summarize the latest rehearsal of the upgrade with timing, row checks, and any failed migration steps."
- **Slow query review:** "Ask PostgresAI which queries regressed most since last sprint and show their plans with before and after timings."
- **Index evidence:** "In PostgresAI, list the index candidates tested on the full data copy with their size and measured speed change."
- **Draft change request:** "Draft a PostgresAI change request for the carrier_id index and hold it for my approval before it is scheduled."
