Model Context Protocol server for schema-aware Postgres database access from any MCP-capable AI agent
pg-mcp-server is a Model Context Protocol server implementation that connects AI agents to PostgreSQL databases. It registers database schemas as MCP resource templates and exposes SQL execution as an MCP tool. Agents can introspect table structures, run parameterized queries, and manage transactions without leaving the chat interface. Designed as a reference implementation for database MCP integrations.
Use cases
- Inspect a Postgres database schema as MCP resources before writing migrations
- Execute read-only analytical queries via AI agent with full SQL context
- ValidateORM-generated SQL against the actual database schema
- Debug RLS policy behavior by running queries as different Postgres roles
- Generate database documentation from live schema introspection
Key features
- Claude Desktop
- Cursor
- Windsurf
Related
Related
3 Indexed items
Postgres MCP
Enables AI agents to execute read-only SQL queries against PostgreSQL databases, inspect table schemas, and analyze query performance. Agents can debug data issues or prepare analytics without requiring direct database credentials in the conversation. Supports connection pooling and multiple database targets.
Qdrant MCP Server
Official Qdrant MCP server implementation that gives AI agents a semantic memory layer backed by Qdrant vector search. It exposes MCP tools for storing information and retrieving relevant context, so assistants can persist and recall facts across sessions instead of relying only on short chat history.
Prisma MCP
Provides AI agents access to Prisma schemas, migration planning, and database introspection capabilities. Agents can propose migrations, explore data models, and generate type-safe queries based on your Prisma setup. Works with local projects and remote Prisma Data Proxy deployments.