Explore live Postgres databases with AI agents through the Model Context Protocol
This skill guides you through connecting an AI agent to a PostgreSQL database using the pg-mcp-server Model Context Protocol implementation. It covers installing the MCP server, configuring the database connection, exploring schemas as MCP resources, and running queries through natural language. The workflow is designed for developers who need to understand, document, or query an unfamiliar database without writing raw SQL manually.
Use cases
- Onboarding to a new codebase with an undocumented database
- Writing database documentation from live schema inspection
- Generating ORM migrations against an existing production database
- Debugging data inconsistencies referenced in a support ticket
- Performing ad-hoc data analysis without a dedicated BI tool
Key features
- Install pg-mcp-server globally with: npm install -g @modelcontextprotocol/server-postgres
- Configure your database connection string via environment variables: DATABASE_URL=postgresql://user:pass@host:5432/dbname
- Add the server to your AI client's MCP settings (Claude Desktop, Cursor, or Windsurf config.json)
- Explore the database schema by asking the agent to list tables, describe relationships, or explain unfamiliar tables
- Execute read queries first to verify data access before attempting writes or transactions
Related
Related
3 Indexed items
Designing with LLM structured outputs
This skill covers when and how to ask an LLM for machine-readable payloads: define a JSON Schema (or the vendor's equivalent), enable the structured-output feature your provider documents, validate responses in application code, and handle refusals or validation errors explicitly. It applies to tool-calling agents, extraction pipelines, configuration emitters, and any workflow where brittle text parsing creates production risk.
SEO audit for web properties
Diagnoses indexing, crawlability, and on-page SEO issues across an entire site using automated crawls, Lighthouse checks, and structured output. An SEO audit surfaces actionable findings ranked by priority before manual review, making it possible to address critical issues quickly rather than discovering them through traffic drops.
Git worktrees for isolation
Uses Git worktrees to create isolated working directories attached to the same repository, each on a different branch, so parallel experiments or long-running tasks do not interfere with the main working tree or require repeated stash-and-reapply cycles. This is especially useful when one branch requires a heavy build or test run while work continues on another.