pg-aiguide logo

pg-aiguide

OrganizationPopular
timescale

MCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.

Publishertimescale
Repositorypg-aiguide
LanguagePython
Forks
89
Stars
1.7K
Available tools
3
Transport typestreamable-http
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    pg-aiguide exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 3 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    1.7K stars and 89 forks from the linked repository.

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

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

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-aiguide
claude 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

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

bash
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.

Run the following to add the MCP server to codex:

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

One-click install:

Install MCP Server

Or add the following to .cursor/mcp.json

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

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

Click the button to install:

Install in Visual Studio

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"}'

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"}'

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:

    • 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

Installation

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

Available Tools

  • semantic_search_postgres_docs

    This retrieves relevant PostgreSQL documentation entries based on a natural language query.

  • semantic_search_tiger_docs

    This retrieves relevant documentation entries based on a natural language query. The content covers Tiger Cloud and TimescaleDB topics.

  • view_skill

    Retrieve detailed skills for TimescaleDB operations and best practices.

    Available Skills:

    design-postgres-tables - Comprehensive PostgreSQL-specific table design reference covering data types, indexing, constraints, performance patterns, and advanced features

    find-hypertable-candidates - Analyze an existing PostgreSQL database to identify tables that would benefit from conversion to TimescaleDB hypertables

    migrate-postgres-tables-to-hypertables - Comprehensive guide for migrating PostgreSQL tables to TimescaleDB hypertables with optimal configuration and performance validation

    setup-timescaledb-hypertables - Step-by-step instructions for designing table schemas and setting up TimescaleDB with hypertables, indexes, compression, retention policies, and continuous aggregates. Instructions for selecting: partition columns, segment_by columns, order_by columns, chunk time interval, real-time aggregation.

Use pg-aiguide MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once pg-aiguide is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP connects through a hosted MCP server URL in TypingMind.

Add an MCP server URL

Use this when pg-aiguide is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter https://mcp.tigerdata.com/docs in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste https://mcp.tigerdata.com/docs into the Server URL field.
  2. Enter a connection name for pg-aiguide.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the pg-aiguide connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the pg-aiguide tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the pg-aiguide tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use pg-aiguide to help me with this task?
pg-aiguide
Sure. I read it.
Here is what I found using pg-aiguide.

Frequently asked questions

What is the pg-aiguide MCP server used for?

pg-aiguide is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use pg-aiguide MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use pg-aiguide with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use pg-aiguide MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With pg-aiguide connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect pg-aiguide MCP to TypingMind?

pg-aiguide can be connected in TypingMind by adding its hosted MCP server URL. This is useful when you want a remote MCP connection that is available from your TypingMind workspace.

What tools does pg-aiguide MCP provide in TypingMind?

pg-aiguide exposes 3 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use pg-aiguide MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If pg-aiguide requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