Skip to main content
MCP server CX Codex

pg-aiguide — Claude Code MCP server: PostgreSQL docs for agents

Gives your coding agent semantic search over the PostgreSQL, TimescaleDB and PostGIS manuals plus curated Postgres best-practice skills.

Install into Claude Code · Platform CLI: remote server All methods and platforms ↓
claude mcp add --transport http pg-aiguide https://mcp.tigerdata.com/docs
Open on GitHub

What pg-aiguide does

pg-aiguide is a public MCP server from Timescale. It hands the agent version-aware semantic search across the official PostgreSQL manual, TimescaleDB and PostGIS docs, along with a set of skills holding opinionated Postgres patterns. It plugs into Claude, Codex, Cursor, GitHub Copilot, Windsurf, Cline and Zed.

Two ways to run it. The remote HTTP endpoint at https://mcp.tigerdata.com/docs needs no keys and nothing installed locally. The stdio route runs npx -y @tigerdata/pg-aiguide on your machine and expects OPENAI_API_KEY plus PGHOST, PGPORT, PGUSER and PGPASSWORD. Without those variables the local server won't come up, so start with the remote one if you just want to see what it does.

The repo also works as a Claude plugin, wiring in the same skills and the hosted endpoint. You can skip the server entirely and install skills alone with npx skills add timescale/pg-aiguide --skill postgres, or --skill schema-exploration to inspect an existing database.

What it helps with

  • write schemas without outdated PostgreSQL constructs
  • find the right manual section for a specific PG version
  • add constraints and indexes the agent usually skips
  • map out an existing database's structure
  • check TimescaleDB or PostGIS docs while coding

Example prompts for the agent

  • Describe the schema you'd create for an e-commerce site in standard Postgres and write it to schema.sql
  • Look up in the PostgreSQL 17 manual how to declare GENERATED ALWAYS AS IDENTITY
  • Explore the existing database and tell me which indexes are missing

How to install pg-aiguide

1Platform CLI: remote server

claude mcp add --transport http pg-aiguide https://mcp.tigerdata.com/docs

2Platform CLI

claude mcp add --env OPENAI_API_KEY=<OPENAI_API_KEY> --env PGHOST=<PGHOST> --env PGPORT=<PGPORT> --env PGUSER=<PGUSER> --env PGPASSWORD=<PGPASSWORD> --transport stdio pg-aiguide -- npx -y @tigerdata/pg-aiguide

Replace <…> with your own values. 2 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about pg-aiguide

How do I install pg-aiguide in Claude Code?

Add the remote server with claude mcp add --transport http pg-aiguide https://mcp.tigerdata.com/docs. For the local stdio mode use the second command with --env for OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD and the npx -y @tigerdata/pg-aiguide launch.

What does pg-aiguide do?

It gives your agent semantic search over the PostgreSQL, TimescaleDB and PostGIS manuals and a set of Postgres best-practice skills. The agent leans on them when writing schemas or queries.

How is the remote server different from running it locally?

The remote one lives at https://mcp.tigerdata.com/docs and needs no keys. The local one runs npx -y @tigerdata/pg-aiguide and reads OPENAI_API_KEY and your database connection settings from environment variables.

Similar MCP servers

All MCP servers for Data and databases →

From the same set9

postgres A skill for PostgreSQL work: table design, indexing, pgvector, PostGIS, TimescaleDB and migrations. Useful when your agent writes SQL blind. CX Codex +1 1,400installs pgvector-semantic-search Configures AI agents to set up vector similarity search in PostgreSQL using pgvector. Helps store embeddings with halfvec, build HNSW indexes, and power RAG apps. CX Codex +1 938installs design-postgres-tables A reference skill for PostgreSQL table design: data types, indexes, constraints, JSONB and partitioning. Useful when your agent writes or edits a schema. CX Codex +1 613installs setup-timescaledb-hypertables Guides agents in designing TimescaleDB and Tiger Cloud hypertables for insert-heavy workloads. Helps configure chunk partitioning, columnstore compression, and sparse indexes. CX Codex +1 507installs find-hypertable-candidates Reads a PostgreSQL schema and ranks which tables are worth converting to TimescaleDB hypertables. Useful before a migration. CX Codex +1 391installs postgres-hybrid-text-search Teaches AI agents how to combine BM25 keyword matching with pgvector semantic retrieval using Reciprocal Rank Fusion in PostgreSQL. CX Codex +1 372installs migrate-postgres-tables-to-hypertables Plans the move of PostgreSQL tables to TimescaleDB hypertables: partition column, chunk interval, keys and compression. CX Codex +1 355installs design-postgis-tables A reference for designing PostGIS spatial tables: geometry types, coordinate systems, spatial indexes and query patterns. Useful when you are laying out a schema for location data. CX Codex +1 344installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor