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.
- 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
{
"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-aiguideCursor
{
"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
{
"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.
| Name | Required | Description |
|---|---|---|
OPENAI_API_KEYsecret | Yes | Your API key for text embeddings via OpenAI |
PGHOSTsecret | Yes | PostgreSQL host to connect to |
PGPORTsecret | Yes | PostgreSQL port to connect to |
PGUSERsecret | Yes | PostgreSQL user to connect as |
PGPASSWORDsecret | Yes | PostgreSQL password to connect with |
PGDATABASEsecret | Yes | PostgreSQL database to connect to |
DB_SCHEMAsecret | No | PostgreSQL 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
Similar MCP servers
More databases MCP servers
Dbx
t8y2/dbx
Query databases from AI agents using connections configured in DBX.
DatabasesRustButterbase AI MCP Server
butterbase-ai/butterbase
Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys.
DatabasesTypeScriptDBHub
bytebase/dbhub
Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite.
DatabasesTypeScriptLINQ to DB
linq2db/linq2db
Inspect database schemas and execute SQL queries across multiple database providers with LINQ to DB.
DatabasesC#Mindwtr
dongdongbh/Mindwtr
Task automation via SQLite, desktop Local API, or Mindwtr Cloud; read-only by default.
DatabasesTypeScriptMCP Memory Service
doobidoo/mcp-memory-service
Open-source persistent memory for AI agent pipelines (LangGraph, CrewAI, AutoGen) and Claude.
DatabasesPython
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.