Stu Mason
Stu Mason

Activity

Pull Request Opened

PR #162 opened: fix(applications): pass domains, instant_deploy, custom_docker_run_options, custom_labels to Coolify API

Stacked on top of #161. Rebases to main cleanly once that merges.

1. Bug — fqdn silently dropped on three create paths

The mapFqdnToDomains() translation in the client was applied on the public / private-github-app / private-deploy-key / update paths, but not on dockerfile, dockerimage, or dockercompose. So calling

{
  \"action\": \"create_dockerimage\",
  \"docker_registry_image_name\": \"traefik/whoami\",
  \"ports_exposes\": \"80\",
  \"fqdn\": \"https://whoami.example.com\",
  \"...\": \"...\"
}

sent the literal key fqdn to Coolify, which dropped it. The app got created with no domain and no error surfaced to the caller — pure silent failure.

2. No way to pass domains directly

Callers naturally try domains because the Coolify API documents that name and because get_application returns the field labeled fqdn in responses. Both should work. Now both do — if both are present, explicit domains wins.

3. Three useful API fields weren't exposed

Coolify already accepts these on create + update; they were just absent from the MCP surface:

FieldWhy it's useful
instant_deploy: booleanCreate + deploy in one call. (Was already in the TS request types but not in the MCP schema.)
custom_docker_run_options: stringAdd flags like `--network=...` without going to the UI.
custom_labels: string (base64)Custom Traefik routing rules beyond what FQDN auto-generates.

Changes

src/lib/coolify-client.ts

  • Apply mapFqdnToDomains() to createApplicationDockerImage, createApplicationDockerfile, createApplicationDockerCompose.
  • Update mapFqdnToDomains() to prefer an explicit domains value over the legacy fqdn alias when both are present.

src/types/coolify.ts

  • Add domains?: string, custom_docker_run_options?: string, custom_labels?: string to all 6 CreateApplication*Request types and to UpdateApplicationRequest. (instant_deploy was already typed.)

src/lib/mcp-server.ts

  • Add domains, custom_docker_run_options, custom_labels, instant_deploy to the application tool input schema.
  • Thread all four through the four create_* dispatch arms. update picks them up via the existing rest-spread.

Tests (+5, 268 total)

  • dockerimage: fqdn → domains mapping (regression test for the bug)
  • dockerfile: same
  • dockercompose: same
  • explicit domains takes precedence over fqdn when both are passed
  • instant_deploy, custom_docker_run_options, custom_labels pass through on dockerimage

Test plan

  • npm run build — clean
  • npm test — 268 passed (263 existing + 5 new)
  • Live verification deferred: I'm wiring this up in production via a fork-build right after merge; happy to add the run output here if useful.
+151
additions
-4
deletions
4
files changed