PostgreSQL (MCP) MCP Server
Query and manage PostgreSQL databases directly from your AI agent. Read schemas, run queries, and manage data.
Quick Answer
- 1. The PostgreSQL (MCP) MCP server lets Claude, Cursor, and VS Code interact with the PostgreSQL (MCP) API through natural language.
- 2. Setup: Add the config to
claude_desktop_config.json, set your Database Credentials variables, and restart. - 3. 2 operations available including Execute SQL query, Get database schema.
- 4. Quality score: 70/99 — fair source quality and documentation coverage.
Overview
Category: Databases
Auth: Database Credentials
Endpoints: 2
Transport: STDIO
Command: npx -y @modelcontextprotocol/server-postgres
Spec: v16
Setup time: ~2 min (auth required)
Environment Variables
DATABASE_URLExample: postgresql://user:pass@host:5432/db
One-Click Install
Copy the snippet for your MCP client and paste it in — zero editing required.
Claude Desktop
Add to claude_desktop_config.json
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres"
],
"env": {
"DATABASE_URL": "postgresql://user:pass@host:5432/db"
}
}
}
}Cursor
Settings → MCP Servers → Add
{
"mcpServers": {
"postgres": {
"url": "https://mcpbridge.org/config/postgres.json"
}
}
}Saves as .cursor/mcp.json in the download. Move it to your project root.
VS Code
Use with MCP extension
{
"mcpServers": {
"postgres": {
"url": "https://mcpbridge.org/config/postgres.json"
}
}
}MCP Server Configuration
Add this to your claude_desktop_config.json or Cursor MCP settings.
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y","@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:pass@host:5432/db"
}
}
}
}What You Can Build
With the PostgreSQL (MCP) MCP server, your AI assistant can:
- Access 2 API operations through natural language
- Read, create, and modify databases resources without writing HTTP requests
- Chain multiple operations in a single conversation for complex workflows
- Combine with other MCP servers for cross-tool automation
Endpoints
/queryExecute SQL query
/schemaGet database schema
Authentication
This API requires Database Credentials authentication.
Set the required environment variables in your MCP client before using this server. Refer to the PostgreSQL (MCP) API documentation to obtain credentials.
Required environment variables:
DATABASE_URL
Spec Version
Version: 16
Spec version published with the OpenAPI document. Config auto-updates when the spec changes.
Page last updated: June 13, 2026
Quality Score
- +Official source (+30)
- +Has documentation (+12)
- +GitHub repo (+12)
- +Auth type defined (+8)
- +2 endpoints (+8)
Read the Guide
Step-by-step walkthrough for setting up and using the PostgreSQL (MCP) MCP server.
PostgreSQL (MCP)MCP Setup Guide →This listing is verified by the API owner.
Similar APIs
Other APIs in the Databases category.
Notion API
Hello and welcome! To make use of this API collection collection as it's written, please duplicate [this database template](https://www.notion.so/8e2c2b769e1d47d287b9ed3035d607ae?v=dc1b92875fb94f10834ba8d36549bd2a). [Create an integration](https://www.notion.so/my-integrations) to retrieve an API
Application Auto Scaling
<p>With Application Auto Scaling, you can configure automatic scaling for the following resources:</p> <ul> <li> <p>Amazon AppStream 2.0 fleets</p> </li> <li> <p>Amazon Aurora Replicas</p> </li> <li> <p>Amazon Comprehend document classification and entity recognizer endpoints</p> </li> <li> <p>Amazo
Amazon CloudWatch Application Insights
<fullname>Amazon CloudWatch Application Insights</fullname> <p> Amazon CloudWatch Application Insights is a service that helps you detect common problems with your applications. It enables you to pinpoint the source of issues in your applications (built with technologies such as Microsoft IIS, .NET,
AWS Cost Explorer Service
<p>You can use the Cost Explorer API to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data. This might include the number of daily write operations for Amazon DynamoDB database tabl