pg-aiguide
MCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Documentation
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 postgresOr pick individual skills interactively:
npx skills add timescale/pg-aiguideWorks 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@aiguideInstall 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@aiguideThis 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-aiguideCursor
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 httpOpenCode
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)
Unified search tool supporting semantic (vector similarity) and keyword (BM25) search across multiple documentation sources:
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:
🔌 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
Frequently asked questions
What is pg-aiguide?
pg-aiguide is MCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
How do I install pg-aiguide?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is pg-aiguide open source?
Yes — it is hosted on GitHub at https://github.com/timescale/pg-aiguide and has 1,834 stars.
Related MCP tools
⚡ 需求分析效率提升 200%!全球首个为 AI 编程时代设计的团队协作 MCP 服务器,自动分析需求自动编写前后端代码,下载切图
Official Microsoft Learn MCP Server and CLI tool – powering LLMs and AI agents with real-time, trusted Microsoft docs & code samples.
Control Gmail, Google Calendar, Docs, Sheets, Slides, Chat, Forms, Tasks, Search & Drive with AI - Comprehensive Google Workspace MCP Server & CLI Tool
Cut AI token costs 95%+ on code exploration. The leading MCP server for precise, symbol-level GitHub code retrieval via tree-sitter AST. Works with Claude Code, Cursor & any MCP client. 313B+ tokens saved.
Decision audit trail + persistent memory for AI trading agents. Outcome-weighted recall, tamper-evident SHA-256 chain with RFC 3161 anchoring, 20 MCP tools.
Official remote MCP server for Atlassian. Securely connect Jira, Confluence, Jira Service Management, Bitbucket, and Compass to Claude, ChatGPT, Cursor, VS Code, and other AI tools using OAuth 2.1 or API tokens.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP