pg-aiguide
MCP server by timescale Community
pg-aiguide gives AI coding assistants versioned PostgreSQL manual search and curated Postgres best-practice skills. It is for developers who want agents to write better schemas and queries. It is available as an MCP server, Agent Skills, or a Claude Code plugin.
Install pg-aiguide
Built from the published package, never by AI.
claude mcp add pg-aiguide -e OPENAI_API_KEY=YOUR_OPENAI_API_KEY -e PGHOST=YOUR_PGHOST -e PGPORT=YOUR_PGPORT -e PGUSER=YOUR_PGUSER -e PGPASSWORD=YOUR_PGPASSWORD -e PGDATABASE=YOUR_PGDATABASE -- npx -y @tigerdata/pg-aiguideRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"pg-aiguide": {
"env": {
"PGHOST": "YOUR_PGHOST",
"PGPORT": "YOUR_PGPORT",
"PGUSER": "YOUR_PGUSER",
"PGDATABASE": "YOUR_PGDATABASE",
"PGPASSWORD": "YOUR_PGPASSWORD",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
},
"args": [
"-y",
"@tigerdata/pg-aiguide"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"pg-aiguide": {
"env": {
"PGHOST": "YOUR_PGHOST",
"PGPORT": "YOUR_PGPORT",
"PGUSER": "YOUR_PGUSER",
"PGDATABASE": "YOUR_PGDATABASE",
"PGPASSWORD": "YOUR_PGPASSWORD",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
},
"args": [
"-y",
"@tigerdata/pg-aiguide"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"pg-aiguide": {
"env": {
"PGHOST": "YOUR_PGHOST",
"PGPORT": "YOUR_PGPORT",
"PGUSER": "YOUR_PGUSER",
"PGDATABASE": "YOUR_PGDATABASE",
"PGPASSWORD": "YOUR_PGPASSWORD",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
},
"args": [
"-y",
"@tigerdata/pg-aiguide"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add pg-aiguide --env OPENAI_API_KEY=YOUR_OPENAI_API_KEY --env PGHOST=YOUR_PGHOST --env PGPORT=YOUR_PGPORT --env PGUSER=YOUR_PGUSER --env PGPASSWORD=YOUR_PGPASSWORD --env PGDATABASE=YOUR_PGDATABASE -- npx -y @tigerdata/pg-aiguide{
"mcpServers": {
"pg-aiguide": {
"env": {
"PGHOST": "YOUR_PGHOST",
"PGPORT": "YOUR_PGPORT",
"PGUSER": "YOUR_PGUSER",
"PGDATABASE": "YOUR_PGDATABASE",
"PGPASSWORD": "YOUR_PGPASSWORD",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
},
"args": [
"-y",
"@tigerdata/pg-aiguide"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add pg-aiguide npx -y @tigerdata/pg-aiguideGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the pg-aiguide block.
About
pg-aiguide is a PostgreSQL knowledge source for AI coding assistants. It offers semantic search across the official PostgreSQL manual, which is version-aware, along with documentation for TimescaleDB and PostGIS. It also provides curated, opinionated Postgres best-practice skills that agents use automatically, covering schema design, indexing, data types, constraints, naming and performance tuning.
It can be used in three ways: as Agent Skills installed with npx skills, as a public MCP server hosted at mcp.tigerdata.com, or as a Claude Code plugin. The project says it helps AI tools avoid outdated or under-constrained Postgres code. It is aimed at developers and teams who use AI coding agents to write PostgreSQL schemas and queries. Timescale publishes it under the Apache 2.0 license.
Written from the project's README and checked against it.
Tools it gives your assistant
search_docsSearches PostgreSQL, TimescaleDB and PostGIS docs using semantic or keyword search.view_skillExposes curated PostgreSQL best-practice skills that assistants use automatically.
What you need
- An AI coding agent such as Claude Code, Cursor, Codex, Gemini CLI or VS Code
- npx, for installing Agent Skills
| Setting | Needed | What it is |
|---|---|---|
OPENAI_Environment variable, secret | Required | Your API key for text embeddings via OpenAI |
PGHOSTEnvironment variable, secret | Required | PostgreSQL host to connect to |
PGPORTEnvironment variable, secret | Required | PostgreSQL port to connect to |
PGUSEREnvironment variable, secret | Required | PostgreSQL user to connect as |
PGPASSWORDEnvironment variable, secret | Required | PostgreSQL password to connect with |
PGDATABASEEnvironment variable, secret | Required | PostgreSQL database to connect to |
DB_Environment variable, secret | Optional | PostgreSQL database schema to use |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Create a Postgres table schema for storing usernames and unique email addresses.
- Use pg-aiguide to search the PostgreSQL manual for partial index syntax.
- Use pg-aiguide to review my schema for missing constraints and indexes.
Good to know
- Ecosystem docs cover TimescaleDB and PostGIS today; pgvector is listed as coming soon.
- PostGIS is listed with docs only, not skills.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to pg-aiguide
All alternatives →Connects Supabase projects to AI assistants such as Cursor, Claude and Windsurf over the Model Context Protocol. It lets assistants manage tables, fetch config and query data in a Supabase project.
ArcadeDB MCP Server is the built-in Model Context Protocol server of the ArcadeDB multi-model database. It lets AI assistants and LLMs work with ArcadeDB's graph, document, time-series, vector and other data models. It suits people who already run ArcadeDB and want assistant access to it.
Connects MCP clients such as Claude Desktop, Cursor and VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It exposes two tools by default, with read-only mode and query timeouts available as guardrails.
MCP Toolbox for Databases is an open source MCP server that connects AI agents, IDEs and applications to enterprise databases. It provides prebuilt tools for exploring schemas and running queries, plus a framework for custom tools. It is aimed at developers building agents that need database access.
Connects AI agents, IDEs and applications to enterprise databases through the Model Context Protocol. Offers prebuilt database tools for MCP clients and a framework for building custom tools for production agents.
MongoDB MCP Server lets AI assistants interact with MongoDB databases and MongoDB Atlas. It is an official server from mongodb-js, run locally with npx or Docker. It works with self-managed deployments and Atlas clusters.
Compare with Supabase, ArcadeDB MCP Server or DBHub
pg-aiguide: common questions
Which PostgreSQL version does pg-aiguide search?
The source says search across the official PostgreSQL manual is version-aware and scoped by version, but it does not list specific versions.
Does pg-aiguide work with Claude Code?
Yes. The source describes it as a Claude Code plugin that uses its skills and the public MCP server endpoint.
Do I need an API key to use the public MCP server?
The source does not mention an API key. It gives the public MCP endpoint URL https://mcp.tigerdata.com/docs for adding to supported agents.
How do I install pg-aiguide?
In Claude Code run claude mcp add pg-aiguide -e OPENAI_API_KEY=YOUR_OPENAI_API_KEY -e PGHOST=YOUR_PGHOST -e PGPORT=YOUR_PGPORT -e PGUSER=YOUR_PGUSER -e PGPASSWORD=YOUR_PGPASSWORD -e PGDATABASE=YOUR_PGDATABASE -- npx -y @tigerdata/pg-aiguide. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is pg-aiguide the official server?
pg-aiguide is a community project by timescale, not verified by a company domain.
Is pg-aiguide free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is pg-aiguide safe to use?
It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to pg-aiguide?
Similar MCP servers: Supabase, ArcadeDB MCP Server, DBHub, MCP Toolbox for Databases.
Does pg-aiguide work with ChatGPT?
Yes. Add its server URL in ChatGPT as a custom connector. See MCP in ChatGPT.
