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.
Three related issues with the application tool's create/update fields
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:
| Field | Why it's useful |
|---|---|
instant_deploy: boolean | Create + deploy in one call. (Was already in the TS request types but not in the MCP schema.) |
custom_docker_run_options: string | Add 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()tocreateApplicationDockerImage,createApplicationDockerfile,createApplicationDockerCompose. - Update
mapFqdnToDomains()to prefer an explicitdomainsvalue over the legacyfqdnalias when both are present.
src/types/coolify.ts
- Add
domains?: string,custom_docker_run_options?: string,custom_labels?: stringto all 6CreateApplication*Requesttypes and toUpdateApplicationRequest. (instant_deploywas already typed.)
src/lib/mcp-server.ts
- Add
domains,custom_docker_run_options,custom_labels,instant_deployto theapplicationtool input schema. - Thread all four through the four
create_*dispatch arms.updatepicks them up via the existing rest-spread.
Tests (+5, 268 total)
dockerimage:fqdn → domainsmapping (regression test for the bug)dockerfile: samedockercompose: same- explicit
domainstakes precedence overfqdnwhen both are passed instant_deploy,custom_docker_run_options,custom_labelspass through ondockerimage
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.