PostgreSQL MCP Server
TrendingAllows AI assistants to inspect database schemas, run safe read queries, analyze indexes, and explain query performance on PostgreSQL.
Install
Terminal
$npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydbmcp_config.json
{
"mcpServers": {
"postgres": {
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:pass@localhost:5432/dbname"
],
"command": "npx"
}
}
}Tools exposed2
- query
- Execute SQL queries against target database.
- inspect_schema
- Returns list of tables, columns, indexes, and primary keys.
Documentation
PostgreSQL MCP Server
Overview
Connect AI models directly to PostgreSQL to read schemas, execute optimized SQL queries, and generate data insights safely.
Installation
Add to mcp_config.json:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
}
}
}
Sourced from the repository README.
More in Data & Databases
- Codebase Memory McpHigh-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.40,326
- SQLite MCP ServerQuery and inspect local SQLite database files with zero network overhead.6,500
- ArcadeDB MCP ServerBuilt-in MCP server for ArcadeDB multi-model database (graph, document, vector, time-series)1,099
- QueryWeaverAn MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.1,070
- postgresConnect to your PostgreSQL database to query data and schemas.61
- supabaseConnect to your Supabase database to query data and schemas.61