PostgreSQL MCP Server
Provides tools for full access to a PostgreSQL database, enabling users to execute SQL queries, list tables and schemas, inspect table schemas, and monitor database statistics such as cache hit ratios and connection counts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PostgreSQL MCP ServerShow me the schema for the orders table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PostgreSQL MCP Server
An MCP (Model Context Protocol) server that gives Claude full access to your PostgreSQL database over SSE (HTTP).
Available Tools
Tool | Description |
| Run any SQL — SELECT, INSERT, UPDATE, DELETE, DDL |
| List tables with sizes and row estimates |
| Full schema of a table: columns, indexes, foreign keys |
| List all schemas in the database |
| Database size, connections, cache hit ratio, top tables |
Setup
1. Configure environment
cp .env.example .env
nano .env # fill in your Postgres credentialsKey settings:
PG_HOST— IP or hostname of your PostgreSQL serverIf Postgres runs on the same Docker host: use
host.docker.internal(Linux: requiresextra_hostsin compose) or the host's LAN IPIf Postgres runs in another Docker container/network: use the container name and add the network to docker-compose.yml
2. Build and start
docker compose up -d --build3. Verify it's working
curl http://localhost:3000/health
# → {"status":"ok","database":"connected","sessions":0}Connect Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"power-db": {
"transport": "sse",
"url": "http://YOUR_SERVER_IP:3000/sse"
}
}
}Replace YOUR_SERVER_IP with your Docker host's IP (e.g. 192.168.1.50).
Then restart Claude Desktop. You'll see the tools appear in Claude's tool panel.
Connect Claude.ai (Remote MCP)
In Claude.ai Settings → Integrations → Add MCP Server:
URL:
http://YOUR_SERVER_IP:3000/sse
Note: For claude.ai remote MCP, the server must be reachable from the internet or via a tunnel (e.g.
ngrok http 3000).
Networking Tips
Postgres on Docker host (Linux)
Add to docker-compose.yml under the service:
extra_hosts:
- "host.docker.internal:host-gateway"Then use PG_HOST=host.docker.internal.
Postgres in another Docker network
networks:
- your_postgres_network
networks:
your_postgres_network:
external: trueLogs
docker compose logs -fStop / Restart
docker compose down
docker compose up -dThis server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sebivarga/mcp_psql_home'
If you have feedback or need assistance with the MCP directory API, please join our Discord server