Query PostgreSQL databases with schema inspection and read-only safety
The PostgreSQL MCP Server gives your AI assistant the ability to query PostgreSQL databases with schema inspection and read-only safety. It connects to any PostgreSQL database, inspects table schemas, and executes SQL queries.
Part of the official MCP reference servers, this server provides a safe interface for database exploration. By default it operates in read-only mode, making it safe for production database inspection without risk of accidental modifications.
Perfect for developers and data analysts who want to explore database schemas, run analytical queries, and investigate data issues through natural language.
Add this to your MCP configuration file:
{
"mcpServers": {
"postgresql": {
"env": {},
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:password@localhost:5432/dbname"
],
"command": "npx"
}
}
}Official MCP reference server maintained by Anthropic/community.
30 tools verified · Open access · No issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Remote servers are capped at 8.0 because source code is not available for review. The score reflects endpoint verification only.
Be the first to review this server!
Added support for streaming responses and improved error handling for rate-limited requests.
Major release: new tool registration API, breaking changes to configuration format. See migration guide.
Added OAuth 2.0 support and improved connection pooling.
Initial stable release.