Pg Aiguide

io.github.timescale由 GitHub 帳號 timescale 發布v0.6.1更新於 Oct 24, 2026

Comprehensive PostgreSQL documentation and best practices, including ecosystem tools

已驗證Streamable HTTP可網頁執行資料庫知識與記憶開發者工具

概覽

AI 產生的概覽

為程式開發助理提供依版本區分的 PostgreSQL、TimescaleDB 與 PostGIS 文件檢索及精選最佳實務技能,協助寫出更好的 SQL 結構。

可以做什麼
  • 以語意向量與關鍵字混合檢索方式搜尋 PostgreSQL、TimescaleDB 與 PostGIS 文件,並可調整兩者權重。
  • 依 PostgreSQL 版本與文件來源限縮檢索範圍。
  • 取得精選最佳實務技能,涵蓋資料表結構設計、索引策略、資料型別、限制條件、命名慣例、效能調校與現代功能。
  • 取得探查既有 PostgreSQL 結構與物件的指引。
適用情境
適合在助理撰寫或審查 PostgreSQL 資料表結構、索引與查詢時使用,使其遵循目前最佳實務而非過時寫法。也適用於 TimescaleDB 時序資料與 PostGIS 空間設計。
執行需求
可使用免憑證的託管遠端端點,也可透過 npm 套件或容器映像在本機執行。本機方式需要 PostgreSQL 連線設定(PGHOST、PGPORT、PGDATABASE、PGUSER、PGPASSWORD)、選用的 DB_SCHEMA,以及用於文字嵌入的 OPENAI_API_KEY。使用託管端點需要網路存取。
安裝前請注意
本機執行需要 PostgreSQL 憑證與 OpenAI API 金鑰,請只連線你願意提供給此工具的資料庫與帳號。託管端點會把你的文件查詢送到 Tiger Data 的伺服器。工具本身僅做文件與技能查詢,但助理可能據此自行撰寫並執行結構變更。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pg Aiguide,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.timescale%2Fpg-aiguide/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "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

來源:README.md,提交 b236d35

工具

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.

輸入參數limit必填query必填source必填semanticWeight必填

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

輸入參數path必填skill_name必填

版本歷史

1
  1. v0.6.1最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分