# PostgreSQL

> Use this tool when you need to manage and access PostgreSQL databases directly, solving problems such as database structure exploration, table content analysis, and ad-hoc query execution. It provides inputs such as database connections and SQL queries, and outputs include schema listings, table discoveries, and query results with configurable row limits. Use it in development or production environments when you require comprehensive database management capabilities and robust error handling for SQL operations.

Canonical page: https://skillsregistry.net/skills/blackklegend-postgres  
JSON: https://api.skillsregistry.net/v1/skills/blackklegend-postgres

## Description

This PostgreSQL MCP server by Blackklegend provides direct database access and management capabilities through the pg library and Model Context Protocol SDK. Built with TypeScript and featuring five core tools including schema listing, table discovery, DDL retrieval, data sampling, and arbitrary SQL execution with configurable row limits, it connects to PostgreSQL databases using standard environment variables or hardcoded defaults and automatically applies LIMIT clauses to prevent runaway queries. The implementation includes comprehensive error handling for SQL operations and uses the information_schema for metadata discovery, making it valuable for database administrators, developers, and AI assistants who need to explore database structures, analyze table contents, and execute ad-hoc queries against PostgreSQL databases in development or production environments.

## Trust

- **Trust score (0–1):** 1.00
- **Verification tier:** verified
- **Last scanned:** 2026-09-28

## Facts

- **Version:** 1.0.0
- **Skill type:** atomic
- **Execution layer:** mcp-remote
- **Runtime environment:** api
- **Category:** database
- **Updated:** 2026-09-28

## Source

- **Source listing:** [PulseMCP](https://www.pulsemcp.com/servers/blackklegend-postgres)
- **Repository:** <https://github.com/blackklegend/postgres-mcp>

## Use it

Resolve this record through the SkillsRegistry MCP server (no auth, read-only):

```
claude mcp add --transport http --scope user skillsregistry https://api.skillsregistry.net/mcp
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_skill",
    "arguments": {
      "slug": "blackklegend-postgres"
    }
  }
}
```

REST: `GET https://api.skillsregistry.net/v1/skills/blackklegend-postgres` · pull for local use: `GET https://api.skillsregistry.net/v1/skills/blackklegend-postgres/pull`

---
SkillsRegistry indexes agent skills from public registries and GitHub. Skills we have analysed are scanned with Circle-IR and scored on six dimensions; each listing states its scan coverage. More: https://skillsregistry.net/llms.txt
