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-postgresConfiguration
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:password@localhost:5432/database"
]
}
}
}How to use
- Run the installation command above (if needed)
- Open your Claude Code settings file (~/.claude/settings.json)
- Add the configuration to the mcpServers section
- Restart Claude Code to apply changes