Home/Servers/PostgreSQL MCP Server

PostgreSQL MCP Server

by Anthropic ยท โญ 4.9k stars ยท updated 2 months ago

Read-only access to PostgreSQL databases. Run SQL queries, inspect schemas, and explore data โ€” all through your AI assistant. Official Anthropic reference implementation.

96
Excellent

Quality Score Breakdown

maintenance98/100
community95/100
documentation96/100
compatibility95/100

Use Cases

  • โœ“query databases
  • โœ“inspect schemas
  • โœ“run SQL queries
  • โœ“explore data

โšก One-Click Install Configs

Copy the config below and paste it into your AI client's config file.

๐Ÿค– Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://localhost/mydb"
      ]
    }
  }
}
โšก Cursor
~/.cursor/mcp.json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://localhost/mydb"
      ]
    }
  }
}
๐Ÿ’™ VS Code
.vscode/mcp.json
{
  "mcp": {
    "servers": {
      "postgres": {
        "command": "npx",
        "args": [
          "-y",
          "@modelcontextprotocol/server-postgres",
          "postgresql://localhost/mydb"
        ]
      }
    }
  }
}
โ† Back to all servers