Deploy MCP OAuth to a VPS
Resolve the project root as three directories above this SKILL.md. Perform
all local reads and commands from that root before inspecting any remote host.
Choose the edge topology
- Read
AGENTS.md,docs/DEPLOYMENT_RUNBOOK.md, anddocs/PRODUCTION_CHECKLIST.mdcompletely. - Inspect the target before writing: running containers, Compose files,
volumes, free ports, edge proxy, health, current image version, and
.envkey names without printing values. - Use
compose.yamlwhen ports 80 and 443 are free for bundled Caddy. - Use
compose.yamlpluscompose.hostinger.yamlwhen Traefik already owns the edge. Set a uniqueAPP_TRAEFIK_ROUTER_PREFIX. - Do not start a second edge proxy on occupied ports.
- Derive networks and service reachability from the merged Compose output and the running proxy. Do not invent an external Traefik network when the files do not declare one.
Prepare a recoverable release
- Run
npm run checkbefore packaging. - Validate the selected Compose merge before building.
- Back up PostgreSQL before migrations and protect the backup permissions.
- Tag the current image with an explicit rollback version.
- Transfer only source, manifests, migrations, Compose files, and proxy config.
- Exclude
.env,.git,node_modules,dist, logs, database files, and credentials from transfer packages. - Preserve existing volumes and the remote
.env.
Deploy in dependency order
- Build the
migrate,auth, andengineimage targets. - Start with
up -d --no-buildonly after the build succeeds. - Wait for PostgreSQL, the one-shot migration, OAuth, and engine health.
- Do not rerun owner bootstrap when an owner already exists.
- Create the owner interactively only for a confirmed new deployment; never persist the bootstrap password on the VPS.
Verify publicly
- Confirm container health, restart counts, and application versions.
- Review migration, auth, and engine logs for sanitized errors.
- Run the public MCP deployment probe.
- Verify protected-resource metadata, authorization discovery, and JWKS.
- Run the DCR probe and confirm temporary-client cleanup.
- Complete one real login, consent, callback, token exchange, and authenticated MCP request before declaring a new OAuth integration ready.
Roll back safely
- Repoint the application image to the preserved rollback tag.
- Do not roll back the database unless the migration is incompatible and a matching pre-deploy backup is available.
- Recreate only affected services and verify health again.
- Never delete volumes as part of a routine rollback.
Report the deployed version, topology, backup, rollback tag, health, public probes, and any manual client-flow verification that remains.