MCP Directory

PostgreSQL

GitHub
Databases

Query and manage PostgreSQL databases directly

Capabilities

database query

Direct install

Run the underlying MCP server directly — without Agent-CoreX routing.

npx -y @modelcontextprotocol/server-postgres

Note: Requires DATABASE_URL environment variable

Environment Variables

DATABASE_URLRequired

Use with Agent-CoreX

Agent-CoreX intelligently routes which tools from PostgreSQL your AI agent actually needs per request — reducing token usage and cost.

agent-corex.json

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres"
      ],
      "env": {
        "DATABASE_URL": "<your-database_url>"
      }
    }
  }
}

Route PostgreSQL intelligently

Connect in 2 minutes. Only pay for the tools your agent actually uses.

Installation Guide

Use with Agent-CoreX

Recommended: intelligent tool routing, lower costs

uvx agent-corex mcp add postgres

Agent-CoreX selects only the tools your agent needs, cutting token usage by up to 60%.

Direct Install

Use PostgreSQL directly without routing

npx -y @modelcontextprotocol/server-postgres

New to Agent-CoreX? View setup guide →

PostgreSQL MCP Server — Agent-CoreX