Install Postgres in Claude Code
claude mcp add sparta2025-postgres -e DATABASE_URL=... -- uvx postgres-mcp-pro{
"mcpServers": {
"sparta2025-postgres": {
"command": "uvx",
"args": [
"postgres-mcp-pro"
],
"env": {
"DATABASE_URL": "..."
}
}
}
}Replace each ... with your own value.
Frequently asked questions
What does the Postgres MCP server do?
PostgreSQL MCP server with 15 tools (SQL, EXPLAIN, health, indexes) plus a Gradio UI with LLM chat.
Is the Postgres MCP server free?
Yes, most likely. Open source and no paid account or API key is mentioned in the listing. Check the provider for current pricing.
Does Postgres run locally or remotely?
Local. Runs on your machine (stdio). You install it with npx, uvx, Docker or from source.
How do I add Postgres to Claude Code?
Run: claude mcp add sparta2025-postgres -e DATABASE_URL=... -- uvx postgres-mcp-pro
More databases MCP servers
View allPostgres DBA
a-lafon/postgres-dba-mcp
Bounded, read-only PostgreSQL access for AI assistants: nine DBA tools, compact CSV output
Pombase
pipeworx-io/mcp-pombase
PomBase MCP — the fission yeast (Schizosaccharomyces pombe) model-organism database.
PostgreSQL
itunified-io/mcp-postgres
PostgreSQL MCP Server — 27 tools for queries, schema, CRUD, DBA, HA & server management
Polyglot Database
hyperpolymath/poly-db-mcp
Unified MCP for 20 databases: SurrealDB, ArangoDB, Virtuoso, CouchDB, Cassandra, and more
PostgreSQL
neverinfamous/postgresql-mcp
PostgreSQL MCP server with 203 tools, connection pooling, HTTP/SSE, OAuth 2.1, and tool filtering
PgVouch
Shubh-Sgr/pgvouch
Safe PostgreSQL migrations: schema drift, lock analysis, safe rewrites, data checksums. Read-only.