Pg Aiguide

io.github.timescalePublished by GitHub account timescalev0.6.1Updated Oct 24, 2026

Comprehensive PostgreSQL documentation and best practices, including ecosystem tools

VerifiedStreamable HTTPWeb executableDatabasesKnowledge & MemoryDeveloper Tools

Overview

AI-generated overview

Gives coding assistants version-aware PostgreSQL, TimescaleDB and PostGIS documentation search plus curated best-practice skills for writing better SQL schemas.

What you can do
  • Search PostgreSQL, TimescaleDB and PostGIS documentation with hybrid semantic and keyword search, choosing the balance between the two.
  • Scope documentation searches by PostgreSQL version and source.
  • Retrieve curated best-practice skills covering schema design, indexing, data types, constraints, naming, performance tuning and modern features.
  • Get guidance on exploring an existing PostgreSQL schema and its objects.
When to use it
Useful when an assistant writes or reviews PostgreSQL schemas, indexes or queries and should follow current best practices rather than outdated patterns. Also helpful for TimescaleDB time-series work and PostGIS spatial design.
Requirements
Can be used as a hosted remote endpoint with no credentials, or run locally from an npm package or container image. The local setup needs PostgreSQL connection settings (PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD), an optional DB_SCHEMA, and an OPENAI_API_KEY for text embeddings. Network access is needed for the hosted endpoint.
Before you install
The local server asks for PostgreSQL credentials and an OpenAI API key, so point it at a database and account you are comfortable exposing to the tool. The hosted endpoint sends your documentation queries to Tiger Data's servers. The tools are read-only documentation and skill lookups, but the assistant may still act on the returned advice by writing schema changes itself.

Installation

In SourceWeft

  1. Open Pg Aiguide in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.timescale%2Fpg-aiguide/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

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

README

pg-aiguide

AI-optimized PostgreSQL expertise for coding assistants

pg-aiguide helps AI coding tools write dramatically better PostgreSQL code. It provides:

  • Semantic search across the official PostgreSQL manual (version-aware)
  • AI-optimized “skills” — curated, opinionated Postgres best practices used automatically by AI agents
  • Extension ecosystem docs, starting with TimescaleDB, with more coming soon

Use it as:

  • Agent Skills via npx skills — works with Claude Code, Cursor, Codex, Gemini CLI, and 40+ other agents
  • a public MCP server that can be used with any AI coding agent, or
  • a Claude Code plugin optimized for use with Claude's native skill support.

⭐ Why pg-aiguide?

AI coding tools often generate Postgres code that is:

  • outdated
  • missing constraints and indexes
  • unaware of modern PG features
  • inconsistent with real-world best practices

pg-aiguide fixes that by giving AI agents deep, versioned PostgreSQL knowledge and proven patterns.

See the difference

https://github.com/user-attachments/assets/5a426381-09b5-4635-9050-f55422253a3d

Video Transcript

Prompt given to Claude Code:

Please describe the schema you would create for an e-commerce website two times, first with the tiger mcp server disabled, then with the tiger mcp server enabled. For each time, write the schema to its own file in the current working directory. Then compare the two files and let me know which approach generated the better schema, using both qualitative and quantitative reasons. For this example, only use standard Postgres.

Result (summarized):

  • 4× more constraints
  • 55% more indexes (including partial/expression indexes)
  • PG17-recommended patterns
  • Modern features (GENERATED ALWAYS AS IDENTITY, NULLS NOT DISTINCT)
  • Cleaner naming & documentation

Conclusion: pg-aiguide produces more robust, performant, maintainable schemas.

🚀 Quickstart

Agent Skills

Install curated PostgreSQL best-practice skills for your AI coding agent:

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

Or install the schema exploration skill to investigate an existing PostgreSQL database:

bash
npx skills add timescale/pg-aiguide --skill schema-exploration

Or pick individual skills interactively:

bash
npx skills add timescale/pg-aiguide

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

For even deeper PostgreSQL knowledge, also add the MCP server to give your agent semantic search over the official PostgreSQL, TimescaleDB, and PostGIS manuals.

MCP Server

For semantic search over PostgreSQL, TimescaleDB, and PostGIS documentation, add the public MCP server:

https://mcp.tigerdata.com/docs

Manual MCP configuration using JSON
json
{  "mcpServers": {    "pg-aiguide": {      "url": "https://mcp.tigerdata.com/docs"    }  }}

Or it can be used as a Claude Code Plugin:

bash
claude plugin marketplace add timescale/pg-aiguideclaude plugin install pg@aiguide
Install by environment

[Install in Cursor] [Install in VS Code] [Install in VS Code Insiders] [Install in Visual Studio] [Install in Goose] [Add MCP Server pg-aiguide to LM Studio]

Claude Code

This repo serves as a claude code marketplace plugin. To install, run:

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

This plugin uses the skills available in the skills directory as well as our publicly available MCP server endpoint hosted by TigerData for searching PostgreSQL documentation.

Codex

Run the following to add the MCP server to codex:

bash
codex mcp add --url "https://mcp.tigerdata.com/docs" pg-aiguide
Cursor

One-click install:

[Install MCP Server]

Or add the following to .cursor/mcp.json

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

Run the following to add the MCP server to Gemini CLI:

bash
gemini mcp add -s user pg-aiguide "https://mcp.tigerdata.com/docs" -t http
OpenCode

