Back to MCP Servers

PostgreSQL Server

Query and manage PostgreSQL databases with read-only access by default

databasepostgressql
By MCP Community

Installation

npm install -g @modelcontextprotocol/server-postgres

Configuration

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://user:password@localhost:5432/database"
      ]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes
View source on GitHub