Skip to content
appsgit

Pg Aiguide

Pg Aiguide is an MCP server that adds database tools to AI assistants such as Claude Desktop, Claude Code and Cursor. Comprehensive PostgreSQL documentation and best practices, including ecosystem tools. It has 1,857 GitHub stars, is released under the Apache-2.0 license and runs locally with npx -y @tigerdata/pg-aiguide.

github.com/timescale/pg-aiguide (opens in a new tab)

  • Needs API key
  • Databases
  • Apache-2.0
  • Actively maintained

Install Pg Aiguide

Generated from the server's MCP registry entry. Replace your-value with your own values.

Claude Desktop

claude_desktop_config.json
{
  "mcpServers": {
    "pg-aiguide": {
      "command": "npx",
      "args": [
        "-y",
        "@tigerdata/pg-aiguide"
      ],
      "env": {
        "OPENAI_API_KEY": "your-value",
        "PGHOST": "your-value",
        "PGPORT": "your-value",
        "PGUSER": "your-value",
        "PGPASSWORD": "your-value",
        "PGDATABASE": "your-value"
      }
    }
  }
}

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

Claude Code

claude mcp add --env OPENAI_API_KEY=your-value --env PGHOST=your-value --env PGPORT=your-value --env PGUSER=your-value --env PGPASSWORD=your-value --env PGDATABASE=your-value --transport stdio pg-aiguide -- npx -y @tigerdata/pg-aiguide

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "pg-aiguide": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@tigerdata/pg-aiguide"
      ],
      "env": {
        "OPENAI_API_KEY": "your-value",
        "PGHOST": "your-value",
        "PGPORT": "your-value",
        "PGUSER": "your-value",
        "PGPASSWORD": "your-value",
        "PGDATABASE": "your-value"
      }
    }
  }
}

Project file; use ~/.cursor/mcp.json to enable it in every project.

VS Code

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "openai_api_key",
      "description": "OPENAI_API_KEY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "pghost",
      "description": "PGHOST",
      "password": true
    },
    {
      "type": "promptString",
      "id": "pgport",
      "description": "PGPORT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "pguser",
      "description": "PGUSER",
      "password": true
    },
    {
      "type": "promptString",
      "id": "pgpassword",
      "description": "PGPASSWORD",
      "password": true
    },
    {
      "type": "promptString",
      "id": "pgdatabase",
      "description": "PGDATABASE",
      "password": true
    }
  ],
  "servers": {
    "pg-aiguide": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@tigerdata/pg-aiguide"
      ],
      "env": {
        "OPENAI_API_KEY": "${input:openai_api_key}",
        "PGHOST": "${input:pghost}",
        "PGPORT": "${input:pgport}",
        "PGUSER": "${input:pguser}",
        "PGPASSWORD": "${input:pgpassword}",
        "PGDATABASE": "${input:pgdatabase}"
      }
    }
  }
}

Claude Code (remote)

claude mcp add --transport http pg-aiguide "https://mcp.tigerdata.com/docs"

The same server is also hosted as a remote MCP endpoint, so nothing runs on your machine.

Config formats checked against the official docs on Oct 7, 2026: modelcontextprotocol.io (opens in a new tab), code.claude.com (opens in a new tab), cursor.com (opens in a new tab), code.visualstudio.com (opens in a new tab).

Environment variables

Variables the server reads at startup.

NameRequiredDescription
OPENAI_API_KEYsecretYesYour API key for text embeddings via OpenAI
PGHOSTsecretYesPostgreSQL host to connect to
PGPORTsecretYesPostgreSQL port to connect to
PGUSERsecretYesPostgreSQL user to connect as
PGPASSWORDsecretYesPostgreSQL password to connect with
PGDATABASEsecretYesPostgreSQL database to connect to
DB_SCHEMAsecretNoPostgreSQL database schema to use

About Pg Aiguide

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

  • ai
  • ai-agents
  • ai-coding
  • claude-marketplace
  • claude-plugin
  • claude-skills
  • docs
  • documentation
  • mcp
  • mcp-server

FAQ

Pg Aiguide FAQ

Still curious? Email info@appsgit.com.

What is Pg Aiguide?

Pg Aiguide is an MCP server that adds database tools to AI assistants such as Claude Desktop, Claude Code and Cursor. Comprehensive PostgreSQL documentation and best practices, including ecosystem tools. It has 1,857 GitHub stars, is released under the Apache-2.0 license and runs locally with npx -y @tigerdata/pg-aiguide. The source code is at github.com/timescale/pg-aiguide.

How do I install the Pg Aiguide MCP server?

Add the command npx -y @tigerdata/pg-aiguide to your MCP client: put it in claude_desktop_config.json for Claude Desktop, run claude mcp add for Claude Code, or add it to .cursor/mcp.json (Cursor) or .vscode/mcp.json (VS Code). The snippets on this page are ready to paste.

Is Pg Aiguide free?

The server is open source under the Apache-2.0 license, so running it is free. It needs credentials (OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE and DB_SCHEMA) for the service it connects to, which may require a paid account.

Is Pg Aiguide actively maintained?

The most recent commit was on Sep 25, 2026. The latest release is v0.6.1, published Sep 4, 2026. appsgit only lists MCP servers with a commit in the last six months and re-checks every server daily.