Add the following to your global OpenCode config file (~/.config/opencode/opencode.json), or to a project level opencode.json. See the OpenCode config docs for more about file locations, and the MCP server docs for more about the mcp options.

json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "pg-aiguide": {      "type": "remote",      "url": "https://mcp.tigerdata.com/docs"    }  }}

Add use pg-aiguide to your prompts to use the pg-aiguide tools.

Visual Studio

Click the button to install:

[Install in Visual Studio]

VS Code

Click the button to install:

[Install in VS Code]

Alternatively, run the following to add the MCP server to VS Code:

bash
code --add-mcp '{"name":"pg-aiguide","type":"http","url":"https://mcp.tigerdata.com/docs"}'
VS Code Insiders

Click the button to install:

[Install in VS Code Insiders]

Alternatively, run the following to add the MCP server to VS Code Insiders:

bash
code-insiders --add-mcp '{"name":"pg-aiguide","type":"http","url":"https://mcp.tigerdata.com/docs"}'
Windsurf

Add the following to ~/.codeium/windsurf/mcp_config.json

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

💡 Your First Prompt

Once installed, pg-aiguide can answer Postgres questions or design schemas.

Simple schema example prompt

Create a Postgres table schema for storing usernames and unique email addresses.

Complex schema example prompt

You are a senior software engineer. You are given a task to generate a Postgres schema for an IoT device company. The devices collect environmental data on a factory floor. The data includes temperature, humidity, pressure, as the main data points as well as other measurements that vary from device to device. Each device has a unique id and a human-readable name. We want to record the time the data was collected as well. Analysis for recent data includes finding outliers and anomalies based on measurements, as well as analyzing the data of particular devices for ad-hoc analysis. Historical data analysis includes analyzing the history of data for one device or getting statistics for all devices over long periods of time.

Features

Documentation Search (MCP Tools)

  • search_docs Unified search tool supporting semantic (vector similarity) and keyword (BM25) search across multiple documentation sources:
    • postgres - Official PostgreSQL manual, scoped by version
    • tiger - Tiger Data's documentation (TimescaleDB and ecosystem)
    • postgis - PostGIS spatial extension documentation

Skills (AI-Optimized Best Practices)

  • view_skill
    Exposes curated, opinionated PostgreSQL best-practice skills used automatically by AI coding assistants.

    These skills provide guidance on:

    • Exploring existing PostgreSQL schemas and objects
    • Schema design
    • Indexing strategies
    • Data types
    • Data integrity and constraints
    • Naming conventions
    • Performance tuning
    • Modern PostgreSQL features

🔌 Ecosystem Documentation

Supported today:

  • TimescaleDB (docs + skills)
  • PostGIS (docs)

Coming soon:

  • pgvector

We welcome contributions for additional extensions and tools.

🛠 Development

See DEVELOPMENT.md for:

  • running the MCP server locally
  • adding new skills
  • adding new docs

🤝 Contributing

We welcome:

  • new Postgres best-practice skills
  • additional documentation corpora
  • search quality improvements
  • bug reports and feature ideas

📄 License

Apache 2.0

Source: README.md at commit b236d35

Tools

2

search_docs

Search Documentation

Search documentation with hybrid semantic (vector) and keyword (BM25) search. Use semanticWeight to choose keyword-only (0), semantic-only (1), or a blend; mid values fuse rankings with RRF. Supports Tiger Cloud (TimescaleDB), PostgreSQL, and PostGIS.

ParameterslimitrequiredqueryrequiredsourcerequiredsemanticWeightrequired

view_skill

View Skill

Retrieve detailed skills for TimescaleDB operations and best practices. ## Available Skills <available_skills> [11 ]{name description}: design-postgis-tables Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications design-postgres-tables "Use this skill for general PostgreSQL table design.\n\n**Trigger when user asks to:**\n- Design PostgreSQL tables, schemas, or data models when creating new tables and when modifying existing ones.\n- Choose data types, constraints, or indexes for PostgreSQL\n- Create user tables, order tables, reference tables, or JSONB schemas\n- Understand PostgreSQL best practices for normalization, constraints, or indexing\n- Design update-heavy, upsert-heavy, or OLTP-style tables\n\n\n**Keywords:** PostgreSQL schema, table design, data types, PRIMARY KEY, FOREIGN KEY, indexes, B-tree, GIN, JSONB, constraints, normalization, identity columns, partitioning, row-level security\n\nComprehensive reference covering data types, indexing strategies, constraints, JSONB patterns, partitioning, and PostgreSQL-specific best practices.\n" find-hypertable-candidates "Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables.\n\n**Trigger when user asks to:**\n- Analyze database tables for hypertable conversion potential\n- Identify time-series or event tables in an existing schema\n- Evaluate if a table would benefit from Timescale/TimescaleDB\n- Audit PostgreSQL tables for migration to Timescale/TimescaleDB/TigerData\n- Score or rank tables for hypertable candidacy\n\n\n**Keywords:** hypertable candidate, table analysis, migration assessment, Timescale, TimescaleDB, time-series detection, insert-heavy tables, event logs, audit tables\n\nProvides SQL queries to analyze table statistics, index patterns, and query patterns. Includes scoring criteria (8+ p

Parameterspathrequiredskill_namerequired

Version history

1
  1. v0.6.1LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts