diff --git a/.woodpecker.yml b/.woodpecker.yml index c4483a9..78b411d 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -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 diff --git a/postgresql/Dockerfile b/postgresql/Dockerfile new file mode 100644 index 0000000..6d5bb45 --- /dev/null +++ b/postgresql/Dockerfile @@ -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"] diff --git a/postgresql/README.md b/postgresql/README.md new file mode 100644 index 0000000..70f143d --- /dev/null +++ b/postgresql/README.md @@ -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