pg-aiguide is an MCP server and Claude plugin that helps AI coding tools generate better PostgreSQL code.
The tool addresses a common problem: AI coding assistants often produce PostgreSQL code that is outdated, missing constraints and indexes, unaware of modern features, or inconsistent with real-world best practices. pg-aiguide solves this by providing AI agents with deep, version-aware PostgreSQL knowledge through three mechanisms: semantic search across the official PostgreSQL manual, curated AI-optimized skills that encode best practices for automatic use by agents, and documentation for the PostgreSQL extension ecosystem starting with TimescaleDB.
The tool can be deployed in multiple ways depending on your setup. It works as agent skills installable via command line for use with Claude Code, Cursor, Codex, Gemini CLI, and over forty other agents. It also functions as a public MCP server for any AI coding agent, or as a Claude Code plugin optimized for Claude's native skill support. Teams should choose this if they want their AI coding assistants to produce PostgreSQL schemas with more constraints, better indexes including partial and expression indexes, modern PostgreSQL features, and cleaner naming conventions. The README demonstrates that with the tool enabled, generated schemas show significantly more robust patterns compared to unaided AI output.
The project maintains a public MCP server endpoint for semantic search over PostgreSQL, TimescaleDB, and PostGIS documentation. The tool is distributed as both installable skills and as a Claude Code marketplace plugin, indicating active support for multiple integration pathways.