/ Каталог / Песочница / pg-aiguide
● Сообщество timescale ⚡ Сразу

pg-aiguide

автор 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.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

pg-aiguide.replay ▶ готово
0/0

Установка

Выберите клиент

~/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
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

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

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

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

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

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

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

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

Continue использует массив объектов серверов, а не map.

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

Добавьте в context_servers. Zed перезагружается автоматически.

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

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: pg-aiguide

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

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

Когда использовать: You want generated SQL that actually survives a code review.

Предварительные требования
  • Add the pg-aiguide MCP — Point client at https://mcp.tigerdata.com/docs or install the Claude plugin
Поток
  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.✓ Скопировано
    → Agent cites view_skill output
  2. Review constraints + indexes
    Show me every constraint you added and why. Any redundant indexes?✓ Скопировано
    → 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.✓ Скопировано
    → Modern idioms applied

Итог: Schema with sensible constraints, right identity columns, and indexes you can defend.

Подводные камни
  • Agent overuses indexes — write-heavy tables slow down — Ask for workload-aware indexing — tell it the expected reads/writes ratio
Сочетать с: postgres

How to get expert context when reading an EXPLAIN plan

👤 Devs optimizing a slow query ⏱ ~15 min intermediate

Когда использовать: You have EXPLAIN ANALYZE output and don't know what's normal.

Поток
  1. Share the plan
    [paste EXPLAIN ANALYZE] — use pg-aiguide to identify what each node does and typical reasons for cost here.✓ Скопировано
    → 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.✓ Скопировано
    → Concrete CREATE INDEX with justification

Итог: Plan understood, change defended with docs.

Сочетать с: postgres

How to pick the right TimescaleDB hypertable settings

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

Когда использовать: First hypertable in a new service — many knobs.

Поток
  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.✓ Скопировано
    → Chunk interval + compression policy rationale
  2. Draft the table
    Draft the CREATE TABLE + create_hypertable + compression policy.✓ Скопировано
    → Full DDL

Итог: Hypertable config tuned for your ingest rate.

Сочетать с: postgres

Комбинации

Сочетайте с другими MCP — эффект x10

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.✓ Скопировано
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.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
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

Стоимость и лимиты

Во что обходится

Квота API
Hosted endpoint — reasonable-use rate limits
Токенов на вызов
300-1500 tokens per search result
Деньги
Free
Совет
Use view_skill for broad guidance, search_docs only when you need a specific citation.

Безопасность

Права, секреты, радиус поражения

Минимальные скоупы: None — docs only
Хранение учётных данных: None
Исходящий трафик: Your queries go to mcp.tigerdata.com
Никогда не давайте: Nothing to grant; no DB access

Устранение неполадок

Частые ошибки и исправления

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.

Проверить: curl -I https://mcp.tigerdata.com/docs
view_skill returns generic output

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

Альтернативы

pg-aiguide в сравнении

АльтернативаКогда использоватьКомпромисс
postgres MCPYou need to execute SQL, not just read docsNo curated best-practice layer
Supabase MCPSupabase-specific project managementSupabase-locked

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills