StuMason/coolify-mcp
TypeScript
Pull Request Opened
PR #128 opened: fix: deployment logs truncation and pagination
Summary
Fixes #115 — lines param on deployment logs was doing nothing because Coolify returns logs as a JSON array in a single line (no newlines to split on). The full 96KB+ blob was returned regardless of the lines value.
- Parse JSON array format — Coolify deployment logs are
[{output, timestamp, hidden, ...}, ...]serialized as a single string. Now parsed properly instead of naive newline splitting. - Filter hidden entries — Docker internals (
docker stop,docker rm) are markedhidden: trueby Coolify. These are now excluded, showing only meaningful build output. - Add
pageparam — Pagination through log history. Page 1 = most recent, page 2 = older batch, etc. Consistent with existingpage/per_pagepattern on list endpoints. - Return
logs_meta—{ total_entries, showing: "27-31 of 31" }so the model knows there's more to fetch. _paginationhints —next/prevwith exact tool call args, matching existing HATEOAS pattern.
Before/After
| Before | After (lines: 10) | |
|---|---|---|
| Response size | 96,060 chars | 771 chars |
| Format | Raw JSON array string | Readable [timestamp] output lines |
| Hidden entries | Included | Filtered out |
| Pagination | None | page param + _pagination hints |
Test plan
- 242 unit tests pass (6 new tests for JSON parsing, pagination, metadata)
- Smoke tested against live Coolify instance — pagination works across 3 pages
- Plain text log fallback still works (backwards compatible)
- Char limit safety net still applies
+196
additions
-26
deletions
3
files changed