hansipie/docker-mcp-server-postgres
3.2
If you are the rightful owner of docker-mcp-server-postgres and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Docker MCP Server for PostgreSQL provides a standardized interface for database interactions, enhancing security and efficiency.
Tools
6
Resources
0
Prompts
0
Docker MCP Server PostgreSQL
Dockerization of the MCP PostgreSQL server based on antonorlov/mcp-postgres-server.
Features
- MCP (Model Context Protocol) Server for PostgreSQL
- Standardized interface for database interactions
- Available tools:
connect_db,query,execute,list_schemas,list_tables,describe_table - Enhanced security with prepared statements
Usage
1. Build and launch
# Build and start the service
docker compose up --build -d
2. Add the MCP server configuration
Add this to your agent configuration file:
{
"mcpServers": {
"postgres": {
"command": "docker",
"args": [
"exec",
"-i",
"mcp-postgres-server",
"npx",
"mcp-postgres-server"
],
"env": {
"PG_HOST": "your_postgres_host",
"PG_PORT": "5432",
"PG_USER": "your_username",
"PG_PASSWORD": "your_password",
"PG_DATABASE": "your_database"
}
}
}
}
Environment variables configuration
- Dockerfile ENV - Default values
- Claude configuration - Variables passed by Claude Desktop
Available variables
| Variable | Description | Default |
|---|---|---|
PG_HOST | PostgreSQL host | localhost |
PG_PORT | PostgreSQL port | 5432 |
PG_USER | Username | postgres |
PG_PASSWORD | Password | "" |
PG_DATABASE | Database name | postgres |
Available tools
- connect_db: Database connection
- query: SELECT queries
- execute: INSERT/UPDATE/DELETE operations
- list_schemas: List database schemas
- list_tables: List tables
- describe_table: Table structure