← MCP server and skill grades

pg-aiguide

timescale/pg-aiguide

C
Type
MCP server
Scanned
Nov 17, 2026
Version
1aef6e452b97
Files read
119

pg-aiguide provides curated PostgreSQL, TimescaleDB, pgvector, and PostGIS best-practice skills along with hybrid documentation search for AI coding assistants. Users who install only the skills or connect to TigerData's hosted endpoint run no local server code, whereas users who run the local MCP server binary risk having their OpenAI API key or database connection redirected by a malicious .env file in an untrusted workspace.

What it can reach

Network
Connects to https://mcp.tigerdata.com/docs when using the plugin or remote MCP configuration; when self-hosted, connects to the configured PostgreSQL database (running schema migrations on startup and querying documentation tables), sends search queries to OpenAI or OpenRouter for embeddings, and optionally listens on HTTP port 3001.
Files
Reads bundled skill markdown files and database migration scripts from its installation directory, and reads any .env file in the current working directory when the local CLI starts.
Secrets
Reads PostgreSQL credentials (PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE) and embedding API keys (OPENAI_API_KEY or OPENROUTER_API_KEY) from environment variables and .env when self-hosted.

Findings

1 high3 low
  1. HighLocal CLI loads .env from the current working directory, allowing untrusted workspaces to steal API keys or redirect connections

    src/index.ts:2

    The published CLI entrypoint imports dotenv/config at startup (as do all scripts in migrations/), which loads environment variables from a .env file in the current working directory if those variables are not already set. When an AI coding agent launches the self-hosted stdio server inside a cloned repository, a malicious .env file can set OPENAI_BASE_URL (or OPENROUTER_API_KEY) so that the first search_docs call sends the user's real OPENAI_API_KEY and search text to an attacker-controlled server, or set unset PG* variables to redirect the database connection and startup migrations. Users of the hosted MCP endpoint or static skills are not affected.

    Fix: Remove automatic dotenv/config imports from src/index.ts and migrations/*.js in the published CLI, or only load an environment file when an explicit path flag is passed by the user.

  2. LowHTTP server mode has no authentication and disables DNS rebinding protection in production and Docker builds

    src/httpServer.ts:19

    When started in HTTP mode, the server requires no password or token, and disables Host-header DNS rebinding protection whenever NODE_ENV is set to production—which is the default in the official Dockerfile (while docker-compose.yml also publishes port 3020 on all interfaces). If a user self-hosts the Docker container locally, any website they visit in a browser (via DNS rebinding) or anyone on the local network (if bound to 0.0.0.0) can query the server and trigger unlimited embedding requests that spend the user's OpenAI or OpenRouter API credits.

    Fix: Keep DNS rebinding protection enabled unless the operator explicitly opts out via a dedicated configuration variable, bind local Docker ports to 127.0.0.1 by default, and support bearer-token authentication for HTTP mode.

  3. LowDocumentation ingest script prints the PostgreSQL connection URI including password to stdout

    ingest/tiger_docs.py:1205

    When an operator runs tiger_docs.py to populate a self-hosted database (or during CI ingestion), the script prints args.database_uri directly to standard output. Because build_database_uri embeds PGPASSWORD (or DB_URL) into that URI—URL-encoding special characters in a way that can also bypass CI log secret masking—the database password is exposed in terminal and job logs. The ingest scripts are not included in the npm package or Docker image.

    Fix: Redact the password component of args.database_uri (for example with urllib.parse.urlsplit) before printing connection details.

  4. LowDeveloper Bun wrapper executes a remote install script without checksum verification

    bun:17

    For developers building the repository from source (or running the default VS Code build task), the ./bun wrapper script downloads https://bun.sh/install with curl and pipes it directly into bash without verifying a cryptographic checksum of the script. Normal users installing skills, plugins, the npm package, or the Docker image never run this script.

    Fix: Download the pinned Bun release archive directly and verify its SHA-256 checksum before extracting and executing the binary.