StuMason/coolify-mcp
TypeScript
Pull Request Opened
PR #108 opened: fix: resolve version mismatch (#106) and validation error crash (#107)
Summary
- #106:
get_mcp_versionreturned hardcoded2.5.0instead of2.6.0. Replaced with dynamic read frompackage.jsonviacreateRequire, so version can never drift again. - #107:
service createwithdocker_compose_rawcrashed withmessages.join is not a function. The Coolify API returns validation errors as plain strings for some fields, but the code assumedstring[]. Now handles both formats. - Root cause of #107: The Coolify API requires
docker_compose_rawto 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()ondocker_compose_rawfieldsrc/lib/coolify-client.ts— DefensiveArray.isArraycheck before.join();toBase64helper; auto-encode increateService/updateServicesrc/types/coolify.ts— WidenErrorResponse.errorstoRecord<string, string[] | string>; update docker_compose_raw commentssrc/__tests__/mcp-server.test.ts— Version sync regression testsrc/__tests__/coolify-client.test.ts— String/mixed validation error tests; base64 auto-encoding testssrc/__tests__/integration/smoke.integration.test.ts— Live server smoke tests.claude/commands/smoke-test.md—/smoke-testslash command for quick e2e verificationCLAUDE.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
VERSIONoutputs2.6.0from built module - Reproduced
messages.join is not a functionon 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