feat: add postgresql-mcp Docker image + CI build step
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
tobjend 2026-06-21 18:15:18 +02:00
parent e943f9a0e9
commit 128cce3248
3 changed files with 58 additions and 0 deletions

View file

@ -62,3 +62,15 @@ steps:
- docker login forgejo.corentic.eu -u tobi -p $FORGEJO_REGISTRY_TOKEN
- docker build -t forgejo.corentic.eu/corentic/mcp-fleet-github:latest -f github/Dockerfile github/
- docker push forgejo.corentic.eu/corentic/mcp-fleet-github:latest
build-postgresql:
image: docker:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
FORGEJO_REGISTRY_TOKEN:
from_secret: forgejo_registry_token
commands:
- docker login forgejo.corentic.eu -u tobi -p $FORGEJO_REGISTRY_TOKEN
- docker build -t forgejo.corentic.eu/corentic/mcp-fleet-postgresql:latest -f postgresql/Dockerfile postgresql/
- docker push forgejo.corentic.eu/corentic/mcp-fleet-postgresql:latest

7
postgresql/Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM node:22-slim
RUN npm install -g mcp-proxy@6.5.2 mcp-postgres@1.3.0
EXPOSE 8109
CMD ["mcp-proxy", "--port", "8109", "--host", "0.0.0.0", "--", "mcp-postgres"]

39
postgresql/README.md Normal file
View file

@ -0,0 +1,39 @@
# postgresql-mcp
MCP server for PostgreSQL database operations.
Source: [`mcp-postgres`](https://npm.im/mcp-postgres)
## Environment Variables
Uses standard PostgreSQL environment variables via `pg` module:
| Variable | Required | Description |
|----------|----------|-------------|
| `PGHOST` | Yes | PostgreSQL host |
| `PGPORT` | No | PostgreSQL port (default: `5432`) |
| `PGUSER` | Yes | PostgreSQL user |
| `PGPASSWORD` | Yes | PostgreSQL password |
| `PGDATABASE` | Yes | PostgreSQL database name |
## Usage
```bash
docker run -d \
--name postgresql-mcp \
-p 8109:8109 \
-e PGHOST=postgres.example.com \
-e PGPORT=5432 \
-e PGUSER=myuser \
-e PGPASSWORD=secret \
-e PGDATABASE=mydb \
forgejo.corentic.eu/corentic/mcp-fleet-postgresql:latest
```
## Tools
- `query` — Execute read-only SQL queries (SELECT, EXPLAIN, etc.)
- `execute` — Execute write SQL (INSERT, UPDATE, DELETE, DDL)
- `list_tables` — List tables in the database
- `describe_table` — Get schema info for a specific table
- `get_table_stats` — Row counts and table statistics