Stu Mason · Folkestone, Kent
One entryMerged PR· StuMason/coolify-mcp· TypeScript

PR #244 merged: feat: expose dockerfile application creation

additions
+81
deletions
-2
files changed
5

Closes #235

What

Adds a create_dockerfile action to the application tool, wiring the previously-unreachable createApplicationDockerfile client method (src/lib/coolify-client.ts). Validation mirrors create_dockerimage's style exactly: project_uuid, server_uuid, dockerfile required, with a clear Error: ... required message.

Scope narrowed from the original ask — dockerfile only

#235 asked for both create_dockerfile and create_dockercompose. This PR ships only the dockerfile half, deliberately. While verifying param shapes against current coollabsio/coolify main (fetched openapi.yaml + cross-checked routes/api.php / ApplicationsController.php; no live instance touched), I found:

  • POST /applications/dockerfile — present and unchanged. Required: project_uuid, server_uuid, dockerfile (upstream's spec formally lists environment_name/environment_uuid too, but its own description says "at least one of" — same non-enforced pattern this repo already uses for the other create_* actions, so I matched that precedent). Client types match upstream.
  • POST /applications/dockercompose no longer exists upstream. Deprecated in 7c0cb2f5 (Jan 2026), removed entirely in 6ee75cfa in favour of POST /services, and the removal shipped in v4.1.0 — so a create_dockercompose action would 404 on every current Coolify release. Shipping a dead tool action is worse than not exposing it, so it's dropped from this PR.

The compose half of #235 is therefore impossible upstream; keeping Closes #235 since dockerfile was the actionable half and the removal is now documented (the valuable part).

What happened to the compose surface instead

  • CoolifyClient#createApplicationDockerCompose is left in place but marked @deprecated with a pointer to the upstream removal and to createService (deleting it is out of scope; the client-vs-spec drift work in #247 may flag it — noting here rather than touching #247's allowlist from this branch).
  • CLAUDE.md's "Coolify API Gotchas" documents the removal: compose apps are created via the service tool / POST /services; do not wire the deprecated client method up as a tool action.
  • README.md points compose users at the service tool.

Changes

  • src/lib/mcp-server.ts — new create_dockerfile action + optional dockerfile zod field.
  • src/lib/coolify-client.ts@deprecated JSDoc on createApplicationDockerCompose (no behaviour change).
  • src/__tests__/mcp-server.test.ts — happy-path + required-param-error tests for create_dockerfile, plus the client method-existence check per repo convention.
  • README.md / CLAUDE.md — as above.

Not touched: package.json version, CHANGELOG.md, docs/coolify-openapi.yaml (#236 covers the spec refresh separately).

Test plan

Rebased onto current origin/main (post #240/#242/#248). All checked by real exit codes:

  • npm test — exit 0, 369 passed
  • npm run lint — exit 0 (4 pre-existing no-explicit-any warnings, unrelated)
  • npx prettier --check . — exit 0
  • npm run build — exit 0

🤖 Generated with Claude Code