We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yty-build/postgres_mcp_allaccess'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
docker-entrypoint.shβ’1.94 KiB
#!/bin/bash
# Docker entrypoint for MCP Server with embedded PgBouncer
set -e
echo "π Starting YT PostgreSQL MCP Server..."
# Check if PgBouncer is enabled
if [ "${PGBOUNCER_ENABLED}" = "true" ]; then
echo "π¦ PgBouncer enabled - preparing configuration..."
# Check required environment variables
if [ -z "$POSTGRES_USER" ] || [ -z "$POSTGRES_PASSWORD" ]; then
echo "β οΈ Warning: POSTGRES_USER or POSTGRES_PASSWORD not set"
echo " PgBouncer will be configured, but may fail to connect"
fi
# Get real PostgreSQL host/port (what PgBouncer connects to)
REAL_HOST="${POSTGRES_REAL_HOST:-${POSTGRES_HOST:-localhost}}"
REAL_PORT="${POSTGRES_REAL_PORT:-${POSTGRES_PORT:-5432}}"
# Update pgbouncer.ini with real PostgreSQL connection
sed -i "s/\${POSTGRES_HOST}/${REAL_HOST}/g" /etc/pgbouncer/pgbouncer.ini
sed -i "s/\${POSTGRES_PORT}/${REAL_PORT}/g" /etc/pgbouncer/pgbouncer.ini
sed -i "s/\${POSTGRES_DATABASE}/${POSTGRES_DATABASE:-postgres}/g" /etc/pgbouncer/pgbouncer.ini
# Generate userlist.txt with plain password
echo "\"$POSTGRES_USER\" \"$POSTGRES_PASSWORD\"" > /etc/pgbouncer/userlist.txt
chmod 600 /etc/pgbouncer/userlist.txt
echo "β PgBouncer configuration complete"
echo " Connecting to PostgreSQL at ${REAL_HOST}:${REAL_PORT}/${POSTGRES_DATABASE}"
echo " Listening on localhost:6432"
# Start PgBouncer in background
echo "π Starting PgBouncer..."
pgbouncer -d /etc/pgbouncer/pgbouncer.ini
# Wait a moment for PgBouncer to start
sleep 2
# Check if PgBouncer is running
if pgrep -x "pgbouncer" > /dev/null; then
echo "β PgBouncer started successfully (PID: $(pgrep -x pgbouncer))"
else
echo "β PgBouncer failed to start"
exit 1
fi
else
echo "π¦ PgBouncer disabled - connecting directly to PostgreSQL"
fi
# Start MCP Server
echo "π Starting MCP Server..."
exec python -m src.yt_postgres_mcp.server