CuratedMCP
✨
OpenAI Agents SDK
Free

How to Install PostgreSQL MCP in OpenAI Agents SDK

Natural language SQL queries on your PostgreSQL databases

What PostgreSQL MCP does

Let your AI agents query and manage PostgreSQL databases using natural language. Safe, sandboxed execution with read-only mode support. Features: - Natural language to SQL translation - Read-only mode for safe production use - Schema introspection - Query result formatting - Connection pooling with PgBouncer support - Query history and explain plans

postgresql
sql
database
analytics

Installation steps

  1. 1Install: pip install openai-agents
  2. 2Copy the snippet below into your agent code
  3. 3Replace placeholder env values with your real keys
  4. 4Pass mcp_servers=[mcp_server] to your Agent()

Python snippet

Python snippetpython
from agents import Agent
from agents.mcp import MCPServerStdio

mcp_server = MCPServerStdio(
    command="npx",
    args=["-y", "@modelcontextprotocol/server-postgres"],
)

agent = Agent(
    name="My Agent",
    model="gpt-4o",
    mcp_servers=[mcp_server],
)
Full server details Open Config Editor

Install in other clients

For maintainers

If you maintain PostgreSQL MCP, add this badge to your README to show it's verified on CuratedMCP:

CuratedMCP Verified
[![CuratedMCP Verified](https://curatedmcp.com/api/badge/postgresql-mcp)](https://curatedmcp.com/marketplace/postgresql-mcp)

Related servers