This guide walks you through preparing your PostgreSQL environment for MCPMark evaluation.
-
Run PostgreSQL Container Start a PostgreSQL instance using Docker:
docker run -d \ --name mcpmark-postgres \ -e POSTGRES_PASSWORD=password \ -e POSTGRES_USER=postgres \ -p 5432:5432 \ pgvector/pgvector:0.8.0-pg17-bookworm
-
Verify Container is Running
docker ps | grep mcpmark-postgres
-
Download Database Backups Download the backup files and place them in
./postgres_state/directory:mkdir -p ./postgres_state cd ./postgres_state # Download all database backups wget https://storage.mcpmark.ai/postgres/employees.backup wget https://storage.mcpmark.ai/postgres/chinook.backup wget https://storage.mcpmark.ai/postgres/dvdrental.backup wget https://storage.mcpmark.ai/postgres/sports.backup wget https://storage.mcpmark.ai/postgres/lego.backup cd ..
-
Create Databases and Restore from Backups
Make sure your Postgres client version matches the server's version (e.g., pg17).
# Set the password environment variable export PGPASSWORD=password # Create and restore each database createdb -h localhost -U postgres employees pg_restore -h localhost -U postgres -d employees -v ./postgres_state/employees.backup createdb -h localhost -U postgres chinook pg_restore -h localhost -U postgres -d chinook -v ./postgres_state/chinook.backup createdb -h localhost -U postgres dvdrental pg_restore -h localhost -U postgres -d dvdrental -v ./postgres_state/dvdrental.backup createdb -h localhost -U postgres sports pg_restore -h localhost -U postgres -d sports -v ./postgres_state/sports.backup createdb -h localhost -U postgres lego pg_restore -h localhost -U postgres -d lego -v ./postgres_state/lego.backup
-
Verify Databases are Imported
# List all databases PGPASSWORD=password psql -h localhost -U postgres -c "\l"
Configure environment variables: make sure the following enservice credentials are added in .mcp_env:
## PostgreSQL Configuration
POSTGRES_HOST="localhost"
POSTGRES_PORT="5432"
POSTGRES_USERNAME="postgres"
POSTGRES_PASSWORD="password"Verify the PostgreSQL setup is working correctly:
# Test connection using psql
PGPASSWORD=password psql -h localhost -U postgres -c "SELECT version();"docker stop mcpmark-postgresdocker start mcpmark-postgresdocker stop mcpmark-postgres
docker rm mcpmark-postgresPGPASSWORD=mysecretpassword psql -h localhost -U postgresFor single task or task group, run
python -m pipeline --exp-name EXPNAME --mcp postgres --tasks POSTGRESTASK --models MODELHere EXPNAME refers to customized experiment name, POSTGRESTASK refers to the postgres task or task group selected (see tasks/ for specific task information), MODEL refers to the selected model (see Introduction Page for model supported), K refers to the time of independent experiments.
If port 5432 is already in use, you can use a different port:
docker run -d \
```bash
docker run -d \
--name mcpmark-postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_USER=postgres \
-p 5433:5432 \
pgvector/pgvector:0.8.0-pg17-bookwormRemember to update POSTGRES_PORT="5433" in your .mcp_env file.
Ensure the Docker container is running and the port mapping is correct:
docker ps
docker logs mcpmark-postgres