Stu Mason
Stu Mason

Activity

Pull Request Opened

PR #108 opened: fix: resolve version mismatch (#106) and validation error crash (#107)

Summary

  • #106: get_mcp_version returned hardcoded 2.5.0 instead of 2.6.0. Replaced with dynamic read from package.json via createRequire, so version can never drift again.
  • #107: service create with docker_compose_raw crashed with messages.join is not a function. The Coolify API returns validation errors as plain strings for some fields, but the code assumed string[]. Now handles both formats.
  • Root cause of #107: The Coolify API requires docker_compose_raw to be base64-encoded, but nothing told the model this. The client now auto-encodes raw YAML to base64, and passes through values that are already base64.

Changes

  • src/lib/mcp-server.ts — Dynamic VERSION from package.json; .describe() on docker_compose_raw field
  • src/lib/coolify-client.ts — Defensive Array.isArray check before .join(); toBase64 helper; auto-encode in createService/updateService
  • src/types/coolify.ts — Widen ErrorResponse.errors to Record<string, string[] | string>; update docker_compose_raw comments
  • src/__tests__/mcp-server.test.ts — Version sync regression test
  • src/__tests__/coolify-client.test.ts — String/mixed validation error tests; base64 auto-encoding tests
  • src/__tests__/integration/smoke.integration.test.ts — Live server smoke tests
  • .claude/commands/smoke-test.md/smoke-test slash command for quick e2e verification
  • CLAUDE.md — Smoke testing docs and Coolify API gotchas

Test plan

  • npm test — 227 tests pass (4 new)
  • npm run build — compiles cleanly
  • npm run lint — no errors
  • Verified VERSION outputs 2.6.0 from built module
  • Reproduced messages.join is not a function on live server (v2.5.0)
  • Confirmed fix returns readable error instead of crash
  • Verified raw YAML auto-encodes to base64 and creates service successfully on live Coolify
  • Verified already-base64 input passes through unchanged
  • Cleaned up test service after live verification
  • Smoke integration tests pass against live Coolify instance

Fixes #106, fixes #107

+327
additions
-19
deletions
10
files changed