Skip to main content
Glama
hschaletzky-pipeline

hschaletzky-pipeline

hschaletzky-pipeline

Tracks freelance project applications made through agencies and project portals, and flags postings that are likely the same end-client project before you apply twice.

Problem

Large freelance projects are often advertised by several agencies at once. Being put forward to the same end client by two agencies usually ends in a rejection. Status, contacts, cover letters and CV variants per application are also easy to lose track of.

Related MCP server: PostgreSQL MCP Server for Claude Desktop

Solution

Applications and their history live in PostgreSQL. Before applying, a duplicate check compares the new posting with existing ones (end client, location + start date + tech stack, text similarity). Claude connects through an MCP server, so checks and updates happen directly in claude.ai.

Architecture

src/
  domain/   pure business logic (status transitions, duplicate scoring) — no I/O
  db/       Drizzle schema, client, migrations runner
  auth/     token verification and protected resource metadata (resource server only)
  mcp/      MCP server: tools and the Streamable HTTP handler (SDK v2)
  http/     Express app: /health, /mcp
  config.ts environment validation
drizzle/    versioned SQL migrations (generated, committed)
docs/adr/   architecture decision records

Stack: TypeScript (strict), Node.js, Express 5, PostgreSQL 18, Drizzle ORM, Vitest, Testcontainers.

Quickstart (local)

Requirements: Node.js 26 (see .nvmrc), Docker, gitleaks for the pre-commit hook.

npm install              # also activates the gitleaks pre-commit hook
cp .env.example .env     # placeholder credentials for local use
npm run db:up            # Postgres on 127.0.0.1:5432
npm run db:migrate
npm run dev              # http://localhost:3000/health

Checks:

npm run lint
npm run typecheck
npm test                 # unit + integration (starts a Postgres container)

npm run db:migrate applies migrations as the owner role and creates or updates the least-privilege app role (pipeline_app). If BACKUP_DB_PASSWORD is set, it also manages a read-only role for backups (pipeline_backup). It is idempotent: after changing a password, just run it again.

After changing src/db/schema.ts, run npm run db:generate and commit the new migration. CI fails if schema and migrations diverge.

Connecting Claude (MCP)

Privacy and security

  • The repository never contains real data. Tests and examples use invented names only.

  • Postgres is not exposed publicly. The app connects with a role limited to reading and writing data; schema changes run separately with the owner role.

  • Logs contain ids and counts, never names, e-mail addresses or posting texts.

  • Contact details are deleted by a daily job: always once their delete_after date has passed, and optionally (CONTACT_RETENTION_DAYS) once all their applications have been closed for that long. Applications keep their history; it references contacts by id only, never by name.

  • Secret scanning: gitleaks runs as a pre-commit hook and in CI over the full history.

  • Authentication: every MCP request needs a JWT access token from hschaletzky-auth (GitHub login, one allowed user), verified locally against its published keys (ADR 0005).

  • Backups: a nightly pg_dump with the read-only pipeline_backup role, encrypted with age to a public key, so the server cannot read its own backups. /health reports the age of the last successful backup (backup.ageHours) for monitoring. The backup job itself lives in hschaletzky-infra.

Deployment

After CI passes on main, .github/workflows/deploy.yml builds the image, pushes it to ghcr.io/hannesschaletzky/hschaletzky-pipeline (tagged latest and with the commit SHA) and calls the restricted deploy command on the server. The server setup lives in hschaletzky-infra.

One image, two commands:

Command

Credentials

Purpose

node dist/db/migrate.js

owner role

apply migrations, configure app and backup roles — first on deploy

node dist/main.js (default)

app role only

serve /health, resource metadata and /mcp

Secrets are passed as files (*_FILE variables, Docker Compose secrets), never as plain environment variables. The container runs as the unprivileged node user.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides authenticated access to PostgreSQL databases for Claude AI, enabling users to browse database tables, discover schemas, and execute custom SQL queries through natural language interaction.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Desktop to interact with PostgreSQL databases through natural language for schema exploration, data analysis, and query execution. Users can search schemas, describe tables, and perform read or write operations without needing to write manual SQL.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables Claude to interact with a local PostgreSQL database through SQL queries, schema inspection, and CRUD operations.
      8
      MIT