Pg AiguideCAUTION
MCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
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 S
e82db42ae9f9OBSERVED · 2026-09-23Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add pg-aiguide --env OPENAI_API_KEY=${OPENAI_API_KEY} --env PGPASSWORD=${PGPASSWORD} -- npx -y @tigerdata/[email protected]{
"mcpServers": {
"pg-aiguide": {
"command": "npx",
"args": [
"-y",
"@tigerdata/[email protected]"
],
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}",
"PGPASSWORD": "${PGPASSWORD}"
}
}
}
}Exposed tools (1)
1 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
view_skill | read | Retrieve detailed skills for TimescaleDB operations and best practices. |
Trust audit
CAUTIONgrade B · trust 85/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (2 observation(s))
- Network
- declared (2 observation(s))
- Shell
- declared (5 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- found
Findings (10)
return f"postgresql://{pg_user}:{encoded_password}@{pg_host}:{pg_port}/{pg_database}".env.sample
skills/postgres/references/backfill-strategies.md
skills/postgres/references/complete-example.md
skills/postgres/references/design-postgis-tables.md
skills/postgres/references/design-postgres-tables.md
skills/postgres/references/find-hypertable-candidates.md
hash_suffix = hashlib.md5(path.encode()).hexdigest()[:8]
@opentelemetry/api, dotenv, gray-matter, migrate, pg, zod, @biomejs/biome, @types/bun
> You are a senior software engineer. You are given a task to generate a Postgres schema for an IoT device company.
Gates applied: no_behavioural_pass.
e82db42ae9f9full audit observations/trust-audit/mcp-server/timescale__pg-aiguide.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-09-23 | e82db42ae9f9 | CAUTION | B | 85 | source changed, verdict held |
Questions
What is the Pg Aiguide MCP server?
MCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
What tools does Pg Aiguide expose?
1 in total: 1 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Pg Aiguide safe to connect to an agent?
With care. The audit graded it B (85/100) and found 10 things worth knowing before you trust this server, listed below with the exact line each was found on.
What credentials does Pg Aiguide need?
It reads OPENAI_API_KEY and PGPASSWORD from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Pg Aiguide run?
It speaks streamable-http, so it runs as a service you connect to over the network. It is published on npm as @tigerdata/pg-aiguide at 0.6.1.
How current is this page?
The grade is for one exact copy of the source (e82db42ae9f9), read on 2026-09-23. The repository is watched and re-audited when it changes.