pg-aiguide
io.github.timescale/pg-aiguide
About pg-aiguide
pg-aiguide is an MCP server published by the GitHub account timescale. Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
It runs on your own machine: your AI client starts it from the npm package @tigerdata/pg-aiguide at version 0.6.1, or you can connect to the hosted version instead.
It asks for 7 secrets: OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE and DB_SCHEMA. Give it a key with the least access that still works.
Version 0.6.1 was published on 4 September 2026, and the source code is public, so you can read it before installing.
Written from the registry entry. 10 automated checks on the registry entry and the package code: 8 pass, 1 warn, 0 fail, 1 info. How we check.
What it asks for
| Variable | Required | Secret | Description |
|---|---|---|---|
OPENAI_API_KEY | Yes | Yes | Your API key for text embeddings via OpenAI |
PGHOST | Yes | Yes | PostgreSQL host to connect to |
PGPORT | Yes | Yes | PostgreSQL port to connect to |
PGUSER | Yes | Yes | PostgreSQL user to connect as |
PGPASSWORD | Yes | Yes | PostgreSQL password to connect with |
PGDATABASE | Yes | Yes | PostgreSQL database to connect to |
DB_SCHEMA | No | Yes | PostgreSQL database schema to use |
Checks
| Check | Result | Detail |
|---|---|---|
| Source repository linked | Pass | https://github.com/timescale/pg-aiguide |
| Version pinned | Pass | Every package has an explicit version |
| Remote uses HTTPS | Pass | All remote endpoints use https:// |
| Secrets requested | Warn | Asks for 7 secrets: OPENAI_API_KEY, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, DB_SCHEMA |
| Known package registry | Pass | All packages come from npm, PyPI, OCI, NuGet or MCPB |
| Namespace ownership | Info | Name verified via GitHub account timescale |
| Registry text aimed at the AI | Pass | Description and settings contain no hidden characters or instructions to the AI |
| Install scripts | Pass | @tigerdata/pg-aiguide@0.6.1 runs nothing at install |
| Code red flags | Pass | Read 19 files in @tigerdata/pg-aiguide@0.6.1: no obfuscation, encoded execution, credential reads or data-collection endpoints found |
| Text aimed at the AI | Pass | No hidden characters or instructions to the AI in 19 files, including comments and the README |
Code review: Pass, with notes
We read all 993 lines in 17 files of @tigerdata/pg-aiguide 0.6.1 on 2026-10-31, without running it.
Search tool over PostgreSQL, PostGIS and TimescaleDB documentation, read-only. When run yourself, your search text goes to your Postgres docs database and (for semantic search, the default) to OpenAI to build an embedding. The skill texts it serves come from a separate library that was not part of this review.
What we found
- Note Unless semanticWeight is 0, every search query is sent to OpenAI to make an embedding. Running it locally needs your own OPENAI_API_KEY and a Postgres loaded with the docs corpus; most users use the hosted endpoint instead.
dist/apis/searchDocs.js:95-101 - Note The view_skill tool, its skill list (appended to the tool description) and the MCP prompts come from @tigerdata/mcp-boilerplate/skills, a dependency; that AI-facing text is not in this package and was not reviewed here.
dist/apis/index.js:6-11, dist/prompts/index.js:2 - Info SQL interpolates schema and table prefix, but schema is validated against ^[a-z_][a-z0-9_$]{0,62}$ (config.js:6-25) and the prefix comes from a fixed enum; user text is always a bound parameter. No SQL injection.
dist/util/getDocChunkRows.js:4-23 - Info 5 bun test files are shipped in dist (counted in the line total); they only exercise mocks.
dist/*.test.js - Info No package.json in the reviewed copy; dependencies are taken from imports. No obfuscation, install hooks, dynamic code, child_process or hard-coded secrets.
package
| Talks to | PostgreSQL server from PG* env vars (pg Pool defaults): the search query text (keyword search) or its embedding vector, plus version/limit, as bound parameters (when search_docs is called) api.openai.com (via @ai-sdk/openai): the search query text, to create a text-embedding-3-small embedding (when search_docs is called with semanticWeight > 0 (default 0.7, so most calls)) OpenTelemetry/Logfire exporter (configured in @tigerdata/mcp-boilerplate, not in this package): span attributes: result count and top-3 result ids and scores (no document content) (when a tracer is configured) |
|---|---|
| Keys and settings | PGHOST / PGUSER / PGPASSWORD / PGDATABASE / PGPORT (read by pg): the configured PostgreSQL serverOPENAI_API_KEY (read by @ai-sdk/openai): api.openai.comDB_SCHEMA: local (schema name, strictly validated)DISABLE_MCP_SKILLS: local (hides view_skill tool)NODE_ENV: local (DNS-rebinding protection on unless production) |
| Files on your machine | Loads .env via 'dotenv/config'. No other file access in this package (skills are loaded by the @tigerdata/mcp-boilerplate dependency). |
| Runs programs | None in this package. cliEntrypoint from the boilerplate dependency launches stdio.js or httpServer.js (its own files). |
| Telemetry | No telemetry of its own. It records result ids/scores on an OpenTelemetry span if the host app configured a tracer (searchDocs.js:85-94); with no tracer this is a no-op. |
| Tools | search_docs, view_skill |
| Tool descriptions | clean |
This covers the package's own code only, not the 8 packages it depends on (@tigerdata/mcp-boilerplate, @ai-sdk/openai, ai, @opentelemetry/api, pg, zod, dotenv, bun:test (test files only)), and not the hosted version, which runs code we cannot see. A new version drops this review until we read it again.
Popularity & health: 73 / 100
Worked out from public numbers and our own checks, not from user reviews or ratings. It says how used and how looked-after a server is, not whether it is safe.
120 forks, 91 merged pull requests. Sources: GitHub, npm, PyPI (pypistats.org) and Hacker News (Algolia), fetched 2026-10-31.
What people say
1 Hacker News thread linking to the source code. We link to them and copy nothing.
- Show HN: Pg-aiguide – Write better PostgreSQL code with AI 3 points, 0 comments, 2025-11-24
Look further: search Reddit, search Hacker News, read its GitHub issues. These are not reviews we checked.
Facts
| Registry name | io.github.timescale/pg-aiguide |
|---|---|
| Publisher | GitHub account timescale |
| How the name is verified | Name verified via GitHub account timescale. The registry ties the name prefix to that account or domain; it does not check the code. |
| Type | Local package and a hosted remote |
| Packages | npm @tigerdata/pg-aiguide 0.6.1 (stdio)oci ghcr.io/timescale/pg-aiguide:0.6.1 no version given (stdio) |
| Remote endpoints | streamable-http https://mcp.tigerdata.com/docs |
| Version | 0.6.1 |
| Published | |
| Last updated | |
| Source repository | https://github.com/timescale/pg-aiguide |
| Website | None linked |
| Category | Databases & data (assigned by keyword rule, not by hand) |
Related servers in Databases & data
- SqlServer.Rules4/4Analyze T-SQL scripts for design, naming, and performance issues…
- Gnosis MCP7/7Zero-config MCP server for searchable documentation. SQLite or…
- SQD4/4Query 130+ SQD Portal datasets across blockchains, including native…
- Speak To Your Database (STYD)3/3Odoo ERP, PostgreSQL & MySQL MCP server: ask your business data in…
- Slotlock4/5Calendars for AI agents: free/busy, next free slot, and bookings…
- pgport7/7Read-only SQL queries against a PostgreSQL database.