Pg Aiguide

Developer tools

Comprehensive PostgreSQL documentation and best practices, including ecosystem tools.

Your AI app calls the Pg Aiguide MCP server, which does the developer tools work and sends the result back to the chat.

About Pg Aiguide

Pg Aiguide is a community MCP server from timescale, filed in our directory under developer tools. Comprehensive PostgreSQL documentation and best practices, including ecosystem tools.

Pg Aiguide runs on your own machine: your AI app starts it with the command npx -y @tigerdata/pg-aiguide@0.6.1 and talks to it over standard input and output. It needs OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE set before Pg Aiguide starts.

The README for Pg Aiguide lists tools such as postgres, tiger and postgis, which your AI app can call once the server is connected.

Pg Aiguide is listed in the official MCP registry as io.github.timescale/pg-aiguide, version 0.6.1.

At a glance

Publisher
timescale (community)
Runs
Locally or as a hosted remote server
Install from
Node.js package on npm: @tigerdata/pg-aiguide
Written in
TypeScript
License
Apache-2.0
GitHub stars
1,891
Official MCP registry
io.github.timescale/pg-aiguide

Tools Pg Aiguide gives your AI app

  • postgresOfficial PostgreSQL manual, scoped by version.
  • tigerTiger Data's documentation (TimescaleDB and ecosystem).
  • postgisPostGIS spatial extension documentation.

Tool names as the Pg Aiguide README lists them. Your AI app shows the live list once Pg Aiguide is connected.

How to set up Pg Aiguide

  1. Install Node.js on the machine that runs your AI app, because Pg Aiguide starts with npx and downloads its package on first run.
  2. Create OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE for Pg Aiguide in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Pg Aiguide to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Pg Aiguide tools to confirm the connection.
  5. Run one read-only task with Pg Aiguide first, such as a call to postgres, before you allow anything that writes or sends.

Pg Aiguide compared with similar servers

  • Reason Network by reason-machines has fewer GitHub stars than Pg Aiguide (1.9k against 1.9k); both are community servers, and both run remotely.
  • OpenAdaptAI Agent by OpenAdaptAI has more GitHub stars than Pg Aiguide (1.9k against 1.9k); both are community servers, and OpenAdaptAI Agent runs on your own machine and Pg Aiguide runs as a remote server.
  • SoloMD by zhitongblog has fewer GitHub stars than Pg Aiguide (1.8k against 1.9k); both are community servers, and SoloMD runs on your own machine and Pg Aiguide runs as a remote server.

Before you connect Pg Aiguide

  • Give Pg Aiguide its own sign-in or token with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Pg Aiguide tool call until you trust what it does with them.
  • Treat text that Pg Aiguide fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Pg Aiguide on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Pg Aiguide

How marketing and sales teams put Pg Aiguide to work, by company size. Pick the size closest to yours and start Pg Aiguide on one use case.

Small business

  • A small business with a developer can use Pg Aiguide to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Pg Aiguide to explain and fix a marketing site issue without context switching between tools.
  • Pg Aiguide runs as a remote server, so a small team can connect it in a few minutes with no install to maintain.

Mid-market

  • Growth engineers can use Pg Aiguide to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Pg Aiguide to keep scripts and automations documented and versioned as they change.
  • Start with postgres and tiger, the tools Pg Aiguide lists first, and add more once the team trusts the results.

Enterprise

  • Enterprise engineering teams can roll out Pg Aiguide with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Pg Aiguide so web and marketing engineering share one reviewed way of working with AI.
  • Pg Aiguide is a community server, so have security review the code and pin a version before Pg Aiguide touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Pg Aiguide README

From timescale/pg-aiguide on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

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:

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

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

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

Or pick individual skills interactively:

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
{
  "mcpServers": {
    "pg-aiguide": {
      "url": "https://mcp.tigerdata.com/docs"
    }
  }
}

Or it can be used as a Claude Code Plugin:

claude plugin marketplace add timescale/pg-aiguide
claude plugin install pg@aiguide
Install by environment
Claude Code

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

claude plugin marketplace add timescale/pg-aiguide
claude 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:

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

One-click install:

Or add the following to .cursor/mcp.json

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

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

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.

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

VS Code

Click the button to install:

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

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

Click the button to install:

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

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

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

Questions about Pg Aiguide

What is the Pg Aiguide MCP server?

Comprehensive PostgreSQL documentation and best practices, including ecosystem tools. Pg Aiguide is maintained by timescale on GitHub at timescale/pg-aiguide, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Pg Aiguide MCP server?

Add Pg Aiguide to your AI app's MCP config with the command npx -y @tigerdata/pg-aiguide@0.6.1. In Claude Code, run claude mcp add --transport stdio pg-aiguide -- npx -y @tigerdata/pg-aiguide@0.6.1. To run Pg Aiguide this way you need Node.js installed.

Does Pg Aiguide need an API key?

Yes. Pg Aiguide expects OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE to be set. Create the key for Pg Aiguide in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Pg Aiguide an official MCP server?

No. Pg Aiguide is a community server maintained by timescale. Community servers can be excellent; read the code and the open issues before you give Pg Aiguide access to company data.

What license is Pg Aiguide under?

Pg Aiguide is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Pg Aiguide; the service it connects to has its own terms.