/ Verzeichnis / Playground / pg-aiguide
● Community timescale ⚡ Sofort

pg-aiguide

von timescale · timescale/pg-aiguide

Plug PostgreSQL expertise into your coding agent — semantic search over official docs plus curated best-practice skills.

Timescale's pg-aiguide is both a Claude plugin and an MCP server. It exposes semantic search over PostgreSQL/TimescaleDB/PostGIS docs and curated 'skills' (schema design, indexing, data types, performance). Reported 4x more constraints and 55% more indexes in generated schemas.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

pg-aiguide.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren Client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "pg-aiguide": {
      "command": "uvx",
      "args": [
        "pg-aiguide"
      ],
      "_inferred": true
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "pg-aiguide": {
      "command": "uvx",
      "args": [
        "pg-aiguide"
      ],
      "_inferred": true
    }
  }
}

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "pg-aiguide": {
      "command": "uvx",
      "args": [
        "pg-aiguide"
      ],
      "_inferred": true
    }
  }
}

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "pg-aiguide": {
      "command": "uvx",
      "args": [
        "pg-aiguide"
      ],
      "_inferred": true
    }
  }
}

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "pg-aiguide",
      "command": "uvx",
      "args": [
        "pg-aiguide"
      ]
    }
  ]
}

Continue nutzt ein Array von Serverobjekten statt einer Map.

~/.config/zed/settings.json
{
  "context_servers": {
    "pg-aiguide": {
      "command": {
        "path": "uvx",
        "args": [
          "pg-aiguide"
        ]
      }
    }
  }
}

In context_servers hinzufügen. Zed lädt beim Speichern neu.

claude mcp add pg-aiguide -- uvx pg-aiguide

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: pg-aiguide

How to get an agent to write a production-grade Postgres schema

👤 Backend engineers starting a new service ⏱ ~20 min intermediate

Wann einsetzen: You want generated SQL that actually survives a code review.

Voraussetzungen
  • Add the pg-aiguide MCP — Point client at https://mcp.tigerdata.com/docs or install the Claude plugin
Ablauf
  1. State the domain
    I need a schema for a multi-tenant SaaS with orgs, users, projects, invites. Before writing SQL, consult pg-aiguide for schema design and identifier best practices.✓ Kopiert
    → Agent cites view_skill output
  2. Review constraints + indexes
    Show me every constraint you added and why. Any redundant indexes?✓ Kopiert
    → Per-index justification
  3. Check modern features
    Use search_docs to verify you're using GENERATED ALWAYS AS IDENTITY (not SERIAL), and NULLS NOT DISTINCT where appropriate.✓ Kopiert
    → Modern idioms applied

Ergebnis: Schema with sensible constraints, right identity columns, and indexes you can defend.

Fallstricke
  • Agent overuses indexes — write-heavy tables slow down — Ask for workload-aware indexing — tell it the expected reads/writes ratio
Kombinieren mit: postgres

How to get expert context when reading an EXPLAIN plan

👤 Devs optimizing a slow query ⏱ ~15 min intermediate

Wann einsetzen: You have EXPLAIN ANALYZE output and don't know what's normal.

Ablauf
  1. Share the plan
    [paste EXPLAIN ANALYZE] — use pg-aiguide to identify what each node does and typical reasons for cost here.✓ Kopiert
    → Node-by-node diagnosis citing docs
  2. Ask for index advice
    Based on the plan, propose one index change. Verify the index type (BTREE vs BRIN vs partial) via pg-aiguide.✓ Kopiert
    → Concrete CREATE INDEX with justification

Ergebnis: Plan understood, change defended with docs.

Kombinieren mit: postgres

How to pick the right TimescaleDB hypertable settings

👤 Teams doing time-series on Postgres ⏱ ~15 min advanced

Wann einsetzen: First hypertable in a new service — many knobs.

Ablauf
  1. State ingest shape
    I'll ingest ~10k rows/sec of IoT sensor data, queries are last-24h and last-30d aggregates. Consult pg-aiguide for TimescaleDB hypertable chunk interval recommendations.✓ Kopiert
    → Chunk interval + compression policy rationale
  2. Draft the table
    Draft the CREATE TABLE + create_hypertable + compression policy.✓ Kopiert
    → Full DDL

Ergebnis: Hypertable config tuned for your ingest rate.

Kombinieren mit: postgres

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

pg-aiguide + postgres

Consult pg-aiguide for best practices, then actually apply them via postgres MCP

Use pg-aiguide to pick the right index for orders.user_id, then apply it via postgres MCP on the dev DB. Show EXPLAIN ANALYZE before/after.✓ Kopiert
pg-aiguide + github

Code-review a schema migration with docs-backed reasoning

Review PR #4421 which adds a new table. Use pg-aiguide to flag any choices that diverge from idiomatic PG 16.✓ Kopiert

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
search_docs query: str, product?: 'postgres'|'timescale'|'postgis', version?: str Look up a specific feature, function, or setting free
view_skill skill: 'schema-design'|'indexing'|'data-types'|'performance' Apply best-practice guidance before writing schema free

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
Hosted endpoint — reasonable-use rate limits
Tokens pro Aufruf
300-1500 tokens per search result
Kosten in €
Free
Tipp
Use view_skill for broad guidance, search_docs only when you need a specific citation.

Sicherheit

Rechte, Secrets, Reichweite

Minimale Scopes: None — docs only
Credential-Speicherung: None
Datenabfluss: Your queries go to mcp.tigerdata.com
Niemals gewähren: Nothing to grant; no DB access

Fehlerbehebung

Häufige Fehler und Lösungen

search_docs returns outdated info

Pin version: search_docs(query, version='17') for PG 17 specifics.

Connection to mcp.tigerdata.com fails

Check corporate firewall; fall back to the Claude plugin (local) install.

Prüfen: curl -I https://mcp.tigerdata.com/docs
view_skill returns generic output

Specify the skill slug exactly — unknown slugs fall back to generic summaries.

Alternativen

pg-aiguide vs. andere

AlternativeWann stattdessenKompromiss
postgres MCPYou need to execute SQL, not just read docsNo curated best-practice layer
Supabase MCPSupabase-specific project managementSupabase-locked

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen