pg-aiguide
Lets your AI agent search the PostgreSQL manual and follow Postgres best practices when it writes schemas and queries.
1.9k stars on GitHubby Timescale (Tiger Data)License Apache-2.0Updated 20 days ago
How to install
This MCP has two ways to run: local or remote.
Pick one below. Local runs on your computer; remote runs in the cloud and needs nothing installed.
Paste in the terminal:
claude mcp add pg-aiguide -e OPENAI_API_KEY="<your value>" -e PGHOST="<your value>" -e PGPORT="<your value>" -e PGUSER="<your value>" -e PGPASSWORD="<your value>" -e PGDATABASE="<your value>" -- npx -y @tigerdata/pg-aiguide
What to fill in
| Name | What it is | Required |
|---|---|---|
OPENAI_API_KEY | Your API key for text embeddings via OpenAI | Yes |
PGHOST | PostgreSQL host to connect to | Yes |
PGPORT | PostgreSQL port to connect to | Yes |
PGUSER | PostgreSQL user to connect as | Yes |
PGPASSWORD | PostgreSQL password to connect with | Yes |
PGDATABASE | PostgreSQL database to connect to | Yes |
DB_SCHEMA | PostgreSQL database schema to use | No |
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Create a Postgres table schema for storing usernames and unique email addresses.
Design a Postgres schema for an IoT company that records temperature, humidity and pressure from factory devices.
What it is
pg-aiguide gives your AI coding agent access to the official PostgreSQL manual, TimescaleDB docs and PostGIS docs. It also offers curated best-practice skills for things like schema design, indexing and constraints. The goal is to make the Postgres code your agent writes more complete and up to date.
What it can do
search_docs: semantic and keyword search across the PostgreSQL manual (by version), Tiger Data docs and PostGIS docsview_skill: read curated Postgres best-practice skills- Skills on schema design, indexing, data types, constraints, naming and performance tuning
- A skill for exploring an existing PostgreSQL schema
When to use
- βΊWhen you ask your agent to design a database schema and want it to use modern Postgres features.
- βΊWhen you need an answer taken from the official PostgreSQL or TimescaleDB documentation.
- βΊWhen you want to review an existing Postgres schema for missing indexes or constraints.
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
postgres-expertHelps your agent speed up PostgreSQL queries, choose indexes, design schemas and run safe database maintenance.postgres-best-practicesHelps your agent optimize the PostgreSQL database. It improves performance and ensures queries are efficient.postgresqlHelps your agent design schemas for PostgreSQL. It covers best practices, data types, and optimization for better performance.Frequently asked questions
Is it free?
The project is open source under the Apache 2.0 license. The readme does not mention any fees for the public MCP server.
Do I need an API key?
The readme does not mention one. You add the public server URL to your MCP client.
Which agents does it work with?
It works with any MCP client. The readme gives setup steps for Claude Code, Codex, Cursor, Gemini CLI, OpenCode, VS Code, Visual Studio and Windsurf.
Can I use it without MCP?
Yes. The same best-practice skills can be installed with npx skills add timescale/pg-aiguide, or as a Claude Code plugin.
Which documentation does it cover?
The PostgreSQL manual (version-aware), TimescaleDB docs and PostGIS docs. pgvector is listed as coming soon.
Does it connect to my database?
No. It searches documentation and serves best-practice skills. The readme does not describe any connection to your own database.
If it does not work
- βΊIf the tools do not appear, restart your AI app fully after adding the server URL.
- βΊCheck that the URL is exactly https://mcp.tigerdata.com/docs.
- βΊFor the skill install, make sure Node.js is installed so npx works.
5 new skills a week. 1 minute to read.