Enterprise Connectors
PostgreSQL logo. PostgreSQL MCP server connector.

PostgreSQL MCP Server

PostgreSQL is a powerful, open-source relational database system. This connector uses PostgREST to provide a RESTful API interface to your PostgreSQL database.

Tools
25
Last Updated
Apr 7, 2026
Category
all
Enterprise-grade security
SSO & authentication ready
Full governance & audit logs

What is the PostgreSQL MCP Server?

The PostgreSQL MCP server gives AI agents structured, permission-aware access to PostgreSQL through the Model Context Protocol. With 25 pre-built actions, agents can read, create, and update PostgreSQL data on behalf of authorized users.

Willow ships the PostgreSQL MCP server as part of an enterprise control plane. Every call runs behind SSO (Okta, Azure AD), enforces RBAC and least-privilege at runtime, writes to a full audit trail, and integrates with Splunk and Loki for SIEM visibility. Connect from Claude Desktop, Claude Code, Cursor, ChatGPT, VS Code, n8n, or any custom agent. Install once, distribute org-wide, and see exactly how PostgreSQL is being used by every AI agent in your stack.

Tools

List Tables

List all tables and views in the exposed PostgreSQL schema. Returns table names, types (table/view), and basic metadata. Essential for discovering available data sources and understanding database structure.

Describe Table

Get detailed schema information about a specific table including column names, data types, nullability, defaults, and constraints. Essential for understanding table structure before querying or modifying data.

Get Table Sample

Retrieve sample rows from a table for quick data exploration. Returns a limited number of rows to understand data format, content, and structure without reading the entire table. Use this to preview data before writing complex queries.

Search Tables

Search for tables and views by name pattern across the database. Useful for finding specific datasets when you don't know their exact location or name. Returns matching table names and types.

Get Table Row Count

Get the total number of rows in a table quickly without fetching data. Uses PostgREST's count header for efficient counting. Useful for understanding table size and data volume.

Query Table

Query a table with flexible filtering, sorting, column selection, and pagination. This is the main data retrieval tool. Supports PostgREST's powerful filter operators (eq, gt, gte, lt, lte, like, ilike, in, is, etc.). Use this for most data retrieval needs.

Full-Text Search

Perform full-text search on text columns using PostgreSQL's text search capabilities. Supports different search types (plain, phrase, websearch) and multiple languages. Useful for finding records by keywords or phrases in text fields.

Query with Logical Operators

Execute complex queries with OR, AND, NOT logic. Allows combining multiple conditions in flexible ways. For example, find users who are either under 18 OR over 65, or students who have grade >= 90 AND (age is 14 OR age is NOT between 11 and 17).

Query JSON Columns

Query tables with JSON/JSONB columns and extract specific fields. Use arrow operators to access nested JSON data: -> for JSON objects, ->> for text values. Supports filtering and selecting JSON paths. Example: data->>'email' or data->phones->0->>'number'

Select Distinct Values

Get unique values from a column. Useful for discovering what values exist in a column, building filters, or understanding data distribution. Automatically removes duplicates and sorts results.
1–10 of 25 tools

Customize Tools

Edit descriptions, modify arguments, select tools, or add new ones

Edit descriptions
Change arguments
Select tools
Create New

Set Up Your PostgreSQL MCP Server in Minutes

Add the following configuration to your MCP client. Authentication is handled via OAuth. Compatible with Claude Desktop, Claude Code, Cursor, ChatGPT, VS Code, n8n, and any MCP-compatible agent.

Claude Desktop

claude_desktop_config.json
{
  "mcpServers": {
    "willow-postgresql": {
      "type": "http",
      "url": "https://<org>.mcp-s.com/mcp/mcp/postgresql"
    }
  }
}

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "willow-postgresql": {
      "type": "http",
      "url": "https://<org>.mcp-s.com/mcp/mcp/postgresql"
    }
  }
}

Claude Code

CLI
claude mcp add willow-postgresql --transport http https://<org>.mcp-s.com/mcp/mcp/postgresql

n8n

HTTP Request Node
{
  "url": "https://<org>.mcp-s.com/mcp/mcp/postgresql",
  "method": "POST"
}

Or click "Install with Willow" above to set up automatically with SSO and RBAC preconfigured.

Enterprise Governance for PostgreSQL

Willow adds the layer PostgreSQL and every other SaaS doesn't ship out of the box: every call runs behind SSO (Okta, Azure AD), enforces RBAC and least-privilege at runtime, writes to full audit logs, and detects shadow AI usage across your stack. One MCP gateway. Any agent. Every tool.

PostgreSQL MCP Server FAQ

What is the PostgreSQL MCP server?

The PostgreSQL MCP server is a Model Context Protocol implementation that lets AI agents like Claude, Cursor, and ChatGPT read and write PostgreSQL data through a standardized interface. Willow hosts and governs this server so enterprises can roll it out without a security review backlog.

How is Willow's PostgreSQL MCP server different from the official one?

The official PostgreSQL MCP server is scoped to a single user's account and does not include enterprise governance. Willow's version adds SSO, RBAC, audit logging, shadow AI detection, and centralized control over which actions agents can take across the entire org.

Which AI clients work with the PostgreSQL MCP server?

Claude Desktop, Claude Code, Cursor, ChatGPT, VS Code with MCP support, n8n, and any custom agent built with OpenAI Agents SDK, LangChain, Vercel AI SDK, or Anthropic SDK.

Is the PostgreSQL MCP server secure? How does Willow handle authentication?

Every call runs behind your existing SSO (Okta, Azure AD). Per-user OAuth scopes the agent to exactly what that user can do in PostgreSQL, nothing more. No credentials reach the LLM. Every action writes to an audit trail.

Can I limit which PostgreSQL actions agents can take?

Yes. Willow lets you scope agents to specific actions, specific projects, or specific environments. Toggle actions on or off in the dashboard, or enforce policy via infrastructure-as-code through GitHub.

How do I detect shadow PostgreSQL MCP servers in my org?

Willow's browser extension and discovery service surface unmanaged MCP servers, skills, and AI agents across the org. If a developer installed an unapproved PostgreSQL MCP locally, you'll see it.

What does the PostgreSQL MCP server cost?

Pricing depends on org size and deployment model (SaaS, dedicated cloud, self-host). See withwillow.ai/pricing or contact sales for a quote.

How do I install the PostgreSQL MCP server with Willow?

Install via the Willow Connect Panel in one click, or paste the JSON snippet above into your Claude Desktop, Cursor, or Claude Code config. SSO and RBAC inherit from your existing Willow setup.

Compare Willow MCP Gateway

See how Willow stacks up against other MCP platforms on governance, security, and enterprise readiness.

Your agents are already in the wild.

Give them a Basecamp. Go from AI chaos to AI work, in minutes.

PostgreSQL MCP Server | Willow