Back to MCP Servers

pg-aiguide MCP Server

MCP server and Claude plugin from Timescale that gives AI coding tools access to PostgreSQL docs and curated best-practice skills for schema, indexes, and constraints.

Developer Tools by Timescale (Tiger Data) None active
Overview

pg-aiguide is an MCP server and Claude Code plugin from Timescale (Tiger Data) that helps AI coding tools generate better PostgreSQL code. It exposes semantic and keyword search over the official PostgreSQL manual (version-aware for PG14 through PG18), plus TimescaleDB and PostGIS docs, alongside a library of curated "skills" that encode opinionated PostgreSQL best practices for schema design, indexing, data types, constraints, naming, performance, and modern features.

The server is hosted publicly by Timescale at https://mcp.tigerdata.com/docs, so most users do not need to self-host. It also ships as a Claude Code plugin and as Agent Skills installable via npx skills, making it usable from Claude Code, Cursor, Codex, Gemini CLI, VS Code, Goose, LM Studio, and other agents. According to Timescale's benchmarks, projects using pg-aiguide generate roughly 4x more constraints and 55% more indexes than baseline AI output.

The codebase is Apache 2.0 licensed and open source on GitHub. The exposed surface area is small and focused: a unified docs search tool and a skills retrieval tool, both read-only.

Tools

Tool Description
search_docs Unified semantic, keyword (BM25), or hybrid search across PostgreSQL, TimescaleDB, and PostGIS documentation. Returns ranked results with content, metadata, and relevance scores.
view_skill Retrieves curated PostgreSQL and TimescaleDB best-practice skills covering schema design, indexing, constraints, naming, performance, and modern features. Disabled when used as the Claude Code plugin (skills are loaded natively in that mode).
Setup Guide

Option 1: Use the hosted MCP server

The simplest path. Point any MCP-compatible client at Timescale's hosted endpoint.

{
  "mcpServers": {
    "pg-aiguide": {
      "url": "https://mcp.tigerdata.com/docs"
    }
  }
}

No API key or authentication is required.

Option 2: Install as an Agent Skill

Works with Claude Code, Cursor, Codex, Gemini CLI, and 40+ other agents:

npx skills add timescale/pg-aiguide --skill postgres

Option 3: Claude Code plugin

claude plugin marketplace add timescale/pg-aiguide
claude plugin install pg@aiguide

When deployed as a Claude Code plugin, the view_skill MCP tool is disabled because Claude Code loads the skills natively.

Prerequisites

  • An MCP-compatible client (Claude Desktop, Claude Code, Cursor, VS Code, Codex, Gemini CLI, Goose, LM Studio, etc.)
  • Node.js is required only for the npx skills installation path
Use Cases
  • Ask an AI coding agent to design a PostgreSQL schema and have it pull current best practices for constraints, naming, and data types from the curated skills before writing DDL
  • Look up version-specific PostgreSQL syntax (PG14 through PG18) to avoid the outdated SQL that LLMs often emit from training data
  • Search TimescaleDB documentation when building time-series tables, continuous aggregates, or hypertables
  • Search PostGIS docs (versions 3.3 through 3.6) while writing spatial queries or geometry-heavy migrations
  • Have the agent retrieve the indexing skill before reviewing a slow query plan, so suggestions align with modern PostgreSQL index types and partial/expression index patterns
Example Prompts
  • "Search the Postgres 17 docs for how MERGE handles RETURNING clauses and write an example."
  • "Pull the pg-aiguide schema design skill, then refactor this users table to add proper constraints and a sensible primary key strategy."
  • "Look up the TimescaleDB docs for continuous aggregates with real-time aggregation and show me a minimal example."
  • "Use the indexing skill to review my schema and suggest missing indexes, including partial and expression indexes."
  • "Search PostGIS 3.5 docs for the right way to build a spatial index on a geography(Point, 4326) column."
Pros
  • Officially maintained by Timescale, the company behind TimescaleDB, with a publicly hosted endpoint so no self-hosting is required
  • Version-aware PostgreSQL docs (PG14 through PG18) plus TimescaleDB and PostGIS coverage in a single tool
  • Curated, opinionated "skills" encode real PostgreSQL best practices, not just raw doc snippets
  • Multiple deployment modes: hosted MCP, Agent Skills via npx, or native Claude Code plugin
Limitations
  • Read-only: it provides docs and guidance, not live database access or query execution
  • Only two tools (search_docs and view_skill), so it must be paired with a separate Postgres MCP server for actual database operations
  • Extension coverage beyond PostgreSQL is limited to TimescaleDB and PostGIS today
Alternatives