claude install nacho/postgres-mcp-serverAn MCP (Model Context Protocol) server that gives Claude Code direct access to your PostgreSQL database. Enables schema exploration, safe query execution, and AI-powered migration generation directly from your Claude Code environment.
pg-pool--allow-writes flag| Tool | Description |
|---|---|
list_tables | List all tables in the database |
describe_table | Get column details for a table |
run_query | Execute a read-only SQL query |
generate_migration | Generate a migration from a natural language description |
Add to your Claude Code MCP settings:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["postgres-mcp-server"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
}
Be the first to share your thoughts