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.
DuckDB MCP community extension (`duckdb_mcp`)
The DuckDB-distributed community extension `duckdb_mcp` embeds MCP client and server capabilities directly inside DuckDB. Installers load it via `INSTALL duckdb_mcp FROM community` followed by `LOAD duckdb_mcp`, after which SQL can attach remote MCP servers (stdio/TCP/WebSocket transports), enumerate resources (`mcp_list_resources`), invoke remote tools (`mcp_call_tool`), and wrap responses with `read_csv`/`read_json`/`read_parquet` URIs routed through `mcp://`. In reverse direction, DuckDB can publish tables, queries, and execution-bound tools (`mcp_publish_table`, `mcp_publish_query`, `mcp_publish_execution_tool`) while `mcp_server_start` exposes them to external MCP-compatible clients.
Upstash MCP Server
Upstash documents an official Model Context Protocol server at upstash.com/docs/agent-resources/mcp implemented in the `upstash/mcp-server` repository and npm package `@upstash/mcp-server`. Started with `npx -y @upstash/mcp-server@latest --email YOUR_EMAIL --api-key YOUR_API_KEY`, it exposes tools for serverless Redis, QStash, Workflow runs, and Upstash Box so agents can manage and debug account resources from Cursor, Claude Code, VS Code, Codex, and other MCP clients. Read-only API keys automatically disable mutating tools per docs; optional `--transport http`, `--disable-telemetry`, and Upstash Box API key flags are documented for advanced setups.