Skip to content

feat: read database uri from secret file - #222

Open
ArtARTs36 wants to merge 2 commits into
crystaldba:mainfrom
ArtARTs36:main
Open

ArtARTs36 wants to merge 2 commits into
crystaldba:mainfrom
ArtARTs36:main

Conversation

@ArtARTs36

@ArtARTs36 ArtARTs36 commented Sep 13, 2026

Copy link
Copy Markdown

Adds support for reading the PostgreSQL connection URI from a mounted secret file using DATABASE_URI_PATH.

This makes it possible to provide database credentials through Docker/Kubernetes secrets without putting the connection URI directly into the container environment.

Usage

docker run -i --rm \
  -v /path/to/database-uri:/run/secrets/database-uri:ro \
  -e DATABASE_URI_FILE=/run/secrets/database-uri \
  crystaldba/postgres-mcp --access-mode=unrestricted

The mounted file should contain the PostgreSQL connection URI: postgresql://user:password@host:5432/database

Precedence

The existing behavior remains backward compatible:

  • Env DATABASE_URI
  • Env DATABASE_URI_FILE
  • CLI database URL argument

If both DATABASE_URI and DATABASE_URI_FILE are provided, DATABASE_URI takes precedence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant